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

32669 Commits

Author SHA1 Message Date
dan
5ee733befe Allow windows clients to open and recover a wal mode database even if an old client still has the *-shm file mapped. Forum post [forum:/info/2026-10-05T14:07:31Z | 2026-10-05T14:07:31Z].
FossilOrigin-Name: 7c103a0b7d509dce58aa87518e13213451e5f70938ff08aa55accd645e3b2ff3
2026-10-05 17:11:27 +00:00
drh
f0c7055db7 Omit the -r command-line option from Lemon. That does not affect
SQLite. [forum:/info/2026-10-05T15:11:11Z|Forum 2026-10-05T15:11:11Z].

FossilOrigin-Name: bc72b1d95c2f098a92013ad9f4ab60440c105cd17889d12ae7349a4531a90c75
2026-10-05 15:20:48 +00:00
drh
46545d6d15 Merge the latest trunk enhancements into the tree-tracker branch.
FossilOrigin-Name: 5fa8b22cfb3fe6a455c40e3eb4c236640fd962d33903dbced244d970f548248a
2026-10-05 14:26:15 +00:00
drh
45cd455d79 Update test cases so that they work for configuration that use
-DSQLITE_MAX_EXPR_DEPTH=0.

FossilOrigin-Name: 4bfc6e53a95d710b7f40fa9c80d8cdd1df50d69ed8614e9800f7e6a1ca5a3c29
2026-10-05 14:22:13 +00:00
dan
6e20be1c58 Ensure that eponymous virtual table objects are not left with dangling schema pointers if the main database is overwritten using sqlite3_serialize().
FossilOrigin-Name: 18d2646f6fa56244be12122873cd9aa48b2074a22f0be637edfcc9b5de99158b
2026-10-05 14:03:54 +00:00
drh
8532bf12f4 Correctly rollback "OR REPLACE" changes following a "datatype mismatch" error.
[bugs:/info/2026-10-05T07:15:40Z|Bug 2026-10-05T07:15:40Z].

FossilOrigin-Name: 028f3f96a0af9fc71f1c191bbd44e0b7c3884d0571931b2808e4cdd1bb2f5081
2026-10-05 13:27:07 +00:00
drh
eff50a067c Prevent the expression generated by the count-of-view optimization from
getting too deep and causing a CPU stack overflow.
[bugs:/info/2026-10-04T05:34:47Z|Bug 2026-10-04T05:34:47Z]

FossilOrigin-Name: ab621a3e11ee4accce14bf6c90a7cc273d9c25a7c3d9dd2466f2bdc2bbbf8084
2026-10-05 12:18:23 +00:00
dan
4cf3766d09 Ensure that when a value that may be stored without data loss as an integer is stored in a column with REAL affinity, the values passed to the preupdate-hook are of type SQLITE_FLOAT, not SQLITE_INTEGER. Report [bugs:/info/2026-10-04T16:18:21Z | 2026-10-04T16:18:21Z].
FossilOrigin-Name: 9f7490065e24fc69a5fc13371aeb40214d617209bb0cd9a3e23f76486d4704c0
2026-10-05 11:29:02 +00:00
dan
1ad569d147 Ensure that it is not a constraint violation if a CHECK constraint that evaluates to NULL for one or more existing rows is added to a table using ALTER TABLE. Report [bugs:/info/2026-10-05T07:36:38Z | 2026-10-05T07:36:38Z].
FossilOrigin-Name: f940c67b21b112e33bfdd54f2c3a19b06ad5bf661ddf2f85dd464fb76d115e31
2026-10-05 10:54:29 +00:00
drh
996ded6c48 Raise a "nested too deep" error if the number of cursors consumed when
resolving a CTE name exceeds SQLITE_LIMIT_EXPR_DEPTH.
[bugs:/info/2026-10-04T05:35:14Z|Bug 2026-10-04T05:35:14Z]

FossilOrigin-Name: e68aa6e1293a2c7ad37d4b9fea8e649c318f9b4c64381eefebd0413363f56da4
2026-10-05 10:41:45 +00:00
drh
e6ff280c83 Limit the depth of recursion for CTEs using SQLITE_LIMIT_EXPR_DEPTH.
[bugs:/info/2026-10-04T04:58:58Z|Bug 2026-10-04T04:58:58Z].

FossilOrigin-Name: f54730871303e655a70f3167ce1a39dcd4e53fcf017d225f429e2bb67ad96604
2026-10-05 09:32:24 +00:00
drh
d54522a5b8 Fix expression tree depth calculations for COLLATE.
[bugs:/info/2026-10-04T04:50:56Z|Bug 2026-10-04T04:50:56Z]

FossilOrigin-Name: 252c0b7bf5a727d29605672bb58e06c758173c276671df3e388a68294998b4d3
2026-10-04 21:54:17 +00:00
stephan
8364e34cbd Improve support for --with-tcl in cross-compilation environments, as discussed in [forum:fe9e99eb27c8c2ba|forum thread 2026-08-15T18:21:17Z].
FossilOrigin-Name: d4330c79a477bab7e86aba860813f4f83e9af5ef8067698fcdf41efd6a0e8516
2026-10-04 19:51:51 +00:00
stephan
e4e1b4a464 When using --with-tcl and friends during cross-compilation, emit a warning that tclConfig.sh will not be used. Addresses [forum:9771d82cd0cd7923|forum post 2026-10-04T17:25:09Z]. Normalize TCL to Tcl in nearby docs and help text because that's how tcl-lang.org types it.
FossilOrigin-Name: 41f095e34974da53170200719a069c0a30110e27a1db85f562bbe744a40e9a80
2026-10-04 19:47:43 +00:00
stephan
52a8a406eb Merge trunk into this branch.
FossilOrigin-Name: 40d58aa98ded07621a4ee1300bc164b27c33879a28932b790ecdf118b23ba6ca
2026-10-04 18:24:04 +00:00
drh
e8cbe2c96a In QRF, add the zero-pad flag to the default floating-point format in
output modes that render JSON or INSERT, so that infinities are shown
as 9e999 or similar instead of as "Inf".
[bugs:/info/2026-10-04T05:35:43Z|Bug 2026-10-04T05:35:43Z]

FossilOrigin-Name: f63139ba68bc7df770bbd3c26bcd760c479889fb45fa921e9e225e38c9e2044c
2026-10-04 16:23:01 +00:00
drh
cb0a13c7d1 Avoid truncation of a 64-bit value into 32-bits when it is the N
parameter to the geopoly_regular() function.

FossilOrigin-Name: 13d8921bcabc4a5a5295652d29982ae18cf0190299ee9e655c7e0f2b4d658de9
2026-10-04 15:41:24 +00:00
drh
47a64b8639 In the geopoly extension, any polygon with 16,777,216 or more vertexes is
considered malformed.  So the number of edges must be between 4 and and
16,777,215.
[bugs:/info/2026-10-04T04:58:23Z|Bug 2026-10-04T04:58:23Z].

FossilOrigin-Name: e8b7f75e65eff3616d3f15da758d71ac554534694ef8d86642615898907c5a79
2026-10-04 15:23:09 +00:00
stephan
5be47b15c4 Adapt wasm build for emcc's deprecation of-sMEMORY64=1 and -sWASM_BIGINT=1. Enable emcc -sASSERTIONS for fiddle at the suggestion of an emcc OOM error, as that flag makes such errors more informative.
FossilOrigin-Name: 5ca28b4ba3410d69021d4470aeb01f454b4b85e1ed6aa54a1480c53275b868e4
2026-10-04 12:10:08 +00:00
drh
390c658c6e Make no changes to the busy timeout if the argument to
"PRAGMA busy_timeout" is too large.
[bugs:/info/2026-10-04T00:05:36Z|Bug 2026-10-04T00:05:36Z].

FossilOrigin-Name: e025d8fd33828ba6d2f1192d747a444c6a61fde5dc5c00cf8b1f1506219be3fb
2026-10-04 10:49:15 +00:00
dan
ccbdec8444 Fix some formatting issues in test program vec1bench.tcl.
FossilOrigin-Name: da8069b877ab9fa545b686050c3563cc1b04f0de0c0da0de910db42c36ed2f38
2026-10-03 15:54:28 +00:00
dan
11e6caf066 Fix a test case in rbuvacuum.test that was assuming SQLite ignored trailing SQL stored in a db schema. As of [e21c5bc59a] this is not true.
FossilOrigin-Name: d47bc6e0d2fc0444612e8e43265e2a9083f1fcbc4489cabbf25e43538431fc42
2026-10-03 15:29:06 +00:00
drh
2f77d50f7e Fix test cases added by [e21c5bc59ae66173] so that they work with
in-memory configurations.

FossilOrigin-Name: 85207e5253967c2d30c67ff1f5b572ca3117b5d95ecba65affc861c4ce7ec10c
2026-10-03 10:45:03 +00:00
drh
49437882ed Enhance the sqlite3_incomplete() interface so that it returns SQLITE_EMPTY
if the input consists purely of whitespace and comments.  Fix bugs in
the continuation prompt mechanism of the CLI discovered while making this
enhancement.

FossilOrigin-Name: 086e6fb47cc29d9568495990cde467933e503ffd5ddd70073d1e6d26e445fa49
2026-10-03 09:53:15 +00:00
drh
cb547ab3e9 Update the CLI and the sqldiff utility program to use "COLLATE nocase" when
comparing table names in sqlite_schema.  Add the --unsafe flag to sqldiff
so that it can attempt to process corrupt database files.
Changes inspired by ANT-2026-YKVW6RS4.

FossilOrigin-Name: 65ec11f05a9ee5b23495427ece76c0550a8ffc28980a8a0c72d556ba0d2290e2
2026-10-02 20:18:07 +00:00
drh
61978d90eb Do not allow surplus SQL text to come after the CREATE statement in the
sqlite_schema.sql field.  Any such text is flagged as an error.  However,
the schema will still work if PRAGMA writable_schema is engaged.

FossilOrigin-Name: e21c5bc59ae6617362e085711ddb4436db5cc4ad4b740873850a4aecdb91f4f2
2026-10-02 19:56:59 +00:00
drh
ac5f698ccb Fix the "sqldiff" utility so that when using the --primarykey option on
a table that has a PRIMARY KEY with redundant columns, it does not overflow
the array of PRIMARY KEY column names.  Bug discovered by Anthropic as
ANT-2026-Y36XS4M7.

FossilOrigin-Name: 8ffd0be079e4f04d686b9842ff282bb816b422a9301bb162e0437d40f0b9f065
2026-10-02 18:47:27 +00:00
dan
cb5651e46d Fix integrity-check fails that would occur if the database contained a contentless fts4 table. Report [bugs:/info/2026-10-02T12:22:03Z | 2026-10-02T12:22:03Z].
FossilOrigin-Name: ca8de9a30484d26739a09c972c525a1ae6edcce41b0f3c612805836b894c7a26
2026-10-02 14:33:50 +00:00
dan
9696acb0c7 Change the way the session module applies changesets containing two or more UPDATE changes that form a dependency loop in order to avoid triggering ON DELETE CASCADE actions.
FossilOrigin-Name: 99aab2c99220a3814124a57653e6627aa91c24459bf4eb87e69c9ed0b3378a0c
2026-10-01 16:48:03 +00:00
drh
366a8f67a6 Merge the latest trunk enhancements into the tree-tracker branch
FossilOrigin-Name: 38d22cae438540d6de4fa5f5fe12299e17cb079024fbbf4b2ff04804e915c80a
2026-10-01 11:51:11 +00:00
dan
277113a474 Import code for vec1 into ext/vec1/.
FossilOrigin-Name: 92709f54d4c58cf174f305b58971a01878af313157a11549b588a25216701f5c
2026-10-01 11:21:02 +00:00
stephan
0caf6b532d SAHPool VFS tweaks contributed off-list by Jure Rotar: hardening against malicious inputs and I/O errors. Truncate to the shorter length when overwriting a db file with a shorter one via importDb(). Correct xOpen() to honor the combination of CREATE/EXCLUSIVE flags.
FossilOrigin-Name: 7af745868b873daacdbb57621201887f80782cef4e10ef24243a15ae88897f0d
2026-10-01 08:13:58 +00:00
stephan
58fddadb23 Remove an extraneous nearly-full-file level of indentation in ext/wasm/tester1.c-pp.js.
FossilOrigin-Name: b838769b4b115518feba1ea1f6a39f49427870cae824ec7225627565ab91de3e
2026-09-30 20:59:50 +00:00
stephan
0e69e6be99 Improve locking support in the JS kvvfs.
FossilOrigin-Name: bc5b3e391f1a40a6bfdab11548b5943150ae6d0f9fd4836c7e5fbb6b23642988
2026-09-30 19:29:13 +00:00
stephan
ca9a8adfa4 Add tests demonstrating kvvfs locking errors across multiple connections to the same storage. Add sqlite3.oo1.Stmt.resetNoThrow() for reasons described in its API docs.
FossilOrigin-Name: 0fed9bcbe2c33d8db5b3500b506bcdfa6a2c718a65bfef4f1d2d21951f6341a8
2026-09-30 19:26:14 +00:00
stephan
c15f5adadb Rework the JS kvvfs xLock(), xUnlock(), xCheckReserved(), and xSleep() analog to the recent opfs-sahpool changes to make it more robust when a given kvvfs store is accessed via multiple handles (all necessarily from the same thread). This does not break anything but also does not prove anything - tests are pending.
FossilOrigin-Name: d0e27fa55b05832dc2ad52d5bdb56e74dae2d95984e0f8f8d1831015c5fcd781
2026-09-30 18:40:09 +00:00
dan
066a18e5c8 Fix a typo in the VERTICAL_SUM_GENERIC() macro in vec1.c.
FossilOrigin-Name: b55faf3253cd5d2fc69b4e025f4707bda3600c553f85aff152cfd4e71e54c81e
2026-09-30 17:50:20 +00:00
dan
9559d8940c For msvc, __AVX2__ implies __FMA__.
FossilOrigin-Name: 2196a779fbf1a3f174a24d29e14823f09de6b743f321ccc845e8782c7987edad
2026-09-30 17:38:45 +00:00
dan
6ae81db9b8 Fix a faulty assert() that was failing when running vec1 OOM tests.
FossilOrigin-Name: aae661526953196ae078b2fe52d73f8a02ee9aa8f190b3fcdc27b23e4a344475
2026-09-30 17:07:42 +00:00
dan
23a0706663 Fix problems in vec1rollback.test preventing it from running on windows.
FossilOrigin-Name: d15cf3890230d5a870e50448c69d640fedcbd15f32788b808cb1f212399e2796
2026-09-30 16:41:58 +00:00
dan
806fd19e32 Fix definition of VEC1_META_4BYTEMIN so that it works with msvc.
FossilOrigin-Name: c9b4c9c0aaf0c314312381558ed9cf60aac800dfb4f5701d4d2e1f5268b7f081
2026-09-30 16:38:56 +00:00
stephan
519e4c23a5 [fa44643f65d6] inadvertently removed its circular-cleanup protection by fixing the finalizer ordering. This check-in fixes that. Spotted in [forum:ba4cb328a7|forum post 2026-09-30T14:59:13Z].
FossilOrigin-Name: 771faec269d786f01fc8d9155fd546d09ea6ca2eba0f0c97e34e795f64719454
2026-09-30 15:46:02 +00:00
dan
e32fbe0c23 Import vec1 sources into directory ext/vec1/ of this project.
FossilOrigin-Name: 3a0876d973868be7b6f4156a434cd09098c7ab1abdc7f0ef4f3d12a03de68b24
2026-09-30 14:49:16 +00:00
stephan
cdbfe6a938 Do not inherit the OPFS SAHPool's xSleep method from the default VFS, as doing so can cause the thread to freeze. This VFS only deals with contention originating in the same thread, so xSleep() needs to be a no-op. Addresses [forum:3f0794c5d8|bug report 2026-09-30T12:52:54Z].
FossilOrigin-Name: c9dd4d88e44a9eae4ea11d0ce5491c7ac2ac2d60a3bc83ed485812234be374da
2026-09-30 13:23:56 +00:00
stephan
f4786666d9 JS: when disposing of a C struct instance, do not unmap the 'pointer' property interceptor until after all client-added finalizers have been called.
FossilOrigin-Name: fa44643f65d6815c8c21ec25e7aa6e39a00fdc818d1d058e03123042e45884e1
2026-09-30 13:18:14 +00:00
stephan
3b28aa1ce7 Fix the OPFS SAHPool VFS's xLock/xUnlock to properly deal with multiple handles to the same underlying file within the same JS thread. Addresses [forum:5e66a600ba6e57de|bug report 2026-09-30T10:49:15Z]. Also (unrelated but code-adjacent) make sure that the VFS releases all of its internal mappings when it's paused.
FossilOrigin-Name: 9e2caaa382cee5d5df26ad3af7d727ab3f68a912e39655ffcc52f592d5a08a8d
2026-09-30 11:48:29 +00:00
drh
de4b206f8b Incremental improvements.
FossilOrigin-Name: aae085c5ac6869988e97f0d7ed2f208a900adb8b76c6f940a7a33c10a60b1085
2026-09-30 11:05:19 +00:00
stephan
737c12a04c Minor JS doc correction.
FossilOrigin-Name: 6b470917b2c9ab25d1e7fed56f19f37b5c2fc3f2a3d504a752a7bb2db14a3ee6
2026-09-30 10:36:27 +00:00
stephan
9fd5a0bc55 Correct the xCheckReserveLock() impl of the OPFS SAHPool VFS to fix a corruption case involving multiple handles in the same JS thread to the same filename when one leaves a journal behind. Addresses [forum:b2fbb61642|bug report 2026-09-29T18:25:28Z].
FossilOrigin-Name: 9168a6f1bedba87117169d096f9a6fcadaac65249d707193e4bcbc25e59ccb54
2026-09-30 09:53:09 +00:00
stephan
226a2c0d6a Generic internal JS cleanups. No functional changes. Update the preprocessor for the ability to use C-style comments in directive arguments.
FossilOrigin-Name: b2699eb9676e6f5459b8279661c264ba2c803ae133f85c703984deb7afa4fe60
2026-09-30 09:17:12 +00:00