0e6e05d4d5
Make the value of an explicit LIMIT clause on a scalar sub-query available to xBestIndex for simple "LIMIT 0" and "LIMIT 1" queries.
...
FossilOrigin-Name: 33b6a63caafccc61b3193714911cd8b5dd9b7f1798054b8c7845b23688d531f2
2025-07-03 15:32:27 +00:00
c525e6e817
Make handling of LIMIT clauses in correlated sub-queries on virtual tables more efficient.
...
FossilOrigin-Name: 7214cb2a5b35190a06a1040cd4c54f325d347f8d8e36a07fd76c0a421e266522
2025-07-03 14:28:47 +00:00
d82c6a2cf7
When attempting to optimize "expr AND false" to "false" and
...
"expr IN ()" to "false", take care not to delete aggregate functions
in the "expr" as doing so can change the meaning of the query.
See [forum:/forumpost/f4878de3e7dd4764|forum thread f4878de3e7].
FossilOrigin-Name: 77397bd67d918db57d5ac545d6d963194806fdabcdaa8f822b6b09e4cfe8b715
2025-07-01 12:43:13 +00:00
a67c71224f
Similar fix to the previous check-in, but this time for
...
sqlite3_preupdate_new().
FossilOrigin-Name: 9aaff764d508cbd9823f23cdf0c510255721bc5c09be481ebc60bd8902ceb8c5
2025-06-24 18:27:59 +00:00
66cd200ede
Range check the column index on the sqlite3_preupdate_old() interface
...
and return SQLITE_MISUSE if too large.
[forum:/forumpost/b617e497287235d0|Forum post b617e49728].
FossilOrigin-Name: 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85
2025-06-24 15:58:32 +00:00
ab9c91ae82
Extend the pedantic enforcement of type to VIRTUAL columns.
...
FossilOrigin-Name: b734c74e55acb26eb61b60937bef870f4b55b2e2e7560a22362f5f31ba2fcd03
2025-06-18 19:04:28 +00:00
bcf25e7129
Enforce judgmental typing on STORED generated columns for STRICT
...
tables. [forum:/forumpost/6caf195248a849e4|Forum post 6caf195248].
FossilOrigin-Name: 5e9279bff0482806f86657ae05ca3e916708d138bc3c3ceb3fbf454818649d44
2025-06-18 16:17:00 +00:00
79a746b1f2
Update walcksum.test so that it works with SQLITE_DEFAULT_AUTOVACUUM=1 builds.
...
FossilOrigin-Name: 0da16f6c625bff9f2ca5624afa6dce6b5a157f44c1d56b25b92946c13217ab02
2025-06-17 18:17:09 +00:00
1ea6a53762
Avoid writing frames with no checksums into the wal file if a savepoint is rolled back after dirty pages have already been spilled into the wal file. Possible fix for [forum:/forumpost/b490f726db | forum post b490f726db].
...
FossilOrigin-Name: 3a3269fe8e925a522d5df9f011220a842fb15a9f56e785884e32d2e15abda5bb
2025-06-17 11:36:39 +00:00
86d9c2d9f3
Fix an issue going back to version 3.39.0 with transitive IS constraints
...
in queries that make use of RIGHT JOIN. Problem reported by
[forum:/forumpost/68f29a2005|forum post 68f29a2005].
FossilOrigin-Name: 9441fff52cc4e19c44df1a77ffe474f409d519b270c7166ce17f99e6ea48fc1e
2025-06-16 17:36:11 +00:00
792d1d1b6d
Have sqlite3_setlk_timeout() take the database handle mutex. This fixes an assert() failure that could occur if sqlite3_setlk_timeout() were called on a threadsafe handle.
...
FossilOrigin-Name: a95d126e1330e1b83f42b51f97c4c216622cf38062f3b5d72ccb76313187e850
2025-06-12 07:35:38 +00:00
23e59b34e9
Fix the concat_ws() SQL function so that it includes empty strings in the
...
concatenation. [forum:/forumpost/52503ac21d|Forum post 52503ac21d].
FossilOrigin-Name: 80a78987da484d435a8242c05c48d546d430920df713b24a9d9d9fff7ba1113d
2025-06-11 00:01:42 +00:00
9269b212bf
Fixes to ensure SQLITE_ENABLE_SETLK_TIMEOUT builds use a blocking lock and do not call xSleep() when (a) opening a snapshot transaction, and (b) when blocked by another process running recovery.
...
FossilOrigin-Name: 7f9c0cdd0630a41db359b188b226a1ad6a3bae1663c27169acfe25edc7fb171b
2025-06-02 18:48:36 +00:00
69ce758efa
Fix os_win.c so that SQLITE_ENABLE_SETLK_TIMEOUT=2 builds work on windows.
...
FossilOrigin-Name: 8efb95e0d4670b9c5dbd8cf34512334f47951a8dff8fdadc8645f75076acd91f
2025-06-02 18:37:32 +00:00
342ef63e63
Improve the accuracy of affinity and collating sequence analysis for
...
NATURAL JOINs to the left of RIGHT JOINs where source tables are views
or subqueries. Initial problem report in
[forum:/forumpost/829306db47|forum post 829306db47].
FossilOrigin-Name: f184d1d236e47962658a4639d9533f67a525b74cfe0f06c93e9b85fdcd02a15f
2025-06-02 18:34:17 +00:00
cfee69fbe4
Updates to new test cases to run with SQLITE_ENABLE_SETLK_TIMEOUT=2 builds.
...
FossilOrigin-Name: c6d3e3542fdf6a3428d3a2ec20c699c169ed53341dc782d81f7fe5944f769748
2025-06-02 18:09:46 +00:00
eb9a145711
Merge trunk changes into this branch.
...
FossilOrigin-Name: 7d27451804e525190f8e67da75aaeb3bf2de677021f7566c6681398e60a88c72
2025-06-02 17:44:10 +00:00
f18bf8997b
Fix VACUUM so that it works even when ATTACH_WRITE is disabled.
...
FossilOrigin-Name: 42494f85acb303919d3f1f2202f8b95fbd657652da4b8dc00451c10ea6c496e0
2025-06-01 16:10:25 +00:00
c0190101d1
Enhance "box" and "column" mode formatting in the CLI to better deal with
...
double-wide characters.
FossilOrigin-Name: b0de22ed0abf2ea5d269f191c884d7b2be167a2ed27018c25aaa0ea238cd621a
2025-05-31 20:51:42 +00:00
977b0f8813
Update a few test scripts so that they run on windows.
...
FossilOrigin-Name: 14a18f4e3a3f35e636262a253364ab1e8054ed38c0c7fd482633522cbcf5ffc4
2025-05-31 19:55:07 +00:00
51e3f855b8
Fix an affinity problem caused by a USING or NATURAL JOIN on the LHS of a FULL JOIN. [forum:/forumpost/5028c785b6|Forum post 5028c785b6].
...
FossilOrigin-Name: 8d393ca07fe09f48d77adb517e2e4baaa58a9251422de62a0504999205d3ea1d
2025-05-31 18:16:21 +00:00
5248693924
Relax query flattener constraint (3b) and thereby allow flattening the RHS of
...
a LEFT JOIN even if the RHS contains a virtual table. This was previously
disallowed by [9dbae1df75219e2a] as a performance optimization. It
turns out that the constraint causes performance issues, and we do not have
a record of any performance issue that it solves.
FossilOrigin-Name: 1ddaa92057e550ea281d45d9860eafe69399224725548a93dd91c47a34e52152
2025-05-31 16:17:14 +00:00
420233e375
Fix assert() statements in os_unix.c and os_win.c. Allow walsetlk_recover.test to run in non-SQLITE_ENABLE_SNAPSHOT builds.
...
FossilOrigin-Name: 9f521ecda2b8d2f383cc84e308b3a4adfcf1bd6339eb834c8fa76c8704c861b7
2025-05-31 15:10:41 +00:00
10206572b6
tcl extension: UDFs may now 'break' to return an SQL NULL. Add the (eval -asdict) flag to use a dict, instead of an array, for the eval row data.
...
FossilOrigin-Name: 413a626b5c7902c1810142536c36e4ea8ee7c616ea82dfe1114199f9319091f7
2025-05-31 11:02:06 +00:00
d930d7ef14
Follow-up to the previous: The same optimization suppression needs to
...
happen if the left-hand side is coming from a LEFT JOIN.
FossilOrigin-Name: cf5b37b3a39013d8ca9de92da2289346caf52b56daff59e19b140cc586a3421f
2025-05-30 22:58:09 +00:00
ded1959120
If blocking locks are enabled, avoid using the busy handler when blocked by another process running recovery.
...
FossilOrigin-Name: a35236757ab57c4c9b34e47c5dbc10d8f1220f8152955f5303cf9c3902ee169b
2025-05-30 20:52:18 +00:00
dd16539e71
When synthesizing an ON constraint from a USING or NATURAL, if the left-hand
...
side is coming from a RIGHT JOIN, be sure to set the EP_CanBeNull flag so that
the optimizer knows to check for NULL even if the column has a NOT NULL
constraint. Fix for the problem reported by
[forum:/forumpost/4fc70203b61c7e12|forum post 4fc70203b61]
FossilOrigin-Name: 60adc78a22956429d34ccc4e2c193c5994c11c3b3cff7901d47fad7d92dba935
2025-05-30 19:55:46 +00:00
88ed38ca6d
Avoid invoking the busy-handler if a blocking lock times out while attempting to open a snapshot transaction.
...
FossilOrigin-Name: fe11f85fd3283bb7002f43bd8b796e9e7b67f6d1a92eb676be06b46d1458fc1d
2025-05-30 18:23:03 +00:00
f429845a60
Extend the fix for ticket [623eff57e76d45f6] so that it covers RIGHT JOIN
...
in addition to LEFT JOIN. Problem reported by
[forum:/forumpost/7dee41d32506c4ae|forum post 2025-05-29T15:10:14Z].
FossilOrigin-Name: 29b1e1b97619d03a97ef562a5707929e241d019179b4ff1d0bc2a8c008441431
2025-05-29 18:44:41 +00:00
f96d44e5de
Fix a bug in the speedtest.tcl testing script that was introduced by
...
[7e9845433ff26bdc]
FossilOrigin-Name: e4ffa86aa6ca82a42933281f6cbfca7bad702797eb8d6e684a1992e68dc1cfb7
2025-05-26 17:29:13 +00:00
93394ebc27
On OpenBSD, do not test fuzzcheck with ubsan as part of "make devtest".
...
FossilOrigin-Name: a3dabd599c3d3143b67258b307d352968e5f5d4ea0456940d16ae678de8c95eb
2025-05-26 16:17:06 +00:00
a01b7adb13
Change json_group_object() so that it ignores entries where the label
...
is NULL. [forum:/forumpost/e5bd251fb5|Forum post e5bd251fb5].
FossilOrigin-Name: 28215d131cd970a2756338579fb6b6091ab155be8f419505cae8ac918956165c
2025-05-24 20:20:20 +00:00
c1ea1a6d4d
Add the --osmalloc option to the test/speedtest.tcl testing script.
...
Adjust ./configure so that it does not check for malloc_usable_size().
FossilOrigin-Name: 7e9845433ff26bdc5fe8654281d584394b77e3b206d09669b4468e0271c6eb37
2025-05-23 14:52:23 +00:00
186fd30436
Adjust the strftime() test in test/date4.test to remove flags not supported in musl libc if that environment is detected.
...
FossilOrigin-Name: fc254c1eb784c79a371bf961945a18a680982cdcd3fdcd7e6bb481712fe21cf8
2025-05-13 18:58:56 +00:00
f67058367b
Add test cases for the NOT NULL/IS NULL optimization in CHECK constraints fix.
...
FossilOrigin-Name: 6eb2939a6093c0796910645172d80c53055559dd57c012f1dc815d89fbf84447
2025-05-06 17:56:32 +00:00
88ed1806a4
Fix an issue in Bloom filters on RHS subsqueries to IN operators.
...
See [forum:/forumpost/792a09cb3df9e69f|forum post 792a09cb3d] for
a description of the problem. Also improve comments related
to [baa83b460c677c21] which was origin of the problem.
FossilOrigin-Name: cdef486e212fe4b26605065d9cff08f608cb80df48ee64e4be63637769bdfacc
2025-04-30 12:48:20 +00:00
2ba946b341
Add the "--fuzzdb FILENAME" to testrunner.tcl as an alternative to setting
...
the FUZZDB environment variable (as that can be awkward to do on Windows).
Further improvements to the testrunner.tcl documentation.
FossilOrigin-Name: 6fb84156a262ff89d1a2d1df6fbfac4c1a43fb55b9d15205508662e2c9b0894f
2025-04-29 14:23:21 +00:00
873fc5dff2
Update testrunner.tcl documentation. Fix typo in testrunner.tcl output.
...
FossilOrigin-Name: ba8800b4ba0a690c89d9fb96bb9a0d8789d04160ff9c47ea9afb2b403bec7f0b
2025-04-29 11:35:51 +00:00
c171d7624e
Improved --explain display of FUZZDB test plans in testrunner.tcl.
...
FossilOrigin-Name: 42bdd7262ec4f8163263e0535c2cc35b526754d77e1f3ccf5b73b0f44d470d9c
2025-04-29 10:41:16 +00:00
ece7709f18
Do not run FUZZDB on either Windows-Memdebug or Windows-Win32Heap.
...
FossilOrigin-Name: 10d8401d59136dda7051af0da398b06a18031560f2734f4fa347d339765d2089
2025-04-29 10:29:35 +00:00
8a68ab963e
Make testrunner.tcl more restrictive about which configurations run
...
fuzzcheck-asan and fuzzcheck-ubsan.
FossilOrigin-Name: 785599394dde0fb36ae2e07d611f9523a05a0817dbd8c416582b3b682dbfa4ff
2025-04-29 01:37:31 +00:00
246dc92354
Testrunner.tcl now runs fuzzcheck-asan and fuzzcheck-ubsan tests.
...
FossilOrigin-Name: 3d8f3a255843c063157265702b76d40c38c774d29d658eea2d77efac92ac8789
2025-04-28 19:15:46 +00:00
d4cc3a42e2
If the FUZZDB environment variable is set when running testrunner.tcl and
...
that env-var points to a fuzzcheck database, then suppliment the fuzzcheck
tests with that extra database.
FossilOrigin-Name: c08530dd6a71cb547d164e2313657c917f280e7988211bf199c8776e78a4e2a6
2025-04-28 17:56:23 +00:00
1365bcffbf
Enhance testrunner.tcl so that it does not build testfixture unnecessarily -
...
if the pattern does not match any TCL test.
FossilOrigin-Name: 896d767f1cba64bda7b91b0daebd60ebe4457a58d762da443bf61cf5b39ad2d9
2025-04-28 16:28:00 +00:00
7fec7c96c4
Fix testrunner.tcl so that it honors pattern matches in non-testfixture
...
tests, such as fuzzcheck and sessionfuzz.
FossilOrigin-Name: 81857474fe90f50b760c22d61a6ad477642dabe1052390cd1614dcec8adb1376
2025-04-28 16:17:17 +00:00
738443c523
Remove a stray blank line from the test/testrunner.tcl script.
...
FossilOrigin-Name: 7d6005b0d17d86d72757f3578872e82fd12f61ac9160a0277e397df09f6338a9
2025-04-28 15:00:28 +00:00
0243ca8245
Correctly handle the case of a multi-column UNIQUE constraint that contains
...
the ROWID as one of it columns, and then the columns of that UNIQUE are
used in a row-value IN operator as a WHERE clause constraint. Reported by
[forum:/forumpost/b9647a113b465950|forum post b9647a113b]. Problem
introduced by [723f1be3d4a905a6], part of ticket [da78413751863].
FossilOrigin-Name: d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
2025-04-15 21:59:38 +00:00
483e1181c5
Improved estimate on the number of output rows in a recursive common table expression
...
that uses the UNION operator. Follow-up to [f911f1c4977fbcae] and it's output row
estimate changes associated with DISTINCT queries.
FossilOrigin-Name: 92513f6bce7ecc778e78af3a77bc66ff65585fffa2e3138f8acb9e617121eeb0
2025-04-14 19:43:30 +00:00
a863bafba7
Improved detection of run-time errors (ex: OOM errors) in speedtest1.
...
FossilOrigin-Name: 0e5e0e2f558a417d57c01a2d62cb2117d2adf6ddbc62e6a0208ae23f19b05347
2025-04-10 19:54:56 +00:00
f95e964b6b
Provide new command-line options --hard-heap-limit and --soft-heap-limit
...
for speedtest1.
FossilOrigin-Name: 578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7
2025-04-10 19:39:34 +00:00