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

10513 Commits

Author SHA1 Message Date
drh
a4b453a1e6 The .recover command should not remove BOMs that are already inside the
database.
[bugs:/info/2026-10-18T20:41:57Z|Bug 2026-10-18T20:41:57Z]

FossilOrigin-Name: 69f4d423fa5538a555f862da3a1896e2fa3009dc650286042cb0beabe4dd2114
2026-10-23 15:52:17 +00:00
drh
0bb1247fca Follow documented behavior when casting a zeroblob() to text on a UTF-16
database. [bugs:/info/2026-10-23T12:45:59Z|bug 2026-10-23T12:45:59Z]

FossilOrigin-Name: 8a0296aa4db20cdcbbfaa0e4c61b5fe339b0514cf73832253ff0abd1ce59d31c
2026-10-23 13:06:30 +00:00
drh
0ccc01d3d9 Fix query planner error in the case of a multi-index OR on a WITHOUT ROWID
table where the OR-term uses the seek-scan optimization.
[bugs:/info/2026-10-23T03:09:01Z|Bug 2026-10-23T03:09:01Z].

FossilOrigin-Name: b33ff35e6246a9dc62205db244511eead28fae90cea686e205effae5e6cc5b49
2026-10-23 12:14:17 +00:00
drh
a9940a8503 Fix a problem in QRF when the screen width is narrower than a column.
[bugs:/info/2026-10-23T03:50:28Z|Bug 2026-10-23T03:50:28Z]

FossilOrigin-Name: 8de43901c796964bfc7943261fe639874e395ec9415970e4e6a5d1c4868d18a8
2026-10-23 11:55:02 +00:00
drh
25ba73bc9a Enhance the ieee754(X,Y) function so that it returns 0.0 even if Y very large.
[bugs:/info/2026-10-23T03:55:14Z|Bug 2026-10-23T03:55:14Z]

FossilOrigin-Name: 7d8cc4d253a4d015a60f89c2b87851dccc53f551272f7f373bd1c65bc55d770d
2026-10-23 11:09:58 +00:00
drh
02225da9a9 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.
Private email from Mirchev.

FossilOrigin-Name: 64c93bc7e643433ddd79b9dc67e50d3d9fe2228a1234e27e143b06150d556abd
2026-10-23 09:08:13 +00:00
drh
7c2cb02205 Improve ALTER TABLE DROP CONSTRAINT so that it is better able to deal
with some corner case in the constraint syntax.
Bugs [bugs:/info/2026-10-22T16:25:18Z|2026-10-22T16:25:18Z] and
[bugs:/info/2026-10-22T16:30:48Z|2026-10-22T16:30:48Z].

FossilOrigin-Name: 14d924c33ff11babef13e68f178c715bb8744a0134ee580715486b601d5738d8
2026-10-22 19:55:10 +00:00
drh
ac429ff804 Index lookup of an integer column using value -9223372036854775808.0
now works.
[bugs:/info/2026-10-21T17:54:28Z|Bug 2026-10-21T17:54:28Z]

FossilOrigin-Name: 03f699544e6b2040eda17e2f4b48813b10513fc05891a3dd4000867316413103
2026-10-21 23:49:46 +00:00
drh
99774ca002 Make the NOT INDEXED key phrase work for WITHOUT ROWID tables.
[bugs:/info/2026-10-21T17:47:47Z|Bug 2026-10-21T17:47:47Z]

FossilOrigin-Name: 9eafe6158d1042f27b867a90f0fb96abf639954efe7944aed6c8b5c9f4373dfa
2026-10-21 20:53:42 +00:00
drh
671911de56 New CLI-based test cases for foreign keys.
FossilOrigin-Name: f4f25cd2a8c13a1718a34be8fd36224fba7feab3fa8c44ba85a2aa59d3f1904f
2026-10-21 16:29:13 +00:00
dan
dd8f6a7422 Allow the foreign key code to use child indexes even when there are affinity mismatches between child and parent columns.
FossilOrigin-Name: ee1424130e37c23c8b4db54252b6badef5bd548bfa8ffd3d88c8f70b4662e5af
2026-10-21 14:41:53 +00:00
dan
0fa90d6621 Allow composite FKs to use indexes with mismatched affinities as well.
FossilOrigin-Name: 2e0883964e8d14bd5337a3aaa838b72522ee7a54ea151db5e29cff1f9ee6981e
2026-10-21 14:37:51 +00:00
drh
77207b3d94 Fix the fsdir() table-valued function to better cope with
unreasonable LEVEL constraints.
[bugs:/info/2026-10-21T10:49:41Z|Bug 2026-10-21T10:49:41Z]

FossilOrigin-Name: 3e8932ebf2cec334b4867e0192d22b6de8102eda48f9f6e168fe5d2d24a8db0c
2026-10-21 14:28:22 +00:00
drh
61a8c1579d The IN pre-filter is now only added when the child key can actually use an
index lookup.

FossilOrigin-Name: a3d46e1f8f02f64c888d26038d83a065bcf56ec5df80d924e3b074152aab18dd
2026-10-21 12:57:50 +00:00
drh
e8eff0e979 An attempt to get the new foreign key code to use indexes on type mismatch
between parent and child.

FossilOrigin-Name: c0523245e2ba3339d8b21cf26e164d05ec252f3d882eadacd4c510a224ccbdba
2026-10-21 12:24:59 +00:00
dan
4242856e53 Ensure that all (parent_key = child_key) comparisons performed as part of foreign key processing are done using the affinity of the parent key. Report [bugs:/info/2026-10-20T02:56:10Z | 2026-10-20T02:56:10Z].
FossilOrigin-Name: feb6d3a3016d890fb1a8ca2a1752949b8adc0c06debb6ca305cacafc6b6edd10
2026-10-21 11:52:56 +00:00
drh
5b61b78f12 Cap the number of entires in a ZIP archive processed by the zipfile
extension at 65535.
[bugs:/info/2026-10-21T10:52:39Z|Bug 2026-10-21T10:52:39Z]

FossilOrigin-Name: decd49e6565bd5105e3b5cbe1067c8992582076a7c4e12cb6f3d089f38aba524
2026-10-21 11:51:52 +00:00
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