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

32750 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
a6f89b9d0b Add an extra sqlite3MemoryBarrier() call in sqlite3_initialize() to avoid
a race condition that only happens on non-X64 CPUs.
[bugs:/info/2026-10-20T07:33:27Z|Bug 2026-10-20T07:33:27Z]

FossilOrigin-Name: 37b83ad2f5245217a4a4626916c3974acb3491fc5d45ed082ac0386e9d84b4ce
2026-10-20 12:42:26 +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
5484850c7a Minor fix to ALTER TABLE RENAME COLUMN so that it works on TEMP tables.
[bugs:/info/2026-10-19T01:55:31Z|Bug 2026-10-19T01:55:31Z]

FossilOrigin-Name: 6d998905f8210f3e627e30fef2293afbd22bdcd39432d4388ecedbf927dc87dc
2026-10-20 09:24:08 +00:00
drh
1f3577bc0c Remove an ALWAYS() that can sometimes be true when using
sqlite3_collation_needed() and dropping collations.
[bugs:/info/2026-10-18T18:09:53Z|Bug 2026-10-18T18:09:53Z]

FossilOrigin-Name: 8717ff8d73bd5822b3306e999783b41eb1d74d2bc120641b2beadc98cf61de1f
2026-10-20 09:00:48 +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
17f128f746 Fix an adverse interaction between triggers changing a table that uses
ON DELETE SET NULL constraints and the optimization at [8c5dd6cc259e0cda],
almost 12 years ago.
[bugs:/info/2026-10-19T06:36:47Z|Bug 2026-10-19T06:36:47Z].

FossilOrigin-Name: 15424da529e827f3eca7d70b1c54b57f2e9e05ed866a872ea45fa538e8b72825
2026-10-20 00:14:02 +00:00
drh
a0a07447d4 Fix a harmless compiler warning in lemon.c. No changes to the core SQLite.
FossilOrigin-Name: fd341a1952ded314e3b3d129c14552318246c0f187c63bea82a0f7bf8aec6759
2026-10-19 23:49:15 +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
stephan
f6ba5a5abf Correct two bugs, dating back to [96ba44946b|2022-12-23], which caused the JS wrappers of sqlite3_bind_text/blob() to severely misbehave. Add missing tests. [bugs:bbb715c3f2a0e989|Bug report 2026-10-19T19:03:55Z].
FossilOrigin-Name: d45943cbaf35f21f72b78aafa88f72830343bfeb3a0198a3af0da063dcf6a707
2026-10-19 21:07:18 +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
cc04298893 Fix a problem in ALTER TABLE DROP COLUMN that could result in a stale
index.  [bugs:/info/2026-10-19T06:36:17Z|Bug 2026-10-19T06:36:17Z]

FossilOrigin-Name: 4ea5d16c2159738614e135377120b604f89ff1cdf0bfe60ea3cc41073680c8f1
2026-10-19 19:40:21 +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
dan
6a63c4070b Fix a problem in the sessions rebaser occuring when a DELETE/REPLACE rebase record is followed by another rebase record on the same row. Report [bugs:/info/2026-10-18T05:00:41Z | 2026-10-18T05:00:41Z].
FossilOrigin-Name: c2d299124211d8780bc0beab8217fc53da8aadca0c3abce0fedbe84506ef412a
2026-10-19 18:57:35 +00:00
stephan
c01201027e Wasm build: move wasm-strip to after wasm-opt, at recommendation from an Emscripten ticket. Remove several more uses of -sWASM_BIGINT=1, as described for [cc9457981e2a].
FossilOrigin-Name: c2fc091401aa8c75db5f0c98486d9ee1e54fb6c96ec2dc04eecca41aa26990a1
2026-10-19 18:33:02 +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
aa037e12be Correct the handling of SQLITE_IGNORE returns from authorizer calls
for UPDATE on the rowid or INTEGER PRIMARY KEY.  See the test cases
in TH3 for details.

FossilOrigin-Name: 606005419f60bd14eec71ee87a770051c8c551273c9a7567d830283eeb1058e8
2026-10-19 18:20:03 +00:00
stephan
16327cc106 JS: resolve a [https://github.com/emscripten-core/emscripten/issues/28016|build regression] triggered by Emscripten 6.0.5+. Remove the -sWASM_BIGINT flag from the build because (A) it's been Emscripten's default for a long time and (B) Emscripten now warns loudly if it's used. Remove a stray build flag from fiddle, inadvertently introduced in [c32cf3e355], which caused it to build in 64-bit mode.
FossilOrigin-Name: cc9457981e2a63d271525b1d891a63dd28b1c2da04777228e27132d7cc743cfa
2026-10-19 18:05:25 +00:00
dan
18a23191bf Avoid crashing if an RBU vacuum is attempted with a VFS that does not support RBU. Report [bugs:/info/2026-10-19T12:21:34Z | 2026-10-19T12:21:34Z].
FossilOrigin-Name: 5024b528dcf419393086d89eff50aa1b52116bb05b6e07849555f76891bc68a0
2026-10-19 17:44:46 +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
ee16b84fb6 In the CLI, do not read the ~/.sqliterc file or an alternative specified by
the --init command-line option if the --safe option is used.
[bugs:/info/2026-10-19T12:32:27Z|Bug 2026-10-19T12:32:27Z]

FossilOrigin-Name: f1e94b6042f056f103eaf4ac11004fc2f559499ccf2b93eae0c9283150a6e921
2026-10-19 16:25:28 +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
stephan
55b6ae8606 Apply [5080eb6d7a7a] to a similar case in the JS test suite.
FossilOrigin-Name: 336154a23a2a98df12a2a5e6ef51221acccef4063936cbb48cbb77a24cf1bd26
2026-10-19 15:06:38 +00:00
stephan
d37e0daad3 JS: reject URL arguments which may influence the load path for sqlite3.js and sqlite3.wasm if those values look like they might be remote URLs. sqlite3.mjs (ESM) is unaffected by this. This addresses [bugs:74f052d3d2|bug report 2026-10-19T12:25:33Z] but is a preliminary measure, with follow-ups expected.
FossilOrigin-Name: 5080eb6d7a7a7a5c2cdfd08a766f0e096d0d5536488fcf0b325e7b06a6bdd092
2026-10-19 14:50:22 +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
dan
b7defd99b3 Fix a vec1 problem with querying a table within the same transaction as writing it in some configurations.
FossilOrigin-Name: e2af533c281989c751fa4a15e8a5ebafa9cad5efadfd37a2407c89e397b3ddf2
2026-10-19 11:06:06 +00:00
dan
cc758d2fba Fix a vec1 problem with issuing a 'rebuild' command within a transaction that has already written to the table. Report [bugs:/info/2026-10-18T20:40:18Z | 2026-10-18T20:40:18Z].
FossilOrigin-Name: 2448fc46cae2149c5d1777b9fe574a48e21d5e16dd64997d2343bb6e160840e3
2026-10-19 08:05:27 +00:00
dan
948ad6e798 Fix a vec1 problem with deleting rows that share rowids with tombstone values within transactions. Report [bugs:/info/2026-10-18T20:41:06Z | 2026-10-18T20:41:06Z].
FossilOrigin-Name: b8fc7a1398c7aaf2359c311d46a55aeea213d60889826119d1ddef2364387ea0
2026-10-19 05:43:09 +00:00
drh
58626f682a Merge branch-3.54 fixes into trunk
FossilOrigin-Name: d987e46422d32a0ec7870dcc6d9f0e5767dff57a6004ece527964f1dd840cb11
2026-10-18 23:51:22 +00:00
drh
58f8fe5547 Do not run the OR optimization on the left operand of a LEFT JOIN.
[bugs:/info/2026-10-18T16:10:55Z|Bug 2026-10-18T16:10:55Z].

FossilOrigin-Name: b4974127526b290149447849bf9c24c9ea01678755a58af3843c9e2c73c417d2
2026-10-18 23:45:59 +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
623bc0b1d5 Fix harmless compiler warnings.
FossilOrigin-Name: a68c9f3e98a7be2e7ac020fcbdf3b39cd9015e1d2fa07d30619c47a05cf7aab4
2026-10-18 21:36:55 +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
c006236c19 Remove a NEVER() that can in fact be true. A test case to demonstrate
has been separately added to TH3.

FossilOrigin-Name: 70bb130523a69e2babb08d4538c73772fd354f2df76193f75d8d8ff8b7299e76
2026-10-18 16:04:03 +00:00
dan
3baca233c5 Ensure that vec1 normalizes vectors before, not after, applying the WHT transform. Report [bugs:/info/2026-10-18T10:46:11Z | 2026-10-18T10:46:11Z].
FossilOrigin-Name: b5a53fbedeb127393b2096073ebccfe71136705851598a3d9e4c2b632c10001c
2026-10-18 13:54:43 +00:00
stephan
352e01f2fc Correct a var name typo in the session extension. [forum:527f85c78d|Bug report 2026-10-18T10:40:12Z].
FossilOrigin-Name: 9826ef1c52fcae73dd0550982e9eda27a4ca43460ded890f9873c61d5d8020d3
2026-10-18 10:43:06 +00:00
stephan
c8e019ec97 Minor doc-only updates to ext/wasm/README.md and GNUmakefile.
FossilOrigin-Name: 7f6793fe94636e83b851919878d52201002dd9d28ac33f9e9c90d4f7cb1feacf
2026-10-18 10:39:36 +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
dan
43a48f7758 Fix uses of C99 and other minor issues in ext/vec1/vec1.c. Report [bugs:/info/2026-10-17T09:17:48Z | 2026-10-17T09:17:48Z].
FossilOrigin-Name: 8fd4b73592063f9192f3ea1bd363e0e0659844797b597152831e42e4459ab7ce
2026-10-17 18:25:47 +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
06a948cadd Enhance ".expert" in the CLI so that when it is generating unique index
names, the probability of being unable to create a unique names becomes
vanishingly small, essentially zero.  And even if that does happen,
be sure to free the last candidate name before returning an error.
[bugs:/info/2026-10-17T09:25:38Z|Bug 2026-10-17T09:25:38Z]

FossilOrigin-Name: d43611f653bad426df8dc4ac12d0fff1662245b0715f7e66a023bd1dd129faea
2026-10-17 11:34:38 +00:00