1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-28 10:57:26 +03:00
Commit Graph

10479 Commits

Author SHA1 Message Date
drh
2f641dbdeb Test case changes to handle non-standard configurations.
FossilOrigin-Name: 185ffd27064bab83d3e4c39353ab5bea15e99155f8cc851c03abd49641fbfdb5
2026-10-20 13:10:11 +00:00
drh
3863fd3b40 Do not allow a simplified constant expression (example: "123 ISNULL" → "1")
to be used as the ordinal column number in an ORDER BY or GROUP BY clause.
[bugs:/info/2026-10-16T12:58:09Z|Bug 2026-10-16T12:58:09Z]

FossilOrigin-Name: c40e620b04aaa3c90501124db27711b1d4e8ae830f75828c7cccf84f7df42660
2026-10-20 12:07:04 +00:00
drh
bf1c107e3a Fix ALTER TABLE RENAME so that it works on triggers that contain UPSERT.
[bugs:/info/2026-10-20T03:23:05Z|Bug 2026-10-20T03:23:05Z]

FossilOrigin-Name: be17b0b030c06169c92e49cbe56ed9228696fce741d4ecb0683b27e2113f0ce1
2026-10-20 09:49:36 +00:00
drh
1f3e5e763d Merge the latest branch-3.54 fixes into trunk
FossilOrigin-Name: b3606f7019b2a2dc77d9e476055156631d07c33dfef2d8bc0fdd75b13fad54fd
2026-10-20 00:17:35 +00:00
drh
a315fb49a2 Fix errors in the decimal_cmp() comparison routine of the decimal extension,
and the corresponding "decimal" collating sequence, as reported by
[bugs:/info/2026-10-19T06:35:26Z|Bug 2026-10-19T06:35:26Z]

FossilOrigin-Name: bf74b51f7e40dd4fbc7bbeba1539a38a0e19252c60ad87d514a09895b47bb506
2026-10-19 23:22:16 +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
ea1e2759a1 Merge the latest branch-3.54 fixes onto trunk
FossilOrigin-Name: 79ba7ba1a75c998c68dd2cc60de7fbe133a563e803a536efea94eff657603965
2026-10-19 18:26:06 +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
b1f3151bb7 If terms on the SELECT on the RHS of a vector IN are removed, then the
subquery cannot be reused for other things, since it is now different.
[bugs:/info/2026-10-16T22:07:15Z|Bug 2026-10-16T22:07:15Z]

FossilOrigin-Name: 080338a91b447c12186bbb4e23da1927ca448fee9a11cd6507f5f2041ee2dcba
2026-10-18 22:48:50 +00:00
drh
4e512bf10d Fix the decimal extension to correctly deal with NULL parameters.
[bugs:/info/2026-10-18T14:25:03Z|Bug 2026-10-18T14:25:03Z]

FossilOrigin-Name: 716b63c934156d8b19bda24c5bb544cc3d7d0ef66228150eea0a166d6e8c9caa
2026-10-18 19:42:52 +00:00
drh
dac1b8dc84 Add the SQLITE_LIMIT_CTES option to sqlite3_limit(). The default is 50K.
Setting to zero disables the limit.  The limit is approximate - it does not
actually count CTEs but rather simply refuses to process a CTE with cursor
number that exceeds this limit.  This is a re-do of the fix for
[bugs:/info/2026-10-04T05:35:14Z|Bug 2026-10-04T05:35:14Z] that also
avoids the regression reported by
[forum:/info/2026-10-16T20:30:17Z|Forum post 2026-10-16T20:30:17Z].

FossilOrigin-Name: b32709ea065da2eb41a6eb0ca20381d2bd82a356bb5f8bc76fee063d1da93004
2026-10-18 19:10:13 +00:00
drh
e58a5a91ed Limit the size of the second argument of the (testing use only) SQL function
fpdecode() to avoid a (harmless) signed integer overflow.
[bugs:/info/2026-10-18T03:43:20Z|Bug 2026-10-18T03:43:20Z]

FossilOrigin-Name: 72187f18fe8b207e5955f269a5e299e5b18d5b919ae9073b208454c994e9b18d
2026-10-18 18:30:00 +00:00
drh
d7e0a4717a Merge recent branch-3.54 fixes into trunk
FossilOrigin-Name: f9e0ce3382e4787468bdb4029105fbffb2d4ab92b51c655ae762b555d8570efb
2026-10-18 16:31:01 +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
3bce1260e7 Fix 24:00:00 rounding of dates with negative years.
[forum:/info/2026-10-17T12:57:32Z|Forum post 2026-10-17T12:57:32Z]

FossilOrigin-Name: 91515aa82e05f32db4b5d126d762d730cf424735edc4ef59a696ad581f4ca1ab
2026-10-17 13:23:07 +00:00
drh
94852686fe Merge recent branch-3.54 fixes into trunk.
FossilOrigin-Name: c75eff906c11d8f17ae198e5f6cfea34636df2bde0104440fd0b6983ddb2f918
2026-10-17 12:10:02 +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
dan
88c7cc0a27 Fix a problem handling zero-length strings in some cases in group_concat() when it is used as a window function. Report [bugs:/info/2026-10-16T15:51:51Z | 2026-10-16T15:51:51Z].
FossilOrigin-Name: 2f794cf18ac9e55a9a05349187d4322e160c99f9c6068aaf33d190cda929bc82
2026-10-16 17:42:42 +00:00
dan
c3e073420f In test file test1.c, use a static SQLite mutex to protect the hash table instead of a Tcl mutex. A Tcl mutex is a no-op on unix unless TCL_THREADS is defined at runtime, and SQLite test configurations do not define this, which was causing errors in multi-threaded tests like notify2.test.
FossilOrigin-Name: 668541c592b89d32716420615450d55d9faf89da8a8e389c673973d8383cca98
2026-10-16 14:31:53 +00:00
drh
848cad0ec0 Deal with harmless 32-bit integer overflow on parameters to some extension
SQL functions.
[bugs:/info/2026-10-15T04:34:08Z|Bug 2026-10-15T04:34:08Z]

FossilOrigin-Name: ca52702835d16afd04e936bc4d57f78f0c4d37f83b19b632122f6a699009ca3c
2026-10-15 21:46:13 +00:00
dan
14913b9e28 Avoid a crash processing "ORDER BY rowid NULLS LAST" introduced by the previous commit.
FossilOrigin-Name: 90cab4aceaee8955e57694231f025a22ad86924e036f3ce271cbb332cbd1bb4b
2026-10-15 19:59:06 +00:00
dan
8351ef7256 Avoid a spurious corruption report in some cases when processing an ORDER BY .. NULLS LAST query against a WITHOUT ROWID table that has had columns added to it using ALTER TABLE. Forum post [forum:2026-10-15T03:54:19Z | 2026-10-15T03:54:19Z].
FossilOrigin-Name: a2a20c54a2ce7a43a253f496210e8ff39215cd18b17895b62ef963fe449f3ab2
2026-10-15 19:07:48 +00:00
drh
ef3e33c3df Fix DEFAULT so that BLOB values cast to text use the database encoding.
[bugs:/info/2026-10-14T17:33:12Z|Bug 2026-10-14T17:33:12Z].

FossilOrigin-Name: 178677e14188117aada456fb068f6c9c6acf577ff6ebb211303e9227dd874e8f
2026-10-15 17:36:23 +00:00
dan
e4facb4585 When a single loop uses an IN(...) expression and a LIKE/GLOB expression with an index, nest the 2-iteration loop that scans ranges of text and blob values using the LIKE/GLOB pattern inside the IN(...) loop in order to ensure that results are scanned in index order. Report [bugs:/info/2026-10-13T18:54:28Z | 2026-10-13T18:54:28Z].
FossilOrigin-Name: 08e979525ff1eef80c8e824c80cca7b6a3dfb320122258803673ace43c806c9a
2026-10-15 15:33:09 +00:00
drh
e9183c57f2 Merge the 24:00:00 fix from branch-3.54 into trunk
FossilOrigin-Name: 3ce64081cab882b60ad73db77da961e479cd84eb151444f420da9fcc370f740d
2026-10-15 13:33: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
90687aa700 Ensure the correct collation sequence is used for expressions like "a IN (SELECT b COLLATE ...)" when using an index on "a". Bug [bugs:/info/2026-10-14T18:00:55Z | 2026-10-14T18:00:55Z].
FossilOrigin-Name: bbdd13370de9303561bf501f88bf62d2ba363c6e5d950d8d7416e59874768ee0
2026-10-14 20:07:19 +00:00
drh
fb0878ac38 Fix indexes on typeless generated columns that pull from REAL columns so
that they correctly return REAL values.
[bugs:/info/2026-10-14T17:34:30Z|Bug 2026-10-14T17:34:30Z].

FossilOrigin-Name: 7408f90ecc2dd26aceb52f92de78b8e1521cb5a294d3231fd32a903afe1db41d
2026-10-14 18:39:44 +00:00
drh
2023a2b375 Fix json_tree() when it is given a root that ends with an array index so
that it returns the correct "key" for the first root.  This was broken
by check-in [858b76a00e8ff552] and in version 3.45.0.  Problem reported
by [forum:/info/2026-10-14T08:42:26Z|Forum post 2026-10-14T08:42:26Z].

FossilOrigin-Name: eaf646e376a5a3e10a874ed1c07ca1382f0ccb7cdf1cc963697638a54b98c779
2026-10-14 17:52:44 +00:00
dan
3098b95515 Have testrunner.tcl unset environment variable DEBUGINFOD_URLS. Leaving it set slows down some sanitizer release tests.
FossilOrigin-Name: b7ebfea1c1fd4a4d70f1e429c4ad5d21502e10ab28f90bdb7ae1da2df417cf8b
2026-10-14 17:52:21 +00:00
drh
77a30f6648 Ensure the internal DBFLAG_SchemaKnownOk flag is always cleared
after a database schema is reset.

FossilOrigin-Name: 96a56e7cf9fe91ee8519e5a991c206cea74c53ad596cd78873b74954b2afef9a
2026-10-14 15:02:55 +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
9d1806e3c0 Merge bug fix from branch-3.54 into trunk.
FossilOrigin-Name: c2df85dd6e750e84ea64a464d65a315e702cd16c1b4a51cb212ae547dfaea673
2026-10-14 12:48:03 +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
9919c36b55 Avoid incorrectly marking an index used by an OR-scan as a covering index leading to an "internal query planner error" error. Report [bugs:/info/2026-10-11T19:31:18Z | 2026-10-11T19:31:18Z].
FossilOrigin-Name: 3e41413d32122635837ba487bb0b6176ff7c3e4ae50c1c0a179ed0d450a6a2f4
2026-10-13 19:04:06 +00:00
drh
13c92f7522 Add test cases for CLI command parsing (cliparse.sql).
FossilOrigin-Name: a65c63c6a632d60c49f5ddc1ed482d71436da8f4e8dd3106b13c5f6a281ae287
2026-10-13 18:19:05 +00:00
drh
39315a4d35 Enhancements to the partial-index constraint reuse logic of
check-in [8d4160910d651246] to take into account column affinity
and STRICT tables.
[bugs:/info/2026-10-11T20:18:09Z|Bug 2026-10-11T20:18:09Z].

FossilOrigin-Name: cb7816d72cd340def63987c014726f088e06198174bd1f20f402c1aacac17fe2
2026-10-13 14:00:20 +00:00
drh
5bab74a91b Merge the latest fixes on branch-3.54 into trunk
FossilOrigin-Name: c57525b36a4a07ef2080824913effef614f545c3d85377376fe04238f7cddf2d
2026-10-13 11:05:00 +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
9de75a1245 Merge fixes from branch-3.54 onto trunk.
FossilOrigin-Name: 5a05aded7f54507305edeabbcb54e25d67299769557ae5dc54d0f59d639ac2c6
2026-10-12 22:05:35 +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