]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
9 days agoMerge all the latest trunk enhancements and fixes into the reuse-schema branch. reuse-schema
drh [Sat, 23 May 2026 11:26:44 +0000 (11:26 +0000)] 
Merge all the latest trunk enhancements and fixes into the reuse-schema branch.

FossilOrigin-Name: b974acea28f77ffa7e80f641733966d004641fa8e7971ace9b332d706acd8dd4

10 days agoStrengthen the statement about not accepting agentic code.
drh [Fri, 22 May 2026 17:51:15 +0000 (17:51 +0000)] 
Strengthen the statement about not accepting agentic code.

FossilOrigin-Name: 64b707f4b3177384b611df5f5e4ca7da44d86313f74ff943a00581a6dd924b08

10 days agoUpdate the session module so that it can apply changesets containing two or more...
dan [Fri, 22 May 2026 14:29:33 +0000 (14:29 +0000)] 
Update the session module so that it can apply changesets containing two or more UPDATE changes that form a dependency loop - so that no single UPDATE can be applied independently without violating a constraint.

FossilOrigin-Name: 32c762bbb187e3bc964dcaad0949ebeb4da21331be842a5868feeac6088790ca

10 days agoAdd the SQLITE_CHANGESETAPPLY_NOUPDATELOOP option to the sqlite3_changeset_apply_v2... session-update-loops
dan [Fri, 22 May 2026 14:22:14 +0000 (14:22 +0000)] 
Add the SQLITE_CHANGESETAPPLY_NOUPDATELOOP option to the sqlite3_changeset_apply_v2/3() method. To disable the extra processing to commit changesets that swap two or more values subject to a UNIQUE constraint between rows.

FossilOrigin-Name: eba02092bcf1713a646ecf8febd53a83bc803cf1b17e2e4fc590c14d886a8d27

10 days agoAdd a prototype AGENTS.md file
drh [Fri, 22 May 2026 11:15:25 +0000 (11:15 +0000)] 
Add a prototype AGENTS.md file

FossilOrigin-Name: 3dd1181120b9910a96090b5b3cad5f0829fadeffeb6ffaad17031540a5749513

11 days agoFix the VFSes so that there is no 32-bit integer overflow in the
drh [Thu, 21 May 2026 15:14:35 +0000 (15:14 +0000)] 
Fix the VFSes so that there is no 32-bit integer overflow in the
xShmMap method if the WAL file size exceeds about 25 terabytes, or
if the header is corrupted to make SQLite think that the WAL file size
is that big.
[bugs:/info/2026-05-21T03:53:03Z|Bug 2026-05-21T03:53:03Z].

FossilOrigin-Name: 9ac4a33a2932d353c4871fd8e09c10addf827f1fc3fc9380037d738cf2cd0353

11 days agoMerge latest trunk changes with this branch.
dan [Thu, 21 May 2026 15:13:17 +0000 (15:13 +0000)] 
Merge latest trunk changes with this branch.

FossilOrigin-Name: c6226d508d6af28fcd42fecd482014c3e284923871d3d8f5177f728cbf3457c5

11 days agoFix a buffer overread in the session module that could occur when processing a corrup...
dan [Thu, 21 May 2026 14:58:36 +0000 (14:58 +0000)] 
Fix a buffer overread in the session module that could occur when processing a corrupt changeset.

FossilOrigin-Name: 869a51ae84dfaaf824c872e4b3024f35eea7fa67bb584759a2d42ebf8404ef6e

11 days agoPerformance optimization to the sqlite3ExprCollSeqMatch() routine.
drh [Thu, 21 May 2026 14:48:43 +0000 (14:48 +0000)] 
Performance optimization to the sqlite3ExprCollSeqMatch() routine.

FossilOrigin-Name: 035f1d2f284a081e6aef01cc773a3784458ec8e6297f3fbf4063670a9e65278c

11 days agoRemove dead code created by [20c2f8ce9242c3db].
drh [Thu, 21 May 2026 14:16:47 +0000 (14:16 +0000)] 
Remove dead code created by [20c2f8ce9242c3db].

FossilOrigin-Name: 68c5fd5fa0f986b782519472398b068ba7c295c56a0e0199b8e0509d0d1685fb

11 days agoLimit the length of inputs to the spellfix1_editdist() extension
drh [Thu, 21 May 2026 13:37:15 +0000 (13:37 +0000)] 
Limit the length of inputs to the spellfix1_editdist() extension
function (not part of the standard SQLite build and rarely used)
to 99999 characters, to avoid any possibility of integer overflow.
[bugs:/forumpost/5da728247a|Bug 5da728247a].

FossilOrigin-Name: 51ebf0e04efcbe982e62f2228553700b8c1147a37c70fdfaa0e377184b3ac936

11 days agoA join constraint is not an equivalence unless both operands have the
drh [Thu, 21 May 2026 13:03:18 +0000 (13:03 +0000)] 
A join constraint is not an equivalence unless both operands have the
same collation.
[bugs:/info/2026-05-21T03:39:28Z|Bug 2026-05-21T03:39:28Z].
Error goes back to version 3.7.17, 13 years ago.

FossilOrigin-Name: 20c2f8ce9242c3dbb8054f01c6c7338763c830b7c1491a99c8e1de98ce8f0a5b

11 days agoEnhance the xfer-optimization to verify access to the source table using
drh [Thu, 21 May 2026 12:04:20 +0000 (12:04 +0000)] 
Enhance the xfer-optimization to verify access to the source table using
the authorizer, if an authorizer is registered.
[bugs:/info/2026-05-21T03:31:22Z|Bug 2026-05-21T03:31:22Z].

FossilOrigin-Name: d1cdb817cafd03a4081b254a71672ba07e5b637994d3f2f925532f17af0a67dc

12 days agoImproved entropy collection on Windows.
drh [Wed, 20 May 2026 20:03:07 +0000 (20:03 +0000)] 
Improved entropy collection on Windows.

FossilOrigin-Name: b734b76af3f732e0db8a002781bae57aa7a01c4a7f5151605144a6aeef993a21

12 days agoFix a bug causing the session module to dereference a NULL pointer when applying...
dan [Wed, 20 May 2026 15:06:34 +0000 (15:06 +0000)] 
Fix a bug causing the session module to dereference a NULL pointer when applying a corrupt changeset.

FossilOrigin-Name: e807d4e3798efd532b3d78d1dfe513ed4fbd3cb793dd0ae5c30cae6031422b10

12 days agoCheck-in [7cf841f3613c8302] was incomplete in that it did not remove
drh [Wed, 20 May 2026 11:53:15 +0000 (11:53 +0000)] 
Check-in [7cf841f3613c8302] was incomplete in that it did not remove
the incorrect assert() statement.  Fixed here.

FossilOrigin-Name: c19bacca13f699953bbf50afb867035a94080b8a48111cf3d87bced880a3e620

12 days agoAvoid returning an SQLITE_SCHEMA error from within sqlite3session_diff() if the schem...
dan [Wed, 20 May 2026 11:41:24 +0000 (11:41 +0000)] 
Avoid returning an SQLITE_SCHEMA error from within sqlite3session_diff() if the schema has been recently modified. First <a href=https://sqlite.org/bugs/forumpost/269f1e9cef>reported here</a>.

FossilOrigin-Name: 20110547a117912be68d91bc006e92c45beffde16c6bcdf062bf8971c9a9a864

12 days agoFix a test case added by [1249eeb1b9759038] that does not work for
drh [Wed, 20 May 2026 01:32:30 +0000 (01:32 +0000)] 
Fix a test case added by [1249eeb1b9759038] that does not work for
the config=prepare permutation.

FossilOrigin-Name: 6aaeeffc2c7abbe32050da40bcbffc5f8d596e6df4603b8f8f23294f2465f25e

12 days agoImprovements to testrunner.tcl: Make C-program tests responsive to the
drh [Wed, 20 May 2026 00:16:20 +0000 (00:16 +0000)] 
Improvements to testrunner.tcl:  Make C-program tests responsive to the
pattern list.  Do not remove build steps until the very end when we are
certain that the build step is not required.  The pattern list matches
the exact text of the displayname column of the jobs table.

FossilOrigin-Name: 3f409c0e1be6b71eca92eccf0b9de3ef5923a6a57be49540ebe190fc6a6d06d4

13 days agoFix a potential buffer overread in fts5 that could occur when handling corrupt records.
dan [Tue, 19 May 2026 20:27:54 +0000 (20:27 +0000)] 
Fix a potential buffer overread in fts5 that could occur when handling corrupt records.

FossilOrigin-Name: 70021c3291b38192832c99fa4d8155249dd39f5b26334595c71f5cee66d13ebb

13 days agoSilently ignore nested porter tokenizers in FTS5. Having nested porter
drh [Tue, 19 May 2026 19:33:49 +0000 (19:33 +0000)] 
Silently ignore nested porter tokenizers in FTS5.  Having nested porter
tokenizers is pointless, but it does use stack space unnecessarily.
[bugs:/forumpost/a7766198f1|Bug report a7766198f1].

FossilOrigin-Name: 0bdeedf56c9d7209d1ea8f950d0ef03c78cbf677528d9d30c5f4ec48c4e1a571

13 days agoRemove new unreachable code from this branch.
dan [Tue, 19 May 2026 18:58:59 +0000 (18:58 +0000)] 
Remove new unreachable code from this branch.

FossilOrigin-Name: 07f81e256fde5796c0d8bcedff8fad4368639386f40881c0844e9c86a69b6fad

13 days agoPrevent integer overflow in the ICU extension.
drh [Tue, 19 May 2026 18:56:11 +0000 (18:56 +0000)] 
Prevent integer overflow in the ICU extension.
[bugs:/forumpost/844bdd7d5c|Bug report 844bdd7d5c].

FossilOrigin-Name: c20cb75ca07d0553d7a847c65a40efb2e5c587579ec32b02121a8963c70db12f

13 days agoFix an assertion fault that can occur in RTree given a carefully
drh [Tue, 19 May 2026 18:45:05 +0000 (18:45 +0000)] 
Fix an assertion fault that can occur in RTree given a carefully
corrupted database.
[bugs:/forumpost/2026-05-18T06:46:01Z|Bug report 2026-05-18T06:46:01Z].

FossilOrigin-Name: 7cf841f3613c8302a419638bdec83b1b9799f00cfedbfe40dca0a1a005c196b5

13 days agoFix problems with error handling when applying changesets with update loops.
dan [Tue, 19 May 2026 18:28:03 +0000 (18:28 +0000)] 
Fix problems with error handling when applying changesets with update loops.

FossilOrigin-Name: f797925df05f1a53392dba416aa72067716bb6e38ebc679d313f8a98f89c5913

13 days agoMerge trunk changes into this branch.
dan [Tue, 19 May 2026 17:15:05 +0000 (17:15 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: e480e126fc1550948bd1a3635f0e3a862353dcd8b0f1921ab6e66d699110b477

13 days agoAvoid a potential 1 byte overread in sqlite3changegroup_add() when processing a corru...
dan [Tue, 19 May 2026 17:12:39 +0000 (17:12 +0000)] 
Avoid a potential 1 byte overread in sqlite3changegroup_add() when processing a corrupt changeset buffer.

FossilOrigin-Name: 4d8c3a2919dc942a0a044ec7582a688e0f93e91f4a465bb94390fbe3ad1b50b4

13 days agoAdd an sqlite3FaultSim() call to the changes at [6193e4105b6a58ea] to
drh [Tue, 19 May 2026 17:05:28 +0000 (17:05 +0000)] 
Add an sqlite3FaultSim() call to the changes at [6193e4105b6a58ea] to
make them testable.

FossilOrigin-Name: 0de3d95500b7ecd41a09d81f176c1510896e811b3e468e1cf50f752305fdb06f

13 days agoMerge latest trunk changes into this branch.
dan [Tue, 19 May 2026 16:07:22 +0000 (16:07 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 1f71b530c9e8ddce5b25ed0971447cd925f9194afc7a2f929429318a5fcb5a72

13 days agoFix a incorrect assert() from [52dd437d51d3c1af] reported by OSSFuzz.
drh [Tue, 19 May 2026 16:07:08 +0000 (16:07 +0000)] 
Fix a incorrect assert() from [52dd437d51d3c1af] reported by OSSFuzz.

FossilOrigin-Name: 64b49e4d431d35db0920c7fc8a89d38ce2d2d2dbf42a7caf76aaa9685d66601b

13 days agoAdd the "make" subcommand to testrunner.tcl
drh [Tue, 19 May 2026 15:13:03 +0000 (15:13 +0000)] 
Add the "make" subcommand to testrunner.tcl

FossilOrigin-Name: 00d546812810252a4d51ff796931dc2ff5bdd5173ddb8f95fb5efccd897087ff

13 days agoEarly detection of attempts to overwrite an in-use cache page due
drh [Tue, 19 May 2026 12:40:00 +0000 (12:40 +0000)] 
Early detection of attempts to overwrite an in-use cache page due
to database corruption.
[https://issues.chromium.org/issues/513858286|Chromium 513858286].

FossilOrigin-Name: 6193e4105b6a58eac2bc17c5b2d55fdae332816b59beed1fe24c15dff1372322

13 days agoSecurity enhancements to the untested and unused fossildelta.c extension.
drh [Tue, 19 May 2026 11:15:33 +0000 (11:15 +0000)] 
Security enhancements to the untested and unused fossildelta.c extension.
Bug reports [bugs:/forumpost/3ac3fe3d71|3ac3fe3d71] and
[bugs:/forumpost/e7e470b760|e7e470b760].

FossilOrigin-Name: 2d3fbbe421d3b0ad8fa08255fd30af7f2d947919ebb90fa9c9c4ee72ffd880b4

13 days agoLimit the size of input strings to the (disused) spellfix extension
drh [Tue, 19 May 2026 10:30:13 +0000 (10:30 +0000)] 
Limit the size of input strings to the (disused) spellfix extension
to avoid excessive runtime and integer overflows.
[bugs:/forumpost/24a33e5d10|Bugs report 24a33e5d10].

FossilOrigin-Name: 4b16b80cf2e26c41f0828d65883145dc81c0987110c3f04a864cec43e7c418e5

13 days agoFix a NULL pointer dereference in the obscure (and unused) prefixes
drh [Mon, 18 May 2026 23:58:14 +0000 (23:58 +0000)] 
Fix a NULL pointer dereference in the obscure (and unused) prefixes
extension, which I had forgotten even existed.
[bugs:/forumpost/24a33e5d10|Bug report 24a33e5d10].

FossilOrigin-Name: 4880adc053b0f21633936347fd5610e4338b15da39607d8ba5a6b32d1516e8cb

2 weeks agoFix an off-by-one error in matchinfo('b') for FTS3 when there are a large
drh [Mon, 18 May 2026 21:45:06 +0000 (21:45 +0000)] 
Fix an off-by-one error in matchinfo('b') for FTS3 when there are a large
number of columns.
[bugs:/forumpost/42d5f799d1|Bug report 42d5f799d1].

FossilOrigin-Name: c0f2cd6d292bb3554539a309a2ecfa0a12f0248cfcbb5594391607b107a62cd2

2 weeks agoLimit the NEAR span in FTS3 to 1 billion, to avoid integer overflow.
drh [Mon, 18 May 2026 20:43:15 +0000 (20:43 +0000)] 
Limit the NEAR span in FTS3 to 1 billion, to avoid integer overflow.
[bugs:/forumpost/4cfcf164d2|Bug report 4cfcf164d2].

FossilOrigin-Name: adcb44f9dcfd34df4cf4f5cc418ecac9f2ca09723442379dfedcba532c45de77

2 weeks agoFix a problem applying changesets that contain multiple UPDATE constraint loops.
dan [Mon, 18 May 2026 20:34:56 +0000 (20:34 +0000)] 
Fix a problem applying changesets that contain multiple UPDATE constraint loops.

FossilOrigin-Name: 8e89aafab1b8fa7d59ac98c39b7f1c1cc23a98ba868a5dac83dee63688786a3f

2 weeks agoPrevent integer overflow due to database corruption in.
drh [Mon, 18 May 2026 20:27:57 +0000 (20:27 +0000)] 
Prevent integer overflow due to database corruption in.
fts3auxNextMethod().
[bugs:/forumpost/bce19272cf|Bug report bce19272cf].

FossilOrigin-Name: d903795e3bdf91607f23dace5a15a070139b32e34aed8540a6c2e19c39e997be

2 weeks agoWhen a subquery is an argument to an SQLITE_SUBTYPE function, then set
drh [Mon, 18 May 2026 19:44:04 +0000 (19:44 +0000)] 
When a subquery is an argument to an SQLITE_SUBTYPE function, then set
the EP_SubtArg flag on the result-set expressions of that subquery.
[bugs:/forumpost/8de44412fd|Bug report 8de44412fd].

FossilOrigin-Name: d75c08c8416bde3f510a135ea07cc217ba6183eacda6ba895bccbf57efe9284f

2 weeks agoUpdate the session module so that it can apply changesets containing two or more...
dan [Mon, 18 May 2026 18:59:06 +0000 (18:59 +0000)] 
Update the session module so that it can apply changesets containing two or more UPDATE changes that form a dependency loop - so that no single UPDATE can be applied independently without violating a constraint.

FossilOrigin-Name: 5f8010599fb33fbe1dadc894a679056a5d38040ab4f09772cd59827941e9348b

2 weeks agoFix the window-function variant of the json_group_object() function so
drh [Mon, 18 May 2026 17:55:40 +0000 (17:55 +0000)] 
Fix the window-function variant of the json_group_object() function so
that it correctly handles NULL entries.
[bugs:/forumpost/0de87b23b3|Bug report 0de87b23b3].

FossilOrigin-Name: ac3a958b0ab7766544bb406aa990668d2235ab26fb68c75ded3f71273d97b18c

2 weeks agoDo not attempt the OR-optimization on conjuncts that contain COLLATE
drh [Mon, 18 May 2026 14:28:53 +0000 (14:28 +0000)] 
Do not attempt the OR-optimization on conjuncts that contain COLLATE
operators because (1) such cases are rare and (2) they are tricky to
get right and are thus prone to bugs and hard to test.
[bugs:/forumpost/329521b269|Bugs report 329521b269] is one
such bug that goes back about 20 years and thus demonstrates both
points of the previous sentence.

FossilOrigin-Name: 622882529558b4779dfb7246bd5a9de776555c8f940bb941397fb56fb9f97e43

2 weeks agoFix a harmless compiler warning caused by [460243ee4c28873d].
drh [Mon, 18 May 2026 11:44:09 +0000 (11:44 +0000)] 
Fix a harmless compiler warning caused by [460243ee4c28873d].

FossilOrigin-Name: e076ac7b648988b48b546e19b5ef2e50061b44c85bc2645362409e295e3b4b11

2 weeks agoCorrection to the bugfix at [212c68249cc0e890] so that it works
drh [Mon, 18 May 2026 11:35:44 +0000 (11:35 +0000)] 
Correction to the bugfix at [212c68249cc0e890] so that it works
for 2nd and subsequent terms of a row value.
[bugs:/forumpost/ba8084256b|Bugs report ba8084256b].

FossilOrigin-Name: 49a3c6ade45ea31187ac8dbba0452fcad487e76f2219bfa6435feab545b5f632

2 weeks agoRaise an error in the dbpage virtual table if the page number on an insert
drh [Mon, 18 May 2026 10:19:14 +0000 (10:19 +0000)] 
Raise an error in the dbpage virtual table if the page number on an insert
is too large. [bugs:/forumpost/f363b34881|Bug report f363b34881].

FossilOrigin-Name: 2bbc8f1404e3cbaa8fe24e2ea2d774daf2bf3b232fbd8978a1a37e4f8f0f629d

2 weeks agoAdd a reference to the new sqlite.org/bugs forum.
stephan [Mon, 18 May 2026 10:00:35 +0000 (10:00 +0000)] 
Add a reference to the new sqlite.org/bugs forum.

FossilOrigin-Name: f2fe7e7a184e482411ddf792a1964e6ce30a28185da9fa79488d097382c352fd

2 weeks agoFix the ".prompt" command so that it honors -bail.
drh [Sun, 17 May 2026 19:21:30 +0000 (19:21 +0000)] 
Fix the ".prompt" command so that it honors -bail.

FossilOrigin-Name: 5b58bdd33f0410624523fc8adc230db4e5f57283d234a5f0d26a2790629bc0f9

2 weeks agoFix the new %J and %j formats so they work correctly with a zero precision.
drh [Sun, 17 May 2026 17:50:32 +0000 (17:50 +0000)] 
Fix the new %J and %j formats so they work correctly with a zero precision.

FossilOrigin-Name: 428b924dd6e228c879338c5c5edbe68bdc4d8d8e80c37e3d070a8a34b57300c1

2 weeks agoFix the sqlite3_value_numeric_type() interface so that it works even if
drh [Sun, 17 May 2026 17:18:12 +0000 (17:18 +0000)] 
Fix the sqlite3_value_numeric_type() interface so that it works even if
the argument is an sqlite3_value object that came from sqlite3_value_dup().
[forum:/forumpost/15c4a323bb|Forum post 15c4a323bb].

FossilOrigin-Name: 460243ee4c28873d5c484a91af7ec18d03d0e726b8bb4e1e680b588e5f371400

2 weeks agoIn the CLI, make the NO_COLOR prompt the same as the default prompt, only
drh [Sun, 17 May 2026 16:35:36 +0000 (16:35 +0000)] 
In the CLI, make the NO_COLOR prompt the same as the default prompt, only
without any color.

FossilOrigin-Name: cc05e9749c14d6ff4e396ad387c42d53b696680ce74ce6a92f6fb71ed9a53ae5

2 weeks agoWhen two tables are joined by USING, the affinity and collating sequence of
drh [Sat, 16 May 2026 20:21:55 +0000 (20:21 +0000)] 
When two tables are joined by USING, the affinity and collating sequence of
the join column will be the same as one or the other of the columns in the
two tables (which are hopefully the same).

FossilOrigin-Name: cbb6f72c10b1224088b9d604a0e014e7020e8d79a317ebb4af420ba3b72f40cc

2 weeks agoWhen two tables are joined by USING, the affinity of the join column can
drh [Sat, 16 May 2026 19:40:55 +0000 (19:40 +0000)] 
When two tables are joined by USING, the affinity of the join column can
be the affinity of the corresponding column in either table.  But it must
be one or the other.

FossilOrigin-Name: 8cc0b52cca2d6b155b4b169e6f9de9e7d2dc61c40f89920c2b6bf86e549ab6f7

2 weeks agoFix false-negatives in the sqlite3ExprCanReturnSubtype() routine having
drh [Sat, 16 May 2026 17:28:56 +0000 (17:28 +0000)] 
Fix false-negatives in the sqlite3ExprCanReturnSubtype() routine having
to do with CASE, CAST, and COLLATE expressions and the "+" no-op operator.
[forum:/forumpost/1f0168a120:Forum post 1f0168a120].

FossilOrigin-Name: 9be94e961457967408cbd0acf11877fbb323a48eee405fff53755770f1b3261a

2 weeks agoImproved comment on sqlite3ExprCanReturnSubtype() as well as one very index-on-case-expr-subtype
drh [Sat, 16 May 2026 16:02:08 +0000 (16:02 +0000)] 
Improved comment on sqlite3ExprCanReturnSubtype() as well as one very
minor efficiency improvement.

FossilOrigin-Name: b57d6b76b0f9f4f154997af83f14d545bf2b6b8f7194746835e4c34885db227a

2 weeks agoWhen using an index on a CASE expression that may return a value with a subtype,...
dan [Fri, 15 May 2026 19:44:24 +0000 (19:44 +0000)] 
When using an index on a CASE expression that may return a value with a subtype, avoid discarding any subtype.

FossilOrigin-Name: 69c9a82cbaea7b6faa6a357dd884b1e0d2bc684d847efb31a2d64c75fabf5428

2 weeks agoHave window functions sum(), total() and avg() correctly handle the obscure case...
dan [Fri, 15 May 2026 18:36:11 +0000 (18:36 +0000)] 
Have window functions sum(), total() and avg() correctly handle the obscure case where integer overflow occurs as part of the same step that adds the first real value to the running total.

FossilOrigin-Name: 614f8cbc374c7a2d39826706f16ab1c17e75abb420a70be356c7eefa95b271a5

2 weeks agoHave the sqlite_dbpage module correctly handle constraints of the form "WHERE pgno...
dan [Fri, 15 May 2026 17:24:34 +0000 (17:24 +0000)] 
Have the sqlite_dbpage module correctly handle constraints of the form "WHERE pgno=$pgno" when $pgno is an integer that cannot be represented as a signed, 32-bit value.

FossilOrigin-Name: 350152d5124b71b3dd640c109dbac5f05a3a9583a335fbe25f707e1b754c1c74

2 weeks agoIf there is a WHERE clause constraint of the form "a=$var", then
drh [Thu, 14 May 2026 22:39:41 +0000 (22:39 +0000)] 
If there is a WHERE clause constraint of the form "a=$var", then
automatically reprepare the query if the binding of $var changes, as
that could affect the query plan.

FossilOrigin-Name: 1249eeb1b9759038b6d10dcd8d65f64f81e8529b28e5e24f9fc5759e9a1c88a5

2 weeks agoHandle constraints like "a=$var" where the value bound to $var is -1, 0 or 1 in the... reprepare-a=var
dan [Thu, 14 May 2026 17:54:23 +0000 (17:54 +0000)] 
Handle constraints like "a=$var" where the value bound to $var is -1, 0 or 1 in the same way as a literal -1, 0, 1. This might cause excessive reprepares.

FossilOrigin-Name: 224e827e87ac8aa4b18ff9b2193decbdcd832579bf6b6e0883c03db90ebd5319

2 weeks agoHarden the QRF extension against integer overflow problems.
drh [Thu, 14 May 2026 13:29:59 +0000 (13:29 +0000)] 
Harden the QRF extension against integer overflow problems.

FossilOrigin-Name: 83d3a0d39b0b36a47003206d390935d4c94f7a906ada02f69e0ad1eef2f22d59

2 weeks agoIn QRF, relax the constraint on the screen width so that it can be as
drh [Thu, 14 May 2026 12:46:41 +0000 (12:46 +0000)] 
In QRF, relax the constraint on the screen width so that it can be as
wide as a 32-bit signed integer can count.
[forum:/forumpost/2570051b60|Forum post 2570051b60].

FossilOrigin-Name: 91439d95dc81adebf8226f2b7c33ca62a4b7163cfc14e03993524aa17b5767f3

2 weeks agoRaise an error if an ALTER TABLE ADD COLUMN statement tries to add
drh [Thu, 14 May 2026 11:35:17 +0000 (11:35 +0000)] 
Raise an error if an ALTER TABLE ADD COLUMN statement tries to add
a CHECK constraint that contains an internal-use-only SQL function.

FossilOrigin-Name: 52dd437d51d3c1af0777350daeebf1159033eede3f58fcc5ebaeaec8869ffaff

2 weeks agoCorrection to the documentation for sqlite3_uri_int64().
drh [Thu, 14 May 2026 10:36:50 +0000 (10:36 +0000)] 
Correction to the documentation for sqlite3_uri_int64().

FossilOrigin-Name: 58472fdab0691f7f03f15201542f15148ed7734bfeb495370386d666ae4beded

2 weeks agoFix the sqlite3changegroup_change_finish() API so that it correctly handles NULL...
dan [Wed, 13 May 2026 20:37:30 +0000 (20:37 +0000)] 
Fix the sqlite3changegroup_change_finish() API so that it correctly handles NULL being passed for the pzErr parameter.

FossilOrigin-Name: f81d6d7bc8943729f678a3b62921a96764b15b9cc11d8a5753e48210a1b59617

2 weeks agoAdditional changes to the Windows VFS to try to get the system to a point
drh [Wed, 13 May 2026 20:06:08 +0000 (20:06 +0000)] 
Additional changes to the Windows VFS to try to get the system to a point
where it will compile for UWP.

FossilOrigin-Name: 3ddc07110dacef98c14b852dcdc4f11d1c0f4061008bf3a61e2df707b0dc6c6b

2 weeks agoChange to compile-time option that omits non-UWP system calls to
drh [Wed, 13 May 2026 18:07:01 +0000 (18:07 +0000)] 
Change to compile-time option that omits non-UWP system calls to
SQLITE_UWP.  Takes steps to eliminate all non-UWP system calls when that
compile-time option is used.

FossilOrigin-Name: b167c4c96e6a753952eb4be95d6283b50a9c59f4ecf59d60cf10d8de9cb115d8

2 weeks agoIn the Windows OS interface, use CreateFileMappingFromApp() and
drh [Wed, 13 May 2026 15:11:04 +0000 (15:11 +0000)] 
In the Windows OS interface, use CreateFileMappingFromApp() and
MapViewOfFilFromApp() if SQLITE_OS_WINRT is defined.

FossilOrigin-Name: 3c51436b43ab77b88134851a2773147b49a3c4fb5b0416db5e318b6e12d3b708

2 weeks agoOn Windows, use only GetSystemTimeAsFileTime() and not GetSystemTime().
drh [Wed, 13 May 2026 13:55:31 +0000 (13:55 +0000)] 
On Windows, use only GetSystemTimeAsFileTime() and not GetSystemTime().
Also add a TCL script that will renumber the systemcall thunk for Windows.

FossilOrigin-Name: 4b7f0130d68c7a0b98e87d09d0a661c85554215cb111478305307960deab3921

2 weeks agoModify [2990dd27dd] to use setlocale(LC_CTYPE) instead of setlocale(LC_ALL). Same...
stephan [Wed, 13 May 2026 12:12:54 +0000 (12:12 +0000)] 
Modify [2990dd27dd] to use setlocale(LC_CTYPE) instead of setlocale(LC_ALL). Same effect but hypothetically a smaller scope.

FossilOrigin-Name: 8be57f96f6a72753fd983d7b6b9924c3b60f57c5664eeb7dfe7a0799739597c0

2 weeks agoSlightly rework the --editline configure flag for purposes of distinguishing between...
stephan [Wed, 13 May 2026 12:06:27 +0000 (12:06 +0000)] 
Slightly rework the --editline configure flag for purposes of distinguishing between the two conventional libedit headers. When using libedit, invoke setlocale(), which appears to resolve [forum:aad7a634916ff050|forum post aad7a63491]'s report of non-ASCII input failng to work when linking against libedit.

FossilOrigin-Name: 2990dd27dda4333e8ccf9225ff5af690d4062276dd2ad60ee7df922aa6be99ee

2 weeks agoUse GetTickCount64() instead of GetTickCount() in Windows, for portability
drh [Wed, 13 May 2026 10:47:40 +0000 (10:47 +0000)] 
Use GetTickCount64() instead of GetTickCount() in Windows, for portability
to UWP.

FossilOrigin-Name: ea65ae964e21541d8f7c00ec679a608d34bc94408d9cc479b2d7fb08bf0e3cdf

2 weeks agoIn Haiku OS builds, fix the --editline configure flag to actually link against libedi...
stephan [Wed, 13 May 2026 07:33:31 +0000 (07:33 +0000)] 
In Haiku OS builds, fix the --editline configure flag to actually link against libedit rather than libreadline.

FossilOrigin-Name: 642168d386074d1398b52c2d952e4cb153617f7bed82fb99d76b6d28dc8242bc

2 weeks agoDo not allow internal-use-only functions to be used in CHECK constraints add-column-safety
drh [Tue, 12 May 2026 19:33:04 +0000 (19:33 +0000)] 
Do not allow internal-use-only functions to be used in CHECK constraints
that are added as part of ALTER TABLE ADD COLUMN.

FossilOrigin-Name: 28272746fb13dcdbe2a4f21ef30446c316dfc843aa3d48f135f490abaee34198

2 weeks agoFix a copy/paste error in a comment. No changes to code.
drh [Tue, 12 May 2026 18:06:44 +0000 (18:06 +0000)] 
Fix a copy/paste error in a comment.  No changes to code.

FossilOrigin-Name: 2741193e81750512cae8bb14ebc03fa11dde100da144488b4da1c81a351e4ff6

2 weeks agoFix the insert4.test test module so that it works when SQLite is
drh [Tue, 12 May 2026 12:34:16 +0000 (12:34 +0000)] 
Fix the insert4.test test module so that it works when SQLite is
compiled with SQLITE_OMIT_VIRTUALTABLE.

FossilOrigin-Name: bff9db9b5eb05ec3f99e35cb4c198d24bcb9ee7ceb2401bf55627788ac2b96db

2 weeks agoAttempt to disable false-positive GCC compiler warning.
drh [Tue, 12 May 2026 11:47:01 +0000 (11:47 +0000)] 
Attempt to disable false-positive GCC compiler warning.

FossilOrigin-Name: e377b4d375f2ec64085d953e87739904bbbccf09d82db99fe0579368c985ca84

3 weeks agoFix the xfer-optimization such that if the destination table has
drh [Mon, 11 May 2026 16:58:05 +0000 (16:58 +0000)] 
Fix the xfer-optimization such that if the destination table has
constraints on the hidden rowid, the optimization is not attempted.
[forum:/forumpost/6dcc95e3ca|Forum post 6dcc95e3ca].

FossilOrigin-Name: da9ca357fb24f39a4a3292ca447773c6233a3084721abfbd5665a45ee8a4bed4

3 weeks agoPrevent internal-use-only SQL functions from being used inside of a CHECK
drh [Mon, 11 May 2026 14:22:45 +0000 (14:22 +0000)] 
Prevent internal-use-only SQL functions from being used inside of a CHECK
constraint added using ALTER TABLE ADD CONSTRAINT.
[forum:/forumpost/6256ee34ed|Forum post 6256ee34ed].

FossilOrigin-Name: 07beb966daddd0dfea36265eb38ebfcfbb10b0cbccda458dea501eda330a49f0

3 weeks agoFix comment typos. Add test cases. add-constraint-safety-v2
drh [Mon, 11 May 2026 14:14:25 +0000 (14:14 +0000)] 
Fix comment typos.  Add test cases.

FossilOrigin-Name: 7a85921ae585f948f084bd8fccc1cc002539415e629aa0021d58afc17e5471a3

3 weeks agoAn alternative fix to ALTER TABLE ADD CONSTRAINT.
drh [Mon, 11 May 2026 12:38:18 +0000 (12:38 +0000)] 
An alternative fix to ALTER TABLE ADD CONSTRAINT.

FossilOrigin-Name: a231fc6d58abb3b76d0e669babdb377e41b5a348d155ab5f2c1fe49eefbbf3a9

3 weeks agoImprove detection of corrupt database records in fts5.
dan [Mon, 11 May 2026 11:53:07 +0000 (11:53 +0000)] 
Improve detection of corrupt database records in fts5.

FossilOrigin-Name: 87b653731171a26396f9796b0a5c436593571d39e991d8d040ef4473cf459b67

3 weeks agoFix potential buffer overwrite that could occur in fts5 when processing corrupt records.
dan [Mon, 11 May 2026 11:12:06 +0000 (11:12 +0000)] 
Fix potential buffer overwrite that could occur in fts5 when processing corrupt records.

FossilOrigin-Name: 4a5ad516ea93926c0d5206b4d72c3675905d2bf666b27a649256b93eb95c671b

3 weeks agoFix harmless bug in testing logic. No changes to deliverables.
drh [Mon, 11 May 2026 11:05:17 +0000 (11:05 +0000)] 
Fix harmless bug in testing logic.  No changes to deliverables.

FossilOrigin-Name: c4a6e62b5f36f9df988d2ec12a92a614e9e813cdcd50198ec2827c33745a362a

3 weeks agoHush-up a false-positive compiler warning from GCC. See
drh [Mon, 11 May 2026 10:25:58 +0000 (10:25 +0000)] 
Hush-up a false-positive compiler warning from GCC.  See
[forum:/forumpost/281ace196961082c|forum thread 281ace196961082c].

FossilOrigin-Name: 45a215290896eee9776c2b1727363f6e1c1aad5b521f4f92b13981a5da5d0f54

3 weeks agoFix the xfer optimization so that it does not work if the destination is
drh [Mon, 11 May 2026 00:53:44 +0000 (00:53 +0000)] 
Fix the xfer optimization so that it does not work if the destination is
a STRICT table that is incompatible with the source.
[forum:/forumpost/4955d2235c22ef4e|Forum post 4955d2235c22ef4e].

FossilOrigin-Name: 5e916b2a8fd41ffc42c29bfc9b5333b7a579f37fe094bd0b6b00e2f176c4e3fe

3 weeks agoMinor config script doc tweaks.
stephan [Sat, 9 May 2026 14:32:16 +0000 (14:32 +0000)] 
Minor config script doc tweaks.

FossilOrigin-Name: 678954553e123de9eb0bbe7c3101039218edd27d282b015f51e69a2eba683feb

3 weeks agoIn sqlite-config.tcl remove a reference to the platform name apple when checking...
stephan [Sat, 9 May 2026 14:01:57 +0000 (14:01 +0000)] 
In sqlite-config.tcl remove a reference to the platform name apple when checking for Mac platforms, relying on a check for darwin instead, analog to [b5c6cb13cff53f]. Intended to resolve [forum:c26b856db7dd5caf|forum post c26b856db7dd5caf].

FossilOrigin-Name: 7ccffe38b4b99c61e4bfc703dc4b3516d7c2a72d73680b699886ee43eea9bd21

3 weeks agoFix upward propagation of expression properties into row-value expressions.
drh [Sat, 9 May 2026 13:54:40 +0000 (13:54 +0000)] 
Fix upward propagation of expression properties into row-value expressions.
[forum:/info/8387cc287240643e|Forum post 8387cc287240643e].

FossilOrigin-Name: 0372dd717b852da8dc2c6b0ff2da02a2ac25bc0486a38e4c2a970694d897b6c9

3 weeks agoImproved detection of OOM in the regexp_bytecode() SQLite function
drh [Sat, 9 May 2026 13:16:18 +0000 (13:16 +0000)] 
Improved detection of OOM in the regexp_bytecode() SQLite function
(available in debug builds only).
[forum:/forumpost/a3a10e1c7b5dd1d2|Forum post a3a10e1c7b5dd1d2].

FossilOrigin-Name: 172e8c35badadc3c5eb5065da8ed2161093a0adff0ecfb5b162f78a9fb55bb34

3 weeks agoFix an integer truncation problem due to oversized inputs to the
drh [Sat, 9 May 2026 12:41:23 +0000 (12:41 +0000)] 
Fix an integer truncation problem due to oversized inputs to the
approximate_match virtual table extension.
[forum:/info/625f687e4d25c392|Forum post 625f687e4d25c392].

FossilOrigin-Name: 2881e17cc030814b350ca371fd2fd2089d3ff2fcc4ea52654de8bc5c2fc95222

3 weeks agoFix a corner-case floating-point rounding problem in the generate_series()
drh [Sat, 9 May 2026 12:03:14 +0000 (12:03 +0000)] 
Fix a corner-case floating-point rounding problem in the generate_series()
virtual table, introduced by [c113e31b818d1677] and reported by
[forum:/info/6e6cf9054bea2b1d|forum post 6e6cf9054bea2b1d].

FossilOrigin-Name: ff56785674ebeb1d4bab66ba0827956a2728c8c14419f933d40dc0152efbd4f5

3 weeks agoRemove unnecessary and incorrect assert() statements in the new %J code.
drh [Thu, 7 May 2026 20:45:57 +0000 (20:45 +0000)] 
Remove unnecessary and incorrect assert() statements in the new %J code.

FossilOrigin-Name: 5a8497dbec80b55a2dedc8a6f9ee823243e01a08d37ceeed1f87214dfe527d63

3 weeks agoAdd the %J and %j conversions to printf() - rendering JSON string
drh [Thu, 7 May 2026 15:04:30 +0000 (15:04 +0000)] 
Add the %J and %j conversions to printf() - rendering JSON string
literals.

FossilOrigin-Name: 7e6fd838a15f08bf15d57f1887ed1019b58aa6be9eb7b162e67e0d9412082c6d

3 weeks agoFix harmless UB by declaring a constant 1 to be unsigned. format-json
drh [Thu, 7 May 2026 14:47:21 +0000 (14:47 +0000)] 
Fix harmless UB by declaring a constant 1 to be unsigned.

FossilOrigin-Name: c5235734a6787b9c59a356f4e0ccbb3f262b8d9a6407ebd415afc87e859b0498

3 weeks agoFix another off-by-one error.
drh [Thu, 7 May 2026 14:30:34 +0000 (14:30 +0000)] 
Fix another off-by-one error.

FossilOrigin-Name: 8ae724a647dfcb986c4037caaab07e5d0188e66b66039a4758937c963f1fcbf7

3 weeks agoBug fixes in the new %J and %j logic.
drh [Thu, 7 May 2026 14:14:05 +0000 (14:14 +0000)] 
Bug fixes in the new %J and %j logic.

FossilOrigin-Name: d1b55572c76569cb1e999028e79bcf2e76069f8778f0c8e933ace606d7b6a8b2

3 weeks agoAdd support for width to %J and %j.
drh [Thu, 7 May 2026 10:46:39 +0000 (10:46 +0000)] 
Add support for width to %J and %j.

FossilOrigin-Name: 0b102f2076586c08b134c78cc18acdd05555fa2b534c895535e96a0466661910

3 weeks agoSeparate conversion letters %J and %j. %J includes surrounding quotes and
drh [Thu, 7 May 2026 08:58:10 +0000 (08:58 +0000)] 
Separate conversion letters %J and %j.  %J includes surrounding quotes and
%j omits them.  Some test cases added.

FossilOrigin-Name: ea7c2c1a6bd32695fc3a1f2295b4c4719e3d9dd0a8f6480e7c95e17b564c3391

3 weeks agoGet precision working on %J, both with and with the ! flag. Width is
drh [Thu, 7 May 2026 00:02:55 +0000 (00:02 +0000)] 
Get precision working on %J, both with and with the ! flag.  Width is
still a no-op, and there are no test cases.  Incremental check-in.

FossilOrigin-Name: 18166bce208c64b7f3afaa88c27a10e0295a89f9c72942dcaa949cf7efb479e6