1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

32635 Commits

Author SHA1 Message Date
drh
57520227c9 Version 3.54.1
FossilOrigin-Name: 555e07ef33f69a0957d24d8e555b702464a131d6f1607f4c3c1e4551e8e6ca76
release version-3.54.1
2026-10-16 14:45:20 +00:00
drh
1bf6883244 Fixes to the handling of time 24:00:00.
[forum:/info/2026-10-15T10:26:06Z|Forum post 2026-10-15T10:26:06Z]

FossilOrigin-Name: 69071e25cad52b7fe15749f5fb969e847f9cd65e66341e8d1d4e5f5282283cd4
2026-10-15 13:19:18 +00:00
dan
23500fbf19 Ensure the internal DBFLAG_SchemaKnownOk flag is always cleared after a database schema is reset. Report [bugs:/info/2026-10-14T01:25:35Z | 2026-10-14T01:25:35Z].
FossilOrigin-Name: e6b9a40732900d0b7f83ec262ddc81bb47d4230de55d6db319689906e2bb3716
2026-10-14 13:39:28 +00:00
drh
eba536e8f2 The previous check-in was not quite correct. Both rLhsOrig
and rLhs are vectors and so neither should be freed using
sqlite3ReleaseTempReg().  Indeed, neither should be freed at all since
both vectors remain in use.

FossilOrigin-Name: fc7b959f45a55d95c9cb37692e82b811e3ef286a6d826895dfee9a1f2abfdcc8
2026-10-14 11:32:36 +00:00
drh
9266f1518b In check-in [8800c13deca3717c], fix a double-free of a byte-code register,
resulting in the same register being on the reusable register list twice.
[bugs:/info/2026-10-14T05:52:10Z|Bug 2026-10-14T05:52:10Z].

FossilOrigin-Name: 930df67b442ed677dbe5b22afe4fb91c907c721592a8090f0a70ebea79f3a854
2026-10-14 11:22:24 +00:00
dan
0fbd83dc99 Avoid an assert() failure by clearing Vdbe.smimask when Vdbe.expmask is cleared.
FossilOrigin-Name: 6399cc43b5927eaaef855fd0daab0cffc90c559266ca6ecc41ffcd5609007976
2026-10-13 17:08:19 +00:00
dan
cb1bf41aaa Restore 3.53.0 handling of codepoints u+fffe and u+ffff (they are separator characters) in fts3 and fts5. See forum post [forum:/info/9c6ec90d24 | 2026-10-13T08:37:16Z].
FossilOrigin-Name: f5ed4850175263ef66fade0d54193dfa96935ae63e2516922b7aae816924726a
2026-10-13 15:51:29 +00:00
dan
c8922e6f6b Merge fixes to vec1 made on trunk into this branch.
FossilOrigin-Name: 2ca1a93f01b777276494cf2bd6f7aaa86deeb2d8a43dbcd5dccc3a31318482a3
2026-10-13 14:59:41 +00:00
drh
76b61a60d3 Enhance OP_MustBeInt so that it is able to handle -9223372036854775808.0.
[bugs:/info/2026-10-11T20:33:51Z|Bug 2026-10-11T20:33:51Z].  See
also [987ba5a3dc5f2a22].

FossilOrigin-Name: 5e488c8da369cdf43e945078f3c9475f2cc5d71c099c85424f7c28ff0d4a7d61
2026-10-13 10:51:49 +00:00
stephan
5ba0b0a4e0 Merge wasm-post-3.54 into branch-3.54: wasm build updates for emcc changes and an OPFS fix for an as-yet-hypothetical failure case.
FossilOrigin-Name: c32cf3e355c4656a4415c7f3cf4de4701f9da6aa5f928487e257293b6e78b274
2026-10-13 06:45:28 +00:00
drh
ed9745eb7f Fix "csv" output mode in the CLI so that it responds to --colsep and --rowsep
as it should.
[forum:/info/2026-10-12T17:59:34Z|Forum post 2026-10-12T17:59:34Z].

FossilOrigin-Name: d0fe92e0ce8662b9f3391769e4602a5495c2c69591ded7d4e464e90517c1f407
2026-10-13 02:14:25 +00:00
drh
394e7bc1ac Prevent scalar subqueries from ever returning a value with a non-zero subtype.
Report [bugs:/info/2026-10-12T13:52:22Z | 2026-10-12T13:52:22Z].  Re-added
after the addition of a necessary prerequisite in the previous check-in.

FossilOrigin-Name: 8ab55e0185a1956fb3e131bc5faae0cf3ff5abb1f553217f2d63fcb15c75cc1f
2026-10-12 21:33:49 +00:00
drh
7815214b6c An unknown function can be seen in exprNodeCanReturnSubtype(), but only
if SQLite is compiled with SQLITE_ENABLE_UNKNOWN_SQL_FUNCTIONS.  Adjust
asserts accordingly.

FossilOrigin-Name: dcf20611cdd4a250531d0e753144ab1b6796635331bb906df0e174aea4bd4158
2026-10-12 21:24:29 +00:00
drh
5e43afae7d Failed to increase the memory allocation size as required in the previous
check-in.  Fixed here.

FossilOrigin-Name: 7b827c44ab843248b66de6fb753aad83af153085d501462b138954ceca7fee81
2026-10-12 20:12:35 +00:00
drh
d50d824d4d Improvements to [313ab6c4e517e599] to address the concern raised
by [bugs:/info/2026-10-12T17:03:33Z|Bug comment 2026-10-12T17:03:33Z].

FossilOrigin-Name: 51f69864e716501cae4f756a158256cefa38482bf9dcdf29f7eedf9f1af8752c
2026-10-12 20:09:23 +00:00
dan
31c9762d0c Avoid leaking pages when remapping a database file on unix. Forum post [forum:3cfba36128 | 3cfba36128].
FossilOrigin-Name: 90d3c595afe345808c6c0fe8042ba1e8241a88132935a9a3fd69e69e71c1059c
2026-10-12 18:20:50 +00:00
drh
e26021ed60 Temporarily back out the penultimate check-in on this branch in order to
prevent an assertion fault.  Need to reconsider this approach in light of
[bug:/info/2026-05-18T14:04:01Z|Bug 2026-05-18T14:04:01Z].  That other
bug might be fixed incorrectly, and might also need to be backed out.
Both bugs reopened until we can complete the analysis.

FossilOrigin-Name: 163413d8e19b97e36b2a1f6734c271b3944195a213973e2975e43f45a1e80735
2026-10-12 17:52:40 +00:00
dan
5bf1891464 Fix a problem causing "aggregate( t1.col1 ORDER BY t2.col2 )" where col1 and col2 are in the same positions in their tables to be treated as "aggregate( t2.col2 ORDER BY t2.col2 )". Report [bugs:info/2026-10-12T13:31:40Z | 2026-10-12T13:31:40Z].
FossilOrigin-Name: ffe3f056f1789f188a0afece0363dc2ea74912510bbbd4edcb656ad8a1acc704
2026-10-12 16:29:30 +00:00
dan
3922c42423 Prevent scalar subqueries from ever returning a value with a non-zero subtype. Report [bugs:/info/2026-10-12T13:52:22Z | 2026-10-12T13:52:22Z].
FossilOrigin-Name: af3c900e2b5251bcbc0611dbe2f86b13fd2daa07bcf42563a9d6db46dfdd6b3d
2026-10-12 16:08:07 +00:00
drh
1201b826e9 Fix a harmless compiler warning in [7f154192db5a3a79].
FossilOrigin-Name: b3fcf7aecf29f10ad28864a9ceba6150f874f5f4d4c7094d61d436451d4394fe
2026-10-12 15:11:53 +00:00
dan
e037ddd700 Avoid ever repreparing a statement if a call to sqlite3_bind_int64() does not actually change the bound value.
FossilOrigin-Name: 4708cfe5f7fe1874870564956f0f81ba79226657c6d07ea1edffba7d5a6e4e3b
2026-10-12 14:05:08 +00:00
dan
b853a8f042 Add test case for [bugs:/info/2026-10-11T16:09:34Z | 2026-10-11T16:09:34Z]. Bug was already fixed by [7f154192db].
FossilOrigin-Name: 085dca9d30e5ce500e22374573b553f6bcd934549bc5b25305b0b97d6b37a104
2026-10-12 13:44:50 +00:00
dan
48fedaa403 Avoid excessive reprepares when there is an unindexed "col=?" constraint on a join query. This should only be reprepared when the bound value toggles between integer values 0 or 1 and any other value. Report [bugs:/info/2026-10-11T16:06:46Z | 2026-10-11T16:06:46Z].
FossilOrigin-Name: 7f154192db5a3a79f4666edd31dfc29fd73904ccd3630952e3b032e49fee6455
2026-10-12 13:36:00 +00:00
stephan
eb61c5229b When configuring with --editline, be sure to define HAVE_EDITLINE. Addresses [forum:8b9b30f6f4|forum post 2026-10-12T12:33:03Z].
FossilOrigin-Name: af570c8fc22dc682ab71d8e97c20268971fb33032530d3fa9908e1995bed529e
2026-10-12 12:48:17 +00:00
drh
55373fee0d Improved detection of complete input in the CLI.
[bugs:/info/2026-10-12T09:57:26Z|Bug 2026-10-12T09:57:26Z]

FossilOrigin-Name: 313ab6c4e517e599fa92102a1aa367fc97e9fd15a513f12ab9e8f4afebdf31f8
2026-10-12 11:42:47 +00:00
drh
e326d6eff0 Do not use an index expression to evaluate a constant expression, as that
uses unnecessary disk access and might actually give incorrect results if
the expression was moved outside of the indexed loop.  The error condition
arose in check-in [44200596aa943963] for version 3.41.0 and was first
reported 3.5 years later by
[bugs:/info/2026-10-11T19:26:40Z|Bug 2026-10-11T19:26:40Z].

FossilOrigin-Name: fee60d93e9fb37234d9cad50c65fb6d62dfe21a7fde21a16ce39025290375ad8
2026-10-12 10:24:09 +00:00
drh
d67fe4cc45 Fix a minor typo in a comment.
FossilOrigin-Name: 6c343ae1fc1a70a6ff837b003d1856a1bd3750083f1573e5ecf7ffdc0f58a588
2026-10-12 07:54:30 +00:00
drh
03e00d6b84 Do not allow the json_valid() routine to use a cached (and possibly edited)
copy of the JSON.  It needs to parse the JSON for itself.
[bugs:/info/2026-10-11T18:32:23Z|Bug 2026-10-11T18:32:23Z].

FossilOrigin-Name: ba74c33b6a69f8eeca3f8c497f9f74dd6dc92bfe8f4b0dcf0325595a5664c9d9
2026-10-11 23:06:04 +00:00
drh
50575da52c Another fix to the order-by-subquery optimization
of check-in [7a0cdc7edb704a88]. Trouble reported by
[bugs:/info/2026-10-11T17:00:56Z|Bug 2026-10-11T17:00:56Z].

FossilOrigin-Name: 1b574df8c7df4f737ca7b7e42203a8090836a05bc808cafc8f8f70aefbe8627b
2026-10-11 18:38:57 +00:00
drh
513c19fa38 Fix a problem in the query flattener associated with RIGHT JOIN, as
reported by [bugs:/info/2026-10-11T16:49:00Z|Bug 2026-10-11T16:49:00Z].
This problem surfaced after the fix to
[forum:/info/2025-08-21T14:14:03Z|Forum post 2025-08-21T14:14:03Z]
at check-in [e0beda7ffe92abf6].  Before that, the query would not parse.

FossilOrigin-Name: e6e27e37eb8c3159d67529959694971f35a589da75648e207c44e317e6d160be
2026-10-11 17:44:08 +00:00
drh
d85a80711c Back out a minor performance optimization associated with
sqlite3VdbeMakeReady() as it has been found to not work correctly on
some 32-bit builds.
[bugs:/info/2026-10-10T18:05:46Z|Bug 2026-10-10T18:05:46Z]

FossilOrigin-Name: 6ebd1e69486cabc6be3316426f67341d75073e8b392de5d6e5307662dd0000dd
2026-10-10 19:11:52 +00:00
drh
e892084680 In the CLI, disallow any use of the fileio extension in --safe mode.
[bugs:/info/2026-10-10T13:15:05Z|Bug 2026-10-10T13:15:05Z]

FossilOrigin-Name: e3e5ef4e17373677e1cc589ac79e20f6fb523e60fe8afdbc0b92f12cc75cff8b
2026-10-10 18:40:16 +00:00
drh
0a8c82266c Improved error handling in the ".import" command of the CLI.
[forum:/info/2026-10-09T17:57:07Z|Forum post 2026-10-09T17:57:07Z].

FossilOrigin-Name: 48fedacea79a9cd0a93d88dc38588ae0f1a011ed908b41ba4f2e2ee1160ffa44
2026-10-09 18:34:26 +00:00
drh
581f55819c Start a new branch to receive patches for the 3.54 release. Put all bug
fixes that will go into a patch release on this branch.  The plan it to
periodically merge the branch into trunk, rather than cherrypicking from
trunk to branch as has been done before.

FossilOrigin-Name: 6b286a1bb034fc7f855e023aa0dab920366d949dd5fefcf2652039d5c6dc96ed
2026-10-09 18:11:04 +00:00
drh
6932c59ee5 Version 3.54.0
FossilOrigin-Name: be8d059e9a49089ab2dce5ed26dd87aaf598fdc5fbe0b107c0dd758464bcd5e3
major-release version-3.54.0
2026-10-09 15:46:58 +00:00
drh
039ef9acc9 Fix a typo in a comment. No changes to code.
FossilOrigin-Name: 7b468f6f1d63645c8d8132790831dac6916006f81cf97e99abec711de93feb23
2026-10-09 14:40:03 +00:00
drh
0e62f142b7 In the CLI, add comments to internal SQL functions making it clear that
those functions are subject to change and removal at any time, lest people
come to depend on them.  No changes to code.

FossilOrigin-Name: a3332bd623d997921c3186433cd1eab0c9413aa0f68d93b1731cf80128ec3a36
2026-10-09 11:47:51 +00:00
dan
fdc06f3643 Fix a build script problem causing generated file sqlite3-all.c to #include "sqlite-10.c" instead of "sqlite-A.c".
FossilOrigin-Name: 962b207123fe2bd6d72ad49fb80822b4e4290c1d77ea4ca097ea341202d4cc5f
2026-10-09 11:22:17 +00:00
drh
9cba46343e Remove the OP_IfNotOpen opcode. The OP_IfNullRow opcode is sufficient to
get the job done.  This is a follow-up to [e71b0465b9fa13db].

FossilOrigin-Name: 797081cb705c65a466379e180344d0c9d781f10415c8ed8f72edc6ea065a1a28
2026-10-08 23:59:13 +00:00
dan
bfb858c596 Ensure the join flags on the parent are set correctly when flattening UNION ALL sub-queries that include branches with RIGHT joins. Report [bugs:/info/2026-10-08T15:27:33Z | 2026-10-08T15:27:33Z].
FossilOrigin-Name: cfa69ea48a7aa379ee0c30ae81d2802da862d610f829c933e5eb358c23fc2b9d
2026-10-08 19:34:24 +00:00
drh
d0fe192fa1 Disable the "expr IN (const)" to "expr=const" optimization of "const" has
a COLLATE clause, as using the collating on "=" would give the wrong answer.
[bugs:/info/2026-10-08T12:36:41Z|Bugs 2026-10-08T12:36:41Z]

FossilOrigin-Name: 53a73aa03d05350ebee81c3d2aef85744c8ebeda72f565083dc4b472b57c5499
2026-10-08 19:06:55 +00:00
drh
f19a90c569 Improvements to the display of DDL SQL statements in the CLI and in
the sqldiff command-line tool in order to close comments and similar
in the case of a corrupt schema, and avoid possible SQL injection
attacks.  ANT-2026-9VFH4DZS.

FossilOrigin-Name: 028a92f9c353d3b400551954de2e09c1723076491f79ff767dd24b452654fda8
2026-10-08 18:34:12 +00:00
dan
28e05e55f6 Avoid clearing unrelated join related expression flags when processing window function queries. Report [bugs:/info/2026-10-08T15:38:26Z | 2026-10-08T15:38:26Z].
FossilOrigin-Name: c50d7f682cc95715e4577413196dbdb2845d7c845b0e760c7060b7cdcda87770
2026-10-08 17:57:48 +00:00
dan
ab1268f758 Fix test script errors causing problems on windows.
FossilOrigin-Name: 379c017e8f999c35e3b3de64fcc3923e45570ba20bee50a3dd00f6996990a033
2026-10-08 16:17:45 +00:00
drh
fd6452aff8 Make the sqlite3_incomplete() SQL function available in debugging builds
of the CLI, for testing.

FossilOrigin-Name: 07095b76c1f086790d35a5acd0a22b081e346bc2dca48a8fb0c0c978be2c2243
2026-10-08 13:26:45 +00:00
drh
64c2f58d73 Disable legacy "go" and "/" command terminator options in the CLI
unless compiled with -DSQLITE_SHELL_LEGACY_COMMAND_TERMINATOR.
ANT-2026-FE9980M1 and ANT-2026-G9MMWYGM.

FossilOrigin-Name: ac6ac0c22d98878cdf6042b5801cf5b5dc98c7b48077360d24a70b876921b428
2026-10-08 12:09:35 +00:00
drh
82fda1d99a Sanitize "*/" in tables names of the output of the .diskused command
in the CLI, and in sqlite3_analyzer, so that it doesn't prematurely
close the comment. ANT-2026-XQM1QD48

FossilOrigin-Name: bcde8f991a86aed6280c1b6164bc14cc1aff1a966a694a5fb32341ffa0202960
2026-10-08 10:55:33 +00:00
drh
97048e902c Update check-in [e71b0465b9fa13db] so that it does not try to to generate
an OP_NullRow opcode for cursors of an IN operator that do not actually
exist.

FossilOrigin-Name: ea315175a8076f22f85a57a01c5b490630ab20d5ed80144118ced61c8c24886d
2026-10-08 09:57:08 +00:00
drh
74675a9e87 Assign the correct encoding to the BLOB values read from an overflow page.
[bugs:/info/2026-10-07T15:44:40Z|Bug 2026-10-07T15:44:40Z]

FossilOrigin-Name: a8895cb047a3aeed35642111fa79bde9db962a5d7bc3f0cc472b4dbe510cb3f9
2026-10-08 03:28:50 +00:00
drh
644fa62518 Fix processing of LEFT JOIN when the right operand is controlled by an IN
loop.  [bugs:/info/2026-10-07T23:22:09Z|Bug 2026-10-07T23:22:09Z].

FossilOrigin-Name: e71b0465b9fa13db3922e767c1d8979d221516475670dcd3fa4df1fab30176c6
2026-10-08 02:55:50 +00:00