Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108016

Enable Built-In Mathematical SQL Functions for SQLite ( -DSQLITE_ENABLE_MATH_FUNCTIONS)



    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • 6.5.0 Beta1
    • 6.4.0
    • SQL Support, sqlite
    • None
    • Tried with Qt stock binary (open source) packages:

      • Qt 5.15.2 and Qt 6.4
      • With both on macOS and Windows (MinGW)
    • All
    • fa4c8fa71a (qt/qtbase/dev) fa4c8fa71a (qt/tqtc-qtbase/dev)


      SQLite supports mathematical functions like sin() and cos(), however they need to be explicitly enabled during compile time with the -DSQLITE_ENABLE_MATH_FUNCTIONS flag:


      However this doesn't seem to be the case for the binary Qt (open source) releases, as "empirical tests" with both Qt 5.15.2 and the latest Qt 6.4 on both Windows and macOS have suggested (in each case the Qt stock binary open source distribution was used, as aquired via the Qt Maintenance Tool).

      So the suggestion here would be to compile and provide the SQLite Qt plugin in upcoming binary releases (e.g. Qt 6.5 onwards) with the math functions enabled ( -DSQLITE_ENABLE_MATH_FUNCTIONS), if at this point the omission of this compiler flag was not a concious decision (e.g. to reduce the plugin size to a minimum).

      While I cannot back this up, but I believe adding those additions math functions would merely affect the plugin size, but not the execution speed of SQL executed against SQLite (especially for existing SQL statements that wouldn't make use of those math functions like sin(), cos() etc.).



        For Gerrit Dashboard: QTBUG-108016
        # Subject Branch Project Status CR V



            chehrlic Christian Ehrlicher
            till213 Oliver Knoll
            0 Vote for this issue
            2 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes