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

10496 Commits

Author SHA1 Message Date
drh
078f7c4c45 Test cases added
FossilOrigin-Name: 2ec6c0ff491454f25103f368a5885a6bcd0177fa1eb0bfb2060cd5a6f8c60a72
2026-10-21 10:27:51 +00:00
drh
99f724be20 Simplify the ".clone" command so that it just makes a copy of the main
database.  Move the implementation into a separate dotCmdClone() function
and provide better help text explaining its history.

FossilOrigin-Name: 8b5c87a5f4dc6dccf2130d41df958ea59f0892836b574388539ee7d905cd014d
2026-10-20 19:30:24 +00:00
drh
255534dc97 Fix the shellB.test module so that it does not try to run dump.sql
without virtual tables available.

FossilOrigin-Name: 3f8b4c7760148eabbf721ff9b8321793972d372fa3156dc8c60ed680f5467d0c
2026-10-20 19:21:43 +00:00
drh
bd27afc005 Be sure to use the correct collating sequence when doing a balanced merge
of a four-way or larger compound select.  Error goes back to version
3.38.0 (2021).
[bugs:/info/2026-10-18T23:46:25Z|Bug 2026-10-18T23:46:25Z]

FossilOrigin-Name: 7ee2a48bb3765bfe8cef4ae400eacf77c660f9d5dbaa289ab5f17474fca98cae
2026-10-20 18:25:01 +00:00
drh
03c38c992a Merge branch-3.54 fixes into trunk
FossilOrigin-Name: 8efb0acad85f6220f576c71530256d62f92dfba5673cdc5e0371f480753f1034
2026-10-20 17:53:47 +00:00
drh
d3d85df39e Enhance the readfile() function in the fileio.c extension so that it
is able to read from pipes.
[bugs:/info/2026-10-20T14:02:37Z|Enhancement request 2026-10-20T14:02:37Z]

FossilOrigin-Name: 49d185f2ac2d01c6b1bd9c20d13628eff3803529faaf969bace3981f6acc7a28
2026-10-20 17:46:19 +00:00
drh
f95dc99bc6 Remove a debugging ".mode -v" in the dump.sql test script that was
accidentally left in the previous check-in.

FossilOrigin-Name: 632943da2d3e58696ec0a7548e18a99a57a3dd51f700f24144377a6d8fdb8c06
2026-10-20 17:42:52 +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
drh
60f12a1ecc Fix the --preserve-rowids option on the ".dump" command of the CLI
so that it works for tables that have a non-IPK column named "rowid".
[bugs:/info/2026-10-20T03:22:48Z|Bug 2026-10-20T03:22:48Z]

FossilOrigin-Name: ecd172bb44be40841336cf2ec42f2505c4f98a96eace3e4862e038a3c147770d
2026-10-20 17:24:29 +00:00
drh
2f0c895a4e Fix the sqlite3_carray_bind() interface so that it works with
SQLITE_TRANSIENT and an array length of zero.
[bugs:/info/2026-10-20T13:53:58Z|Enhancement request 2026-10-20T13:53:58Z]

FossilOrigin-Name: 47228787b1459a35a12a499be90e249c555658bf4e393122041f474e8986b17d
2026-10-20 17:05:30 +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
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
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
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