sqlitebrowser icon indicating copy to clipboard operation
sqlitebrowser copied to clipboard

New Version includes sqlite 3.35.5 but doesn't have math functions

Open FreeTrade opened this issue 4 years ago • 7 comments

To reproduce - run sql command select pow(2,2)

  • overwriting the included dll with the sqlite dll https://www.sqlite.org/2021/sqlite-dll-win64-x64-3350500.zip

resolves the issue

FreeTrade avatar May 23 '21 04:05 FreeTrade

@justinclift - The docs say "but are only active if the amalgamation is compiled using the -DSQLITE_ENABLE_MATH_FUNCTIONS compile-time option. " - is the sqlite3.dll that we ship compiled with this option? For Windows, how does changing the sqlite3.dll work? I thought there was an sqlite library 'baked' into DB4S? Changing the DLL doesn't change the value in 'help' and 'about', but if I type select sqlite_version() then it does. Interestingly, if I remove that DLL and check the version again, it says 3.9.2?

image

Is that the 'baked in' version?! Or just a 'sqlite doesn't know what to show, so shows some random number'... ? DB4S seems to work OK without that sqlite3.dll being there... (unless DB4S has picked up another version somewhere else on my system ... that might be it, and why its an older version....)

chrisjlocke avatar May 25 '21 15:05 chrisjlocke

@chrisjlocke Try running it again, with one of those debugging tools attached to show the libraries (with full path) it's loading.

It sounds like the version that's been dropped-in is a close enough match to still work with the one we include. As for the 3.9.2 version, my initial guess is that there's a 3.9.2 SQLite dll on your system that Windows is probably falling back onto when nothing else is in the directory.

justinclift avatar May 25 '21 15:05 justinclift

This nice guy builds 64bit builds of SQLite with several compile time options.

Maybe it'll give you a hint on what needs to be enabled for the dll in DB4S: https://github.com/nalgeon/sqlite/blob/main/.github/workflows/build.yml

Alternatively, his other repo has dll options for several different extensions that could be added in, manually, by the user of DB4S. https://github.com/nalgeon/sqlean

Or this project could include @nalgeon's extensions with the release. That's more of a management decision, rather than a technical one, though. ;)

FWIW, Chris' query shows this for me:

sqlite_version()
3.35.5

jungle-boogie avatar May 25 '21 16:05 jungle-boogie

@chrisjlocke I haven't tested on Windows but on Linux this issue is solved by latest nightly build!

https://github.com/sqlitebrowser/sqlitebrowser/commit/fb43e0677a4e39d09b5288a6902b34d8c400f5d9

I am able to run select exp(sum(ln(tbl.stuff))) to get the product of a column! Is this issue resolved for Windows users too?

evbo avatar Aug 05 '22 15:08 evbo

Not without dropping in a replacement sqlite3.dll. The nightly doesn't have the DLL with the correct option.

chrisjlocke avatar Aug 05 '22 15:08 chrisjlocke

@chrisjlocke hopefully AppImages can be trusted as truly "isolated". ln() was not found if I ran this: DB_Browser_for_SQLite-master-1-a14e6eb-x86_64.AppImage

But I'm now running this and ln() is found (along with exp):

DB_Browser_for_SQLite-master-1-fb43e06-x86_64.AppImage

So maybe some functions are more available? Odd because I would think all math functions would be co-located...

evbo avatar Aug 05 '22 16:08 evbo