ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
525 stars 109 forks source link

SQLite 3.31 is still showing on SQLite Version in SQLite_version function. #379

Closed aarong-av closed 3 years ago

aarong-av commented 3 years ago

Regarding the 2.0.4 release, it states that 3.33 SQLite is the version in use; however, I am not seeing that is the case when I run a SQLite version function on the SQLite database.

Is there something missing here? image

Here is my dependency tree:

I've upgraded all my versions to 2.0.4. Any idea if the version function is off or the baseline.

Any assistance is appreciated!

References: https://github.com/ericsink/SQLitePCL.raw/issues/350

aarong-av commented 3 years ago

I added an example repository that is a pared-down version (so I could validate it wasnt any transitives) and included a dependency tree output. https://github.com/aarong-av/SQLiteSample/blob/master/README.md

Instructions to recreate the problem I am seeing are in the README.md.

See the dependency-tree.txt for more information. Searching for e_sqlite in the file will show that 2.0.4 is definitely in use, but if you connect to the SQLite database and run that version function it clearly is showing 3.31.

I started scanning through the https://github.com/ericsink/cb repo to see if there is something that isn't properly set, but I didnt see anything immediate.

Any assistance is appreciate. The CVEs associated with versions prior to 3.33 are why I need this upgrade.

Let me know if you need more information to replicate what I am seeing.

ericsink commented 3 years ago

In your repro instructions, you say "Use the SQLite Client of your choice" and then "select SQLite_version();". That is giving you the version of the SQLite client you chose, not the one that was used to write the SQLite file.

aarong-av commented 3 years ago

Thanks so much for taking the time to reply! It's much appreciated.

Here's a few more details on my approach. I've been connecting using the SQLTools plugin available in VS Code. Here is the extensions source: https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools-driver-sqlite

My understanding is that the select SQLite_version(); should show the version of the database itself not the version of the client.

If you note the versions of the SQLite Client VS Code Extension here: https://github.com/mtxr/vscode-sqltools/tree/master/packages/driver.sqlite ... these are quite different versions than the 3.xx that we are seeing on VSCode.

Maybe I'm crazy, but it seems the version of the SQLite itself is at 3.31 not 3.33 when using 2.0.4 SQLitePCL.raw.

Thanks again for the time.

ericsink commented 3 years ago

From the docs:

"The sqlite_version() function returns the version string for the SQLite library that is running."

https://sqlite.org/lang_corefunc.html

The sqlite_version() function doesn't even need or use an open db file.

Anything you're doing with VS Code or an extension or a SQL tool or whatever -- it is giving you the SQLite version for that tool, not the one that created the SQLite file.

The code in my repo is 3.33.0. My test suite checks the SQLite version on every build. It says 3.33.0.

aarong-av commented 3 years ago

Sorry I just saw your note.

Using the DB Browser for SQLite (totally different database client) yields the same output at Select SQLite_version();

See left side: image

I have to produce some validation that it's at 3.33. Do you have a screenshot or text output I can use to show its truly at 3.33?

Thanks again for the help!

ericsink commented 3 years ago

In this repo, in the directory test_nupkgs/smoke, there is a simple test program.

Copy the two files ( smoke.csproj and Program.cs ) somewhere into an empty directory.

In smoke.csproj, change the package version numbers to 2.0.4.

Type "dotnet run"

It should say 3.33.0

aarong-av commented 3 years ago

Thanks!

Looks good to me.

image