IreneKnapp / direct-sqlite

MIT License
35 stars 54 forks source link

update embedded sqlite to 3.36.0 #90

Closed thalesmg closed 2 years ago

thalesmg commented 3 years ago

Since the current version of the embedded sqlite (3.28.0 from #80 ), some new features have been released. One of them is the experimental trigram tokenizer for fts5.

I had to change the test testGetAutoCommit for some reason that is not clear to me. I could not find in the changelog the reason for this change in behavior. At the time of writing, the get_autocommit function documentation seems to mention that SQLITE_FULL is one of the errors that should induce an automatic ROLLBACK.

Yet, a manual test of the broken test case seems to show that this is not the case anymore:

ͳ sqlite3 /tmp/test.db
SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
sqlite> begin;
sqlite> PRAGMA max_page_count=1;
1
sqlite> CREATE TABLE foo (a INT);
Error: database or disk is full
sqlite> rollback;
sqlite> -- if I try to rollback again...
sqlite> rollback;
Error: cannot rollback - no transaction is active
sqlite> 

That behavior was indeed present in older versions, as the following test in the haskell:8.10.4 docker image reveals:

root@77c1a3ff8d01:/# sqlite3
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> begin;
sqlite> PRAGMA max_page_count=1;
1
sqlite> CREATE TABLE foo (a INT);
Error: database or disk is full
sqlite> rollback;
Error: cannot rollback - no transaction is active
sqlite> 

With that, I changed the test case to reflect this new behavior.

chreekat commented 3 years ago

Anything I can do to help with this?

Pinging @sigrlami as well since you're the maintainer listed on Hackage.

IreneKnapp commented 2 years ago

@sigrlami We should probably merge this. Are you still interested in being the maintainer? I can try to find someone else if not, but I've kinda drifted away from the Haskell community...

sigrlami commented 2 years ago

@IreneKnapp @chreekat sorry, I will update it this week, too much work on my job.

IreneKnapp commented 2 years ago

no problem, and totally understood. paying work does have to come first.

ad-si commented 2 years ago

@sigrlami Sorry to bother you, but it would be great if this was merged 😅

thalesmg commented 2 years ago

Since it has been a while, new versions of Sqlite were released.

I made another PR with an update for 3.37.2, if anyone is interested: #91

jchia commented 2 years ago

I've separately updated to 3.38.5. Regarding the failing test, the approach I chose was to remove it as in #93.