Lumosql

Timeline
Login

Timeline

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

50 most recent check-ins that include changes to files matching 'not-fork.d/*'

2026-10-21
15:03
Apply =latest so every build matrix includes SQLite tip by default, unless something else is specified. check-in: a480ef2add user: danshearer tags: trunk
2026-10-18
16:45
Follow trunk tip for libdb, because its quite fast-moving. Unlikely to break the tree because core capabilities aren't changing much, this is about bug fixes and bringing an ancient codebase somewhat into the modern age. check-in: 454cda7c6d user: danshearer tags: trunk
00:27
Raise version_from_branch to 3.55.0 check-in: 8522fe024e user: danshearer tags: trunk
2026-10-17
21:56
not-fork.d/sqlite3/upstream.conf Raise version_from_branch to 3.55.0 (required by fossil anyway) closed check-in: 1025f62bcd user: danshearer tags: mistake
21:55
lmdb, lmdbv1, libdb: Spurious SQLITE_CORRUPT was logged on certain lookups which store only the nKeyField ordering columns, and a full-key search such as OP_Found compared past the end of the stored key. Stopping after nKeyField fields stops the error via new lumoStoredKeyCompare. PRAGMA integrity_check no longer logs corruption. check-in: c5fdd693e9 user: danshearer tags: trunk
19:09
Assorted libdb fixes: Keep destination commit counter when doing a VACUUM RowCountEst counts the entries properly Removed ephMinNode unused code Restore nDrop during SAVEPOINT rollback check-in: 10f6c7e13b user: danshearer tags: trunk
12:23
Make PRAGMA data_version work (ie be updated) for all backends. This is a strong hint the database has changed, maintained via SQLITE_FCNTL_DATA_VERSION whihc is what we are updating now. check-in: ea3edcf4c0 user: danshearer tags: trunk
12:19
Add fsync on the non-encrypted VACUUUM check-in: 606950d5fe user: danshearer tags: trunk
12:17
lmdbv1 - copy the VACUUM scratch with mdb_env_copy2 instead file copy loop Much better to use LMDBs internal functions, less code, more efficient. Had to add an fsync after the call. check-in: 02ca471849 user: danshearer tags: trunk
09:00
Invalidate incremental blob handles when their row changes In the lmdb, lmdbv1 and libdb backends a blob handle stayed valid after its row was replaced, updated or deleted, or its table cleared. A write through it then landed in another row, inside another column, or, in libdb, restored the old row; a libdb write after DELETE failed and rolled the DELETE back. check-in: 49bde2cf95 user: danshearer tags: trunk
03:46
Stray comment fix check-in: 654902f5d6 user: danshearer tags: trunk
2026-10-16
23:12
Remove dead code in the lmdb and lmdbv1 btree, and fix two pager constants. check-in: 5fb4baf0c4 user: danshearer tags: trunk
22:47
Correct the comments in the lmdb, lmdbv1 and libdb backends. This comment cleanup marks a milestone. These comments evolved from years ago when we knew nothing about how LumoSQL would work or even if it is was possible. There were comments that contradicted the code, SQLite, LMDB or libdb, upstream SQLite headers that did not describe this code, history in place of present behaviour, unclear references and unsourced claims. ` 29 files, 1412 lines added and 2390 removed. No code changes. check-in: 7721bbb9d2 user: danshearer tags: trunk
21:49
Four small code changes that became obvious during the prep for the giant comment commit that's been in preparation for weeks. check-in: e8761c151f user: danshearer tags: trunk
20:17
Fix two ephemeral-table defects in the three non-native backends: lmdb, lmdbv1 and libdb. WITH m(z) AS MATERIALIZED (SELECT zeroblob(5)) SELECT hex(z) FROM m; failed with "database disk image is malformed". The stored row now includes the pX->nZero zero bytes. check-in: 171ba1a20b user: danshearer tags: trunk
17:44
The lazy dirty-list patches allocated each environment's write scratch before acquiring me_wmutex. Concurrent first write attempts could both allocate it and leak one allocation. Now we serialise: acquire the writer mutex first, release it on allocation failure. MDB_NOLOCK is a special case. check-in: 29d0d5fc1c user: danshearer tags: trunk
17:33
Make LMDB backups safe with active readers and copy failures. LMDB ties read transactions to threads unless MDB_NOTLS is set. Open both backend environments with MDB_NOTLS. check-in: 356a3d0853 user: danshearer tags: trunk
17:10
Preserve non-WAL checkpoint result counters: SQLite initialises the sqlite3_wal_checkpoint_v2() output counters to -1 and documents that value for databases outside WAL mode. Retain those values in the LMDB, LMDBv1 and libdb checkpoint hooks so callers can distinguish a database outside WAL mode from a WAL containing zero frames. check-in: a624d976ce user: danshearer tags: trunk
17:00
Identical no-op build time fix for libdb as previous commit for LMDB backends; forgot to include it. check-in: af1f7d9a65 user: danshearer tags: trunk
16:58
SQLite has shared-cache mode, sharing the BtShared object and applies SQLite's schema and table locking rules, requiring SQLite to be threadsafe. Of LumoSQL backends, only the SQLite native is threadsafe in this sense and can support shared-cache mode. One layer down, libdb already does cached connection sharing, and the LMDBs *could* do it via environment pooling (which would be a good idea.) But this requires plumbing to connect the lower-level connection pooling with the SQLite shared-cache mode, which is a fairly complex project. At compile time, each LumoSQL replacement backend implements the btree.h contract selected by SQLITE_THREADSAFE and SQLITE_OMIT_SHARED_CACHE. Because the current LMDB, LMDBv1 and libdb backends do not expose SQLite shared-cache mode, their Enter and Leave functions are no-ops. check-in: 0de6aac9f8 user: danshearer tags: trunk
16:29
Map LMDBv1 address and DBI errors correctly check-in: 6761329852 user: danshearer tags: trunk
14:48
Delete obsolete comment, because AVL tree of in-memory databases is now pretty well tested. check-in: e3a42dfb31 user: danshearer tags: trunk
14:30
An LMDBv1 page-checksum Lumo build checksums every database except temp and memdb databases. VACUUM builds its rebuilt copy in a temp database (which therefore has no checksums) and sqlite3BtreeCopyFile then copies the temp database byte for byte over the live file. The copy therefore had no checksums, and VACUUM failed with "database disk image is malformed". Fix sqlite3BtreeOpen so it now sets up checksums and MDB_REMAP_CHUNKS for a temp database opened while DBFLAG_Vacuum is set. check-in: bc26356cb1 user: danshearer tags: trunk
14:12
Remove unreachable/unused code found by static analysis. Shuffle comments accordingly. check-in: 27cd7be44d user: danshearer tags: trunk
13:01
Make LMDB backend comments match reality for page size change requests check-in: 59a38334ca user: danshearer tags: trunk
09:42
PRAGMA data_version indicates if a database is modified by maintaining a counter when operations have happened. In alternative backends (currently 3 of them) we now track a commit counter local to each connection. This also means we now correctly release the process lock after a full rollback. Found by doing an audit of commit semantics for the new (in fact, ancient) libdb backend. check-in: 08217f08dc user: danshearer tags: trunk
09:36
On both LMDB backends, compare rows in WITH ROWID tables as signed int, expose EBUSY as SQLITE_BUSY, and bounds-check rowid values. check-in: 32bdc434f6 user: danshearer tags: trunk
09:29
Following some UBSan errors on rowsum (significantly helped by testing on Alpine and FreeBSD with their differently less tolerant libcs) did a full audit of all the different physical kinds of records we can have in LumoSQL. Turns out there are 5, and 5 conditions under which these can be read. That lead to a very tricky bit of validation work. We now have reliable rowsum (or MAC, or whatever encryption we add in the future) for all 10 record types. Added the record and handling types to the docs. check-in: 8850565b91 user: danshearer tags: trunk
09:11
Require valid salt for encrypted database opens check-in: bb3011ae77 user: danshearer tags: trunk
2026-10-15
11:32
Use pkg-config to find SQLite dependency on MacOS (from Dan Mestas) check-in: 886a45930a user: danshearer tags: trunk
11:20
Remove GNU rpath-link flags on macOS (from Dan Mestas) check-in: a1906cc0f0 user: danshearer tags: trunk
11:18
Link lmdbv1.0 statically on macOS (from Dan Mestas) check-in: f709e73920 user: danshearer tags: trunk
11:17
On macOS, statically link lmdb v0.9 (from Dan Mestas) check-in: 8bfb8fffe5 user: danshearer tags: trunk
11:14
Fix two libdb btree.c defects found during the MacOS port by Dan Mestas. check-in: 59e65b5c3b user: danshearer tags: trunk
2026-10-08
07:13
Error mapping and handling in btree for libdb... Implement the errors for libdb integrity_check. Implement the (many many) libdb transaction errors, and return a single SQLITE_ABORT_ROLLBACK for any of them. check-in: d02c4183e3 user: danshearer tags: trunk
07:10
Implement libdb backup handles, and return SQLite errors for them check-in: 6c15f1d857 user: danshearer tags: trunk
2026-10-07
23:42
Remove libdb region files (caches) when a database is closed. Otherwise a fresh open and read gets cache. Picked up by rowsum, proving it works already :) check-in: eb4312258a user: danshearer tags: trunk
22:41
Add the libdb backend check-in: 6fcc6a0857 user: danshearer tags: trunk
2026-09-21
12:46
Trivial changes to enforce minimal version of not-forking v0.8. check-in: 384f0e98f6 user: danshearer tags: trunk
10:09
Copy fix for readonly LMDB lockfiles to LMDB Fix comment typo in the same bit of LMDBv1 code check-in: 7929c2366d user: danshearer tags: trunk
09:55
LMDBv1: refuse a read-only open whose lock file is not writable, unless the filesystem is read-only or the caller passes nolock=1. See comment for details. Report refusal in sqlite3_log. check-in: 867631ed1f user: danshearer tags: trunk
09:25
Fix valgrind find of uninitialised variable. Optimise instruction count using this same variable, spotted using callgrind check-in: c8f256f775 user: danshearer tags: trunk
2026-09-18
10:50
Small libsodium usage improvement: start to use sodium_memzero() properly. In this case, calling it after freeing p->encKey because these are things that should not be left lying around. check-in: a8d93fcdc3 user: danshearer tags: trunk
10:47
Any SQL that does a write transaction causes BeginTrans to be used, and SQLite shows that the write lock needs to be released if there are any failures early in the transaction process. This behaviour is now copied in the LMDB backends, so that the lock is released and SQLITE_CORRUPT/NOMEM/etc is returned. check-in: b0051e4b7a user: danshearer tags: trunk
10:25
SQLite does optimistic transaction upgrades, starting with a read and then if it has to be write then it aborts the read and opens a write. In the LMDB backends we now correctly handle failures in this process. This was detected by an LLM following allocation failure paths, and it did a good job. Actually several LLMs, all suspiciously checking each others work in a harness. check-in: d52f344481 user: danshearer tags: trunk
10:19
LMDB backends: a cursor that failed to open was still in the cursor list, and so it got unlinked and that corrupts the cursor list. check-in: dde5caeb62 user: danshearer tags: trunk
10:16
The RAM-based ephemeral table system now reports allocation failure. Found when testing on Alpine under memory pressure, but I don't think it was anything to do with Alpine's musl. check-in: 9c86b89036 user: danshearer tags: trunk
10:13
This goes back to when we first learned about SAVEPOINT (see doc/context-what-are-savepoints.md ). In the LMDB backends we now do not free a savepoint when a commit fails. check-in: 338feea200 user: danshearer tags: trunk
10:09
This turned up on FreeBSD testing but applies to all platforms: need to close LMDB cursors before their transaction ends. This is about SQLite's cursor tripping, which I don't find obvious at all. Review from an SQLite expert would really help. in this case though, invalidateCursors() left both tripped and writeOnly read cursors open, and LMDB freed them at commit or abort. Any pending SQL statement then freed them again, so that was clearly wrong. check-in: 36271a9261 user: danshearer tags: trunk
10:02
Thanks to an eagle-eyed tester! Fix the following spectacular fail: BEGIN; CREATE TABLE t(a); INSERT INTO t VALUES(1); PRAGMA lmdb_transaction=optimistic; ROLLBACK; The table is still on disk despite the ROLLBACK. Abort message is "double free or corruption", oops. The LMDB-specific pragma was writing into all transactions, not just the ones it had started itself. check-in: 86d9ed8144 user: danshearer tags: trunk