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

10453 Commits

Author SHA1 Message Date
dan
9a9446f3b0 Fix a race condition with a writer that could cause a connection with a read-only *-shm file to return a spurious SQLITE_READONLY_RECOVERY error.
FossilOrigin-Name: e2e7c8eb02daea0876fb25abccd96c769f55fba3e995f0e7cf29aa992d7c61a6
2026-10-23 18:14:43 +00:00
dan
196f6a9389 Fix a race condition with a writer that could cause a connection with a read-only *-shm file to return a spurious SQLITE_READONLY_CANTINIT error.
FossilOrigin-Name: 30a301835b588f9d57fc04af3140612bef781bdc9b19aa83515d77a24ab06ee0
2026-10-23 17:24:48 +00:00
drh
ac1dd97f22 Ensure that all content that is copied into the -shm file during recovery
has been initialized, even in the case of no valid WAL frames.

FossilOrigin-Name: f2255af8231d74ce3d949d3d597a25eda6baa3c9ddfd23fa0e8020c213404e6c
2026-10-23 09:34:42 +00:00
dan
5a1da0ae1b When a b-tree cell is deleted, zero the cursor's cell-info cache as the cell it describes no longer exists, even if the cursor position is being preserved. Report [bugs:/info/2026-10-18T16:11:58Z | 2026-10-18T16:11:58Z].
FossilOrigin-Name: 07ed30558ee7da460ed0ca2b36cd555aeb5caa91f0971b2cf83adc08524ca9b7
2026-10-20 17:27:17 +00:00
dan
12b80e71b6 When a real value is specified as a default for a text column, avoid various inconsistencies by ensuring that it is always converted to an IEEE double and then back to text before use, as is already done for integer values. Report [bugs:/info/2026-10-05T16:22:00Z | 2026-10-05T16:22:00Z].
FossilOrigin-Name: d140ada6488a27342c6baf0d8e44adf38f91b37a657c2bcc0efa9ecf437b414c
2026-10-20 16:11:44 +00:00
drh
e3a9db8c15 Raise an error if a REGEXP pattern ends with "\\".
[bugs:/info/2026-10-20T13:44:52Z|Bug 2026-10-20T13:44:52Z]

FossilOrigin-Name: 480d6e1a39a2057685260cf8386a3dbef4f391c6d1766a6cded5f8cc4d1a0ec4
2026-10-20 15:42:45 +00:00
dan
34a05a3723 Fix handling of GROUP BY and HAVING clauses attached to the rightmost SELECT of a compound SELECT with one or more COLLATE clauses attached to ORDER BY expressions. Report [bugs:/info/2026-10-16T22:06:45Z | 2026-10-16T22:06:45Z].
FossilOrigin-Name: bd873f7ca9fc0d36a884d3929517d9a19c181c811dae65d64815a2006005b788
2026-10-20 15:19:35 +00:00
drh
7697c7d2b9 Fix QRF so that it correctly handles zero-length output appended to
the sqlite3_qrf_spec.pzOutput result.
[bugs:/info/2026-10-20T13:22:11Z|/info/2026-10-20T13:22:11Z]

FossilOrigin-Name: ee344fc063ec0de8f1cd4c61c88eca33c2587c52d868202db3c514f0bc2fae52
2026-10-20 14:36:09 +00:00
dan
4f5062f0ba Correctly handle aggregate functions that aggregate over the rows of a window function query, even if they are nested within sub-selects. Report [bugs:/info/2026-10-16T08:07:09Z | 2026-10-16T08:07:09Z].
FossilOrigin-Name: 7522512ff96d869c46596e7d514b65f210530db09e6359c2f37911d45f34979d
2026-10-20 14:07:59 +00:00
drh
4855cb2a31 Fix the CLI to correctly handle a ".exit" immediately following
a ".output memory". [bugs:/info/2026-10-20T13:13:50Z|Bug 2026-10-20T13:13:50Z]

FossilOrigin-Name: 2fdd752dc92692e08c805eb10bf78d97e93c8436433c8175fbff310513f340d7
2026-10-20 13:45:54 +00:00
dan
d89373dc10 Fix a problem causing queries on secure-delete fts5 databases to occasionally return extra, non-matching, rows. Report [bugs:/info/2026-10-18T20:40:47Z | 2026-10-18T20:40:47Z].
FossilOrigin-Name: 10b8f4166da26908aef9182824b0c967af7d861ff6c83daed7cd50321ee563b3
2026-10-20 11:13:15 +00:00
dan
6410c0e4a9 Avoid dropping error codes from the streaming input callback in sqlite3rebaser_rebase_strm(). Report [bugs:/info/2026-10-18T05:31:08Z | 2026-10-18T05:31:08Z].
FossilOrigin-Name: 90f953b42a7c9c4939b215fa9e1fe11cf381978d3ee7737d390ae14611cccbcf
2026-10-19 20:21:23 +00:00
drh
154360f1cd Fix a regression in the CLI's handling of control characters in CSV output,
caused by [d0fe92e0ce8662b9].
[bugs:/info/2026-10-18T20:38:57Z|Bug 2026-10-18T20:38:57Z].

FossilOrigin-Name: 2146eab561d153b70eb41c54bb122ea8d2dc0ad983f00639aa2f65fd3a64e603
2026-10-19 19:15:13 +00:00
drh
9c6e3568ba Fix JSON parsing to properly recognize a backslash-continuation at the
end of a string.
[bugs:/info/2026-10-18T04:42:37Z|Bug 2026-10-18T04:42:37Z]

FossilOrigin-Name: d8c93a5f2c19622d1da29f503145223ff433e1597235510273fbebefe455c4c4
2026-10-19 17:24:43 +00:00
drh
c3ba37e71c Update sqldiff so that the script it outputs preserves the full
precision of floating point values.  This fixes the first of two
issues reported by [bugs:/info/2026-10-18T20:38:30Z|Bug 2026-10-18T20:38:30Z]

FossilOrigin-Name: 2a439593d068a75a30807ab41e764c8aac1dafb205229a78071b716997d2650c
2026-10-19 16:06:56 +00:00
dan
c7885735ac Correctly handle compound SELECTs with explicit COLLATE clauses on ORDER BY expressions, even if they appear in a CTE or VIEW definition. Report [bugs:/info/2026-10-19T08:22:22Z | 2026-10-19T08:22:22Z].
FossilOrigin-Name: 36803e2660eed4f3d16750f1d3a4af796e2c15034838f07f472c2fbb0f9b52b0
2026-10-19 15:14:13 +00:00
drh
853288469d The default floating point format for JSON and INSERT output modes
should be "%!0.17" to preserve full binary→text→binary round-trips
with no loss of precision.
[bugs:/info/2026-10-18T20:37:23Z|Bug 2026-10-18T20:37:23Z].

FossilOrigin-Name: c31221e954bcca2e6505338446635d0efb809f453008c4927441ebd6f0e1b873
2026-10-19 14:34:34 +00:00
drh
10586997d9 Fix the ".dump" command in the CLI so that it is not affected by
mode settings like --fpfmt, --ifmt, or --textjsonb.
[bugs:/info/2026-10-18T20:39:22Z|/info/2026-10-18T20:39:22Z]

FossilOrigin-Name: a9d8123e27fa71bf7d29ec4cc7aa997f5e94de3c5b48907ccb7242795e44144c
2026-10-19 12:02:08 +00:00
drh
850ea24139 Back out parts of [e68aa6e1293a2c7a] for the 3.54.x patch series, as they
cause a regression reported by
[forum:/info/2026-10-16T20:30:17Z|Forum post 2026-10-16T20:30:17Z].  The
"bug" fixed was not important.  The plan is to add a new limit in 3.55.0
to address this problem.

FossilOrigin-Name: 845190e3f2ede1f64d7e26ec9391d3551080c1d787599d49bad402c3734d81aa
2026-10-18 16:17:16 +00:00
drh
18347d8044 Check the datatype of the second (optional) argument to the log() SQL
function and return NULL if it is non-numeric as the documentation says
it should.
[bugs:/info/2026-10-18T05:05:18Z|Bug 2026-10-18T05:05:18Z]

FossilOrigin-Name: a99e577b951fa38fcdff3693072c2f78e546be6a1c187b648f043b499a06768e
2026-10-18 10:14:50 +00:00
drh
ea9d6e8419 Fix an incorrect assert() in generate_series(). No impact on non-debug
builds.
[bugs:/info/2026-10-17T09:24:09Z|Bug 2026-10-17T09:24:09Z]

FossilOrigin-Name: c5d67762df0507fe58e035b572623f36efb394d08d322bbdb313a2f0da49c734
2026-10-17 12:03:36 +00:00
drh
8e1b59b6dc Enhance QRF to deal with zero-length column names.
Also make use of the new sqlite3_str_free() interface.
[bugs:/info/2026-10-17T09:26:21Z|Bug 2026-10-17T09:26:21Z]

FossilOrigin-Name: d3e004fe3daeb01085e969890beb56fe71839bcad0e7a19e1690a1b2d14b2775
2026-10-17 11:13:08 +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
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
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
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
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
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
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
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
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
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
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
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
drh
9d50c7ebfc Fix the expansion of "TABLE.*" so that it works the same as PostgreSQL
when TABLE is the left operand of a RIGHT JOIN USING.
[bugs:/info/2026-10-07T02:56:24Z|Bug 2026-10-07T02:56:24Z]

FossilOrigin-Name: d232720b7932c1cebe4cf5b1a1e9096889e1807844351390149dfeb2ea7fc304
2026-10-07 10:41:59 +00:00
dan
c62b4abb99 Handle temp triggers attached to databases clobbered by sqlite3_deserialize() in the same way as those attached to DETACHed databases.
FossilOrigin-Name: 84c773fcc2f785346fd12e8a17ac45f9068797d9629ddc367318994b6fed421b
2026-10-05 18:07:26 +00:00
dan
b642a1d56d Ensure that deserializing into a database expires existing prepared statements.
FossilOrigin-Name: de0361b1caa97d36ea79a5bcb032539ccfb235c03581e0e88c54c03a321d7911
2026-10-05 17:51:16 +00:00
drh
95170adc37 Fixes to sqlite3_incomplete() so that it does not appear to presume a
trailing newline if there is none.
[forum:/info/2026-10-05T16:22:33Z|Forum 2026-10-05T16:22:33Z]

FossilOrigin-Name: adc1113cfd1d675a44a4ef34d7be3e0cf20129840e542d692fefa249780e23b8
2026-10-05 17:32:25 +00:00