drh
1ba44fc5e0
Fix problems with expressions like "(?,?,?) IN (SELECT c,b,a FROM ...)" when there is an index on columns "c", "b" and "a", but not in that order.
...
FossilOrigin-Name: af0bf4ee7778359d96b43605d947b44bbcef9f489732d0890103992cd970c3b5
2026-06-04 11:24:28 +00:00
drh
1e1679194e
Remove all references to GetNativeSystemInfo() on Windows, which is
...
[forum:/info/f01dc61c5febbe19|reportedly] not available when compiling
with MinGW.
FossilOrigin-Name: 06fcd92e667488b5f7e0f75cbe4c9b59a71713332c4574e348f09fe78c6de7a2
2026-06-04 10:28:26 +00:00
drh
5e132e142f
Fix harmless compiler warning.
...
FossilOrigin-Name: ac00a18dcf132180295d41299f31fbc68087a27b61782d00b9633dd9661ded2b
2026-06-03 18:51:23 +00:00
drh
c867ce4b89
Use tail recursion on the larger of the two partitions when doing a
...
quicksort as part of the implementation of the median() function,
to avoid excess stack usage on pathological inputs.
FossilOrigin-Name: b8fce837cf633af7e489e9750bcd1764e96f9ad7ea01847d5ef9c7060f01a4bf
2026-06-03 16:23:45 +00:00
drh
0851e6a4fe
Remove a NEVER() that is actually reachable. This same NEVER() was removed
...
from trunk at check-in [0de3d95500b7ecd4].
FossilOrigin-Name: 46e74947f155199f5ce2440e8d5f19849d0daeb1d9d47381b0f84388901eab4c
2026-06-02 13:44:21 +00:00
drh
b2543d0098
Disable transitive WHERE constraints when there are explicit COLLATE
...
operators.
FossilOrigin-Name: 4c0455efe57d1e3c27327e942a1509de3eb7b0902bc3b90473e2cba8df90139b
2026-06-01 18:07:44 +00:00
drh
4902f35e63
For expressions of the form "(x, y...) IN (SELECT a, b ...)" where the
...
result is not true, consider the collation sequences of columns "a" and "b"
when determinining if the result should be false or NULL.
FossilOrigin-Name: 5ceba3fe8d9fb2b1e44a048b6e010d427b7f464b727b58824a2af1b53d57f1ec
2026-06-01 16:38:10 +00:00
drh
193a8f3673
Do not allow the argument to a table-valued function to reference a table
...
to its right, even if the SELECT is inside a common table expression.
FossilOrigin-Name: 27b4f821c752a65197746952cc168fab6a3aa0039d1a0100e3d8415225b5d4bf
2026-06-01 13:48:25 +00:00
drh
c3a422d794
Fix the format() SQL function so that it reports TOOBIG and NOMEM errors.
...
Fix a possible integer overflow on %#Q formatting.
FossilOrigin-Name: cd0c6953cdc3b2952070d4150da9c773da193d6710f41455a5c9832cd944831a
2026-05-31 09:23:09 +00:00
drh
c22fe7a31c
Be sure to do floating-point to text conversions in JSON to the full
...
17-digits.
FossilOrigin-Name: 9498dade8754909d6fadc8cdff44dafc7770d53a1984ba27a00317ecd7e2f3dd
2026-05-29 23:17:09 +00:00
drh
a15c394233
Fix potential integer overflow in btree overflow page cache computation.
...
FossilOrigin-Name: 093e23814e35f0cd0a4bded29b79ddecd7835626d9fe627bfbf4eb138403277f
2026-05-28 10:18:42 +00:00
drh
2e6dc01ea7
Enhance the defenses against malformed JSONB in the jsonbPayloadSize()
...
routine.
FossilOrigin-Name: 73dfb252f86807464642037df6ec7353b5b52d8c447837c7c4a6540ec622f29d
2026-05-25 18:53:35 +00:00
drh
bf5c8d7d16
Fix a potential 1 byte overwrite that could occur when processing
...
a carefully crafted super-journal file.
FossilOrigin-Name: f654fa5ac938bb61d917fc33298052f5bd7a6e5e33b0539ac15cbd45bec023d3
2026-05-25 18:50:36 +00:00
drh
9bb1173b4f
Fix the VFSes so that there is no 32-bit integer overflow in the
...
xShmMap method if the WAL file size exceeds about 25 terabytes, or
if the header is corrupted to make SQLite think that the WAL file size
is that big.
FossilOrigin-Name: 39a72dbe53c94be6784fa042cf093151eff43d67086449a4da975416adde120a
2026-05-21 15:27:55 +00:00
drh
22bce652b3
A join constraint is not an equivalence unless both operands have the
...
same collation.
FossilOrigin-Name: 4247f48eec004c311cb046b1e97fbd44bc35d4b09e33c2b930dd3e1baabdb813
2026-05-21 13:06:04 +00:00
drh
0d56a90b3d
Early detection of attempts to overwrite an in-use cache page due
...
to database corruption.
FossilOrigin-Name: c37b0d93bf750ddad0b271c5f133320f754e5af73c0b68a3d19f9276e196d667
2026-05-19 15:24:00 +00:00
drh
1cddaab5f9
When a subquery is an argument to an SQLITE_SUBTYPE function, then set
...
the EP_SubtArg flag on the result-set expressions of that subquery.
FossilOrigin-Name: d496e9320393d3c249a30499bd5c7278c9282a77416b5bbef3da175714d9284c
2026-05-18 19:46:38 +00:00
drh
a66d74e1de
Fix the window-function variant of the json_group_object() function so
...
that it correctly handles NULL entries.
FossilOrigin-Name: d29d9512a72972778c374524a3cd5d52a1377bf7fb7ff34028135146d75909b8
2026-05-18 17:58:30 +00:00
drh
574d888a10
Do not attempt the OR-optimization on conjuncts that contain COLLATE
...
operators.
FossilOrigin-Name: 4c105d79010939bdb8cb0461c3926f80815d4f0213bc0206be76015218cb8125
2026-05-18 14:32:45 +00:00
drh
a523e20bba
Correction to the bugfix at [212c68249cc0e890] so that it works
...
for 2nd and subsequent terms of a row value.
FossilOrigin-Name: 49c9b80e52642b94f1fa0b50ecd33a96b98a8c28d1175ac2c490d22e8c1433ce
2026-05-18 12:12:06 +00:00
drh
3580d166e5
When two tables are joined by USING, the affinity and collating sequence of
...
the join column will be the same as one or the other of the columns in the
two tables (which are hopefully the same).
FossilOrigin-Name: 8096d548eb035afc94653303000cff2f63a4c996c1dd9bf6114c4299376088fc
2026-05-16 20:29:03 +00:00
drh
1e4ec59e3f
Fix false-negatives in the sqlite3ExprCanReturnSubtype() routine having
...
to do with CASE, CAST, and COLLATE expressions and the "+" no-op operator.
FossilOrigin-Name: 8eb07e92cfecb6f369206f71b42edad81d7eced0ca5576a13fd754eb7db16e55
2026-05-16 17:34:27 +00:00
drh
af24f5e21e
Have window functions sum(), total() and avg() correctly handle the obscure case where integer overflow occurs as part of the same step that adds the first real value to the running total. Fix for forum post [forum:ec538b04ce | ec538b04ce].
...
FossilOrigin-Name: eb95d18aee8ffb9a2550aadbecccaf43c0a5778973386da1196a46f645e04286
2026-05-16 17:09:12 +00:00
drh
7678510ff2
Have the sqlite_dbpage module correctly handle constraints of the form "WHERE pgno=$pgno" when $pgno is an integer that cannot be represented as a signed, 32-bit value.
...
FossilOrigin-Name: b6ce57f807297966f305d257e616f1c88a2f25c29f622249194b19d6fa014580
2026-05-16 16:08:03 +00:00
drh
066b667313
Prevent internal-use-only SQL functions from being used inside of a CHECK
...
constraint added using ALTER TABLE ADD CONSTRAINT.
FossilOrigin-Name: 6cb565fe20049a48619fa3c7995de30fd9e284cfacd1652465e1f9083daf2669
2026-05-11 14:47:45 +00:00
drh
a5ce91b319
Fix upward propagation of expression properties into row-value expressions.
...
FossilOrigin-Name: 5e639b7f15c1de773a83eccfeea67122616a62105299af41dd7c2df2ea74102c
2026-05-09 13:57:11 +00:00
drh
55f2cf294f
When using the OR-optimization on a loop created by exists-to-join,
...
do the early-exit logic for the whole loop, not for each individual
OR branch.
FossilOrigin-Name: b827cdcb371d07cd4ffba4d3c7b404bece43fcc808db528b94a66bf77b6aab4f
2026-05-04 18:30:02 +00:00
drh
10305aa4a4
Fix a harmless compiler warning.
...
FossilOrigin-Name: 9957c3b907d66ed1b8afa3b71ba0ad23b2de3ec486e6232b58166fd3a410705a
2026-05-02 13:18:40 +00:00
drh
e64e95b437
Fix a crash that could occur if sqlite3_deserialize() was used to overwrite a database with an open transaction on it. Bug introduced by [fc42d31d6fca21ab] on 2018-03-07 and first released in version 3.23.0. This is not a vulnerability as an attacker that can exploit this already has the ability to execute arbitrary code. Forum post [forum:39134ba029 | 39134ba029].
...
FossilOrigin-Name: b7b0745d6def6b141c900884cd97f10f3afedcbfb4bd9ce2409ee2380a8602dd
2026-04-27 12:28:23 +00:00
drh
27e808ff2c
Feature detection fix for uint128 on RISCV 32-bit.
...
FossilOrigin-Name: e3f318bf52932460890333c6dcae352ab4b0c943d7be67734649eff1ff9fc9fc
2026-04-27 12:25:36 +00:00
stephan
0e4b46a649
Increase a stack-local buffer size to resolve a test regression introduced in [ff084ae341eab5c], in which some tests fail a pattern match check if their absolute file names are too long. Resolves [forum:205f73db1b2806f5|forum post 205f73db1b2806f5].
...
FossilOrigin-Name: 4eeb1f74f61589f115810bd2a6876dcec9e674a2baf686f3b5b25678695aa797
2026-04-27 12:07:31 +00:00
drh
928890f18f
Various minor bug fixes cherrypicked from trunk.
...
FossilOrigin-Name: f1276db5dabe797dfeee2afbb9f3a3fe367b5f860a07af88963f16aa3986f7b9
2026-04-21 22:55:44 +00:00
drh
7b3ed290d3
Fix another bug in EXISTS-to-JOIN - this one
...
having to do with an OFFSET clause of a LIMIT.
FossilOrigin-Name: f91099ecee5413b3ab7261461e774436f5a9214101eea10d234135abe70bb444
2026-04-21 13:06:15 +00:00
drh
f9c7f9fb52
Fix parsing of options to the .once command.
...
FossilOrigin-Name: fd21b079e9ded037f9ec65f04864684060b8b80d034dfc9b07e01b5a1f75d79a
2026-04-17 01:55:29 +00:00
dan
4c6c2ed134
Handle the case where the name of the constraint in an "ALTER TABLE DROP CONSTRAINT" command is quoted. [forum:8bfbaec404 | Forum post 8bfbaec404].
...
FossilOrigin-Name: 2d37af77a139cdcecb959b0821e5ed925f12789a759d0c94dce29d4b30b5750a
2026-04-15 16:22:59 +00:00
drh
df330b6f92
Bug fix in sqlite3_str_free(): Do not crash if called on an sqlite3_str
...
object returned from sqlite3_str_new() following an OOM.
FossilOrigin-Name: b6b1d069cd5528b79ab0412137971fca1963a500f99e5c53ae57de1dd90066d2
2026-04-15 14:22:35 +00:00
stephan
ef152ec09f
Fix a typo which caused .headers to not show up in the shell's .help.
...
FossilOrigin-Name: 9efc1b6497ac5a4d0aef8fa73cdb016160720b076183c3727edc3de438e094e6
2026-04-12 05:43:12 +00:00
drh
1bb371e6d3
Use sqlite3_malloc() for memory allocation inside of sqlite3_str_vappendf(),
...
since it invokes sqlite3_initialize(), whereas sqlite3DbMallocRaw() does
not.
FossilOrigin-Name: d959559d1fc34381861085ed8ac97b7ce72a4a83c6f846a6abd1e4552db081b4
2026-04-10 17:16:46 +00:00
drh
916f74e485
Fix the printf() optimization added on 2026-03-29 so that
...
sqlite3_snprintf() does not incorrectly truncate floating-point
conversions.
FossilOrigin-Name: 7c6883ecd3b284f38bfa93b03653fb48eaa42f223ae7ab12e1ad03082f3db44b
2026-04-10 16:06:09 +00:00
stephan
282e2cea0a
Correct shell result code propagation regression introduced in [ff084ae341eab5c4] and reported in [forum:6fa3247e9724844c|forum post 6fa3247e9724844c].
...
FossilOrigin-Name: 5306da4231efcaf1bd7afa3cdcfcb87edf70958e3dd2edaed765a0d844e3be03
2026-04-10 08:39:51 +00:00
drh
a7200804eb
Fix a buffer overflow bug in a recent check-in, reported by unsolicted
...
email from OpenAI/Codex.
FossilOrigin-Name: be891a137af15897691250324e4d3d9c96f0c5fb414bca27d0c3bfdd3012a8a2
2026-04-08 17:00:33 +00:00
stephan
0d979c217f
Fix a few doc typos and inconsistencies. No code changes.
...
FossilOrigin-Name: 025abd4cf409fb9938e116289f23dc5bcd6d14feb46066221e691b146ee9b354
2026-04-07 15:54:35 +00:00
drh
e9af8caac0
Fix incorrect datatype on the auto_ext_leak_tester() function in the CLI.
...
FossilOrigin-Name: 4a36454904e1c5e7d25406713ab0125f11df66eabe0d378edcb837ef8dedc981
2026-04-07 12:51:52 +00:00
stephan
fcef193a82
Add a dummy auto-extension to the shell in SQLITE_DEBUG builds to validate that [9d56df17b4ab49] does the right thing.
...
FossilOrigin-Name: 164af3703b8fb5d88612edcceeaae0ae5a230c34c7a0f2ac9b650f5a742b2787
2026-04-06 22:00:20 +00:00
stephan
8e7ffc09f5
Add a call to sqlite3_reset_auto_extension() near the end of shell.c.in:main() to squelch a leak message when SQLITE_EXTRA_INIT adds auto-extensions, as reported in [forum:310cb231b07c80d1|forum post 310cb231b07c80d1].
...
FossilOrigin-Name: c4dd7e8b36deced3ee9cc6b5f87d8b3cc9a752cad8d62c9b711c7b58db11834b
2026-04-06 20:24:02 +00:00
drh
9ad63c0f4e
Appease static analyzers by masking the index to the
...
WalHashLoc.aPgno array to make it easy to prove that there
is never OOB read or write.
FossilOrigin-Name: 9d56df17b4ab4940f7bc24488a9df118f6172fcfbf3e5cb95bdcbd2db2a07911
2026-04-04 14:43:37 +00:00
drh
60b829e0db
Turn an incorrect assert() into a testcase(). Fix over-length code lines
...
in the sqlite.h.in source file. Fix the documentation on OOM conditions
in the sqlite3_value_text() family of APIs.
FossilOrigin-Name: 934582706109d2ebda26952c7c95f7a5095fa47ec837570a66c991866f7d08cf
2026-03-31 10:32:23 +00:00
drh
b060cecb2e
Remove an unused variable in sqlite3Reindex(). Minor enhancements to the
...
header comment on sqlite3AtoF().
FossilOrigin-Name: fbba900728d444f6a0b428197ebb41fe039b235e18caa2243c9f8f04fce42595
2026-03-30 10:00:48 +00:00
drh
0cb576f306
Fix harmless compiler warnings about unused variable assignments.
...
FossilOrigin-Name: afe7e9fd1c476c7cdcefab0adf0191a8dc3283811f72a685fff3eb6539b72dcc
2026-03-29 22:41:12 +00:00
drh
6d27844bbe
Merge trunk performance enhancements and fixes into the direct-printf branch.
...
FossilOrigin-Name: 9fa9cd11f8f5f7591168870c6e41121221b58a4a3094e708e3fa5bab1502f190
2026-03-29 19:23:47 +00:00