10036 Commits

Author SHA1 Message Date
drh
1f9ae1f780 Immediately reset all pending prepared statements on any call to
sqlite3_set_authorizer(), even if the authorizer is being disabled.

FossilOrigin-Name: 5c0468acd1a12f7fd01b9974250fb42c5811939dc2319729a1ef93c073dc0071
2026-02-09 19:58:04 +00:00
dan
612bee531f Do not allow table-function argument expressions on the RHS of an OUTER join to refer to FROM clause elements to their right.
FossilOrigin-Name: 021e48e28931afd781e76db6293e60fd2ffb8377cb1051e8b802f2743a10fa5d
2026-02-09 14:45:17 +00:00
drh
450a90097f Do a better job of not generating unnecessary Bloom filters associated
with IN operators.

FossilOrigin-Name: 3861df5c127f82becea80c48c547de8ed0d01eebcf6a6a9d7f234dde31f50394
2026-02-05 21:14:34 +00:00
drh
761118497a Improve the query planner by reducing the estimated number of output rows
for each stage of a join if there are LIKE, GLOB, REGEXP, or MATCH
constraints on the table where the pattern string is a constant.  The
reduction in the output row estimate is proportional to the length of
the pattern string.

FossilOrigin-Name: 6852843e6aa23051de0884593ce64b96a16f16c4d63b222bd324297581f7cf75
2026-02-03 17:21:59 +00:00
drh
e54142009c Minor change to test/dotcmd01.test so that it works with STAT4.
FossilOrigin-Name: 8aaf5b6b6c3d71789eebd2b8f440dd2fdaad2ef2adc9c7b2b019f08853d0b195
2026-02-03 17:07:28 +00:00
drh
77c5456d7f Do not reduce the estimated truth probability of LIKE and GLOB operators
by quite so much.  Fix a single test case whose output changed.

FossilOrigin-Name: fdebbedbd9a99165359761106cdc76d327f74043b22806b7bd96402fbed36f14
2026-02-02 16:03:24 +00:00
drh
213262fa53 Enhance the ".timer" command in the CLI to accept the "once" argument, and
so that it leaves its last real-time result in the $TIMER variable.  Also
fix a harmless warning from an earlier check-in.

FossilOrigin-Name: 8ad7dffc261cbb3f7c9b4d38b04282c805c1c047fb431076f85e577c81f21574
2026-02-01 15:58:37 +00:00
drh
1d8eb1d9b6 Fix a missed optimization opportunity due to a typo in check-in [898bfa1afd8260ea].
Reported by [forum:/forumpost/2026-01-31T00:49:53z|forum post 2026-01-31T00:49:53z].

FossilOrigin-Name: 3a4f9a323da90611d7eda51b90cb058175ddde0a128e1ff00ce58cc83af0f376
2026-01-31 02:17:55 +00:00
drh
4fd4e8f066 Make CROSS JOIN a join reorder barrier again, as the SQLite documentation says it is. It
mistakenly stopped being a join barrier with check-in [c1ea064948ba08c4].

FossilOrigin-Name: d294106ecb78d765305ab740007f4a678e28baa13ae403fe57ea9cbfc259620f
2026-01-30 17:10:22 +00:00
drh
c79b1f7d6c Fix the new CLI so that the ".eqp" setting does not affect the output of other dot
commands such as .schema or .tables.

FossilOrigin-Name: a5a1b69b3feedb507ecfe2e9ddc039d7c01e1bb54e3e881df5010481886cdef9
2026-01-30 16:03:22 +00:00
drh
4b4df2ee1e Change the new escape-character mechanism for CSV import so that there are
separate options for an escape character for quoted and unquoted fields of
the CSV.

FossilOrigin-Name: 293ec20e29e46d822a98302f8a0ba52ad6f74a7e93f780536d393730c2edbf61
2026-01-30 13:11:20 +00:00
drh
1d1cd36428 Undo the previous check-in. In its place, add the --escape option to
the ".import" command.

FossilOrigin-Name: f11a05d52a1eb933f394d48c0d4ee0353f07ad725b7378c40afd01632e67f72d
2026-01-30 12:27:13 +00:00
drh
a5cc01681e Enhance the CSV import capability in the CLI so that it understands
backslash-escaped double-quotes.

FossilOrigin-Name: 7ba0594d3c24531bc014dd029093b0503118a29cfdd13af2a2ebdd456855ce94
2026-01-30 12:15:25 +00:00
drh
60229c2971 Avoid unsigned integer overflow when evaluating an array index in a
JSON path expression.
[forum:/forumpost/2026-01-27T14:18:49z|Forum post 2026-01-27T14:18:49z].

FossilOrigin-Name: 631c8d44cd1624ddc45babd3f0d810908c2a368784744262042c63506ff2e333
2026-01-27 23:33:42 +00:00
drh
b4142c491e For CSV import in the CLI, when the table is created automatically
because it does not previously exist, make the column types "ANY"
instead of "TEXT" so that they will automatically adjust to different
datatypes in the input text.

FossilOrigin-Name: aff74e71ea734e1ad8fa893652885fd8c6c432fb60e92913a799e6df5e980b47
2026-01-27 14:59:08 +00:00
dan
8f03e92c41 Add test for fts3 compress= and uncompress= options.
FossilOrigin-Name: bace9de67db426017d98f31685da1fc6ab10c7755681a41ca978cc97cb2ad5df
2026-01-26 20:17:10 +00:00
drh
49bf78685e Add alternative sqlite3_carray_bind_v2() interface.
FossilOrigin-Name: 925384d7711867428644595c0903682e6e365eb974c57e6680b51d511c980054
2026-01-26 13:44:42 +00:00
drh
9b7005feea Always use the sort-and-merge algorithm for EXCEPT, INTERSECT, and UNION,
even if there is no ORDER BY clause.

FossilOrigin-Name: 132ba781b031972c6ac564ff0d1d6b2dfaeee77fe503ad6e9e8647bb5ba28bd3
2026-01-25 23:28:42 +00:00
drh
8e272dd9a7 Fix the jsonb_group_array() and jsonb_group_object() functions so that they return
JSONB as they should, and not text JSON, when the array or object is empty.
[forum:/forumpost/2026-01-25T00:47:06z|Forum post 2026-01-25T00:47:06z].

FossilOrigin-Name: 8b53b97833afe27c0c3782c5fbc0437976215b571579f73a94c33e28d3fedb41
2026-01-25 15:18:31 +00:00
drh
e4445f04c5 In the cost metrics of the query planner, the estimated number of output rows
from an EXISTS-to-JOIN loop should not be more than 1.
[forum:/forumpost/989880d0aa|Forum post 989880d0aa].

FossilOrigin-Name: fc4e93a381dfb99dddfd2ef001bf56b92ab89ee3c7044c7ce13ad32f38b3f418
2026-01-23 20:46:54 +00:00
drh
e66806de33 Fix another test case to work with union-by-merge.
FossilOrigin-Name: 8279c10e2465838010508f6018aa6fdb0e07ca3639f65e727a03a4222573ea57
2026-01-20 18:20:26 +00:00
drh
ec13fcecd2 Minor fixes. Tests are passing now.
FossilOrigin-Name: 305ae331f5e791941c12b04b727656ac8d80f7c5cb6343277b979a456eb3b834
2026-01-20 15:07:28 +00:00
drh
4720c16223 Raise an error if any PATH argument to json_array_insert() is not the path
of an array element.  Add some test cases for json_array_insert().

FossilOrigin-Name: 96b7d2c60a3f8a9f9d69313bad599a3a5ad335cb382263e4254e2d20929d5e55
2026-01-17 19:01:37 +00:00
drh
9dff6ac96e Try to prevent false positives in fuzzinvariants.c due to scalar subqueries.
FossilOrigin-Name: c20be882a62e75abc50fd2dcae26ebbe83a01f09369525392fa22223627a04ea
2026-01-16 17:48:46 +00:00
drh
4dd1a202de The optimization at [8bdda827a3d26800] is incorrect for the case where one
of the two expressions has been commuted such that the collating sequence
has changed.  This check-in fixes the problem.  Problem reported by
[forum:/forumpost/2026-01-16T11:35:28Z|forum post 2026-01-16T11:35:28Z].

FossilOrigin-Name: 9d8fb7a9e23d5ef76d05824401976247debe51be6f658f132609257a068a73de
2026-01-16 15:53:20 +00:00
drh
43eb1d4d22 Adjust the output of the fuzzcheck test program so that testrunner.tcl can
capture the number of tests run even when the --slice option is used.

FossilOrigin-Name: dddaeff4ce552f3aa57cc6e18ed35051138b591338242df5f3af39e24006a834
2026-01-14 19:22:36 +00:00
drh
e5fba7f094 Guard against oversized index entries in databases larger than 2GiB.
FossilOrigin-Name: ed17a878e5a2e0cd1e9b69d528f5ac2ba8452d7c83deaf3cc72ecbff054f5ca3
2026-01-14 13:43:32 +00:00
drh
35b9709d46 Fix integer overflow problems and error reporting memory leaks in
the zipfile extension.
[forum:/forumpost/2026-01-13T00:09:06Z|Forum post 2026-01-13T00:09:06Z].

FossilOrigin-Name: 8e656a483557bc5385219d560b9155c232e7dc9d62642249abc879fb37bacd2a
2026-01-13 02:35:19 +00:00
stephan
2f47a58c5d Update speedtest.md to point out xdg-open on Linux.
FossilOrigin-Name: 47c7fbcb46df5a657ec76dff9a370aea9e7d0d95406b1e124e9fe527cf85350d
2026-01-10 14:12:40 +00:00
stephan
644c42f3a4 Fix a help text typo in speedtest1.tcl, pointed out off-list by BrickViking.
FossilOrigin-Name: 1fd02a75a914f131948fe06fc99f851d3e226f9f1270e25393d79c493c28a347
2026-01-10 00:38:00 +00:00
drh
03c0ac435e Enhance QRF so that it terminates more quickly if it encounters an OOM
or oversize string error, and fix it so that it reports such errors.

FossilOrigin-Name: ebedeb6169cc3bc3708130d4061065af600a8851e896fc3eeaf33c8c83fe3b95
2026-01-07 16:19:18 +00:00
dan
55f258bd27 Update the regexp extension so that the "-" character may be escaped with a backslash. Forum post [forum:c5e7358f82 | c5e7358f82].
FossilOrigin-Name: 80013129361fb81ce5db1f6390cad640c2cb547e5ba16724dfb55d0aceecdf6d
2026-01-05 18:29:07 +00:00
drh
904abc85cf Fix yet another bug in the [/info/e33da6d5dc964db8|EXISTS-to-JOIN]
optimization, reported by
[forum:/forumpost/2026-01-03T14:05:48z|forum post 2026-01-03T14:05:48z].

FossilOrigin-Name: f60e863e0ca2d8ab853fa5f48d3cd7b062b13167fcddffc4563bde9285b92320
2026-01-03 15:11:07 +00:00
dan
a0cc06b66b Ensure that loops created by the exists-to-join optimization use unique cursor numbers, even if the EXISTS expression in the WHERE clause is a copy of an expression from the result-set of the SELECT. dbsqlfuzz 4f6a5213cf74fcf2a8a3e48abc2333100348c38e.
FossilOrigin-Name: 19e57a18cbfad44bb1cb1e62d4485635d26059cb2319f4b7f1244df2638bea43
2026-01-02 17:10:40 +00:00
drh
db4d8946ef Verify the effect of "--titles on" in the "insert" mode in the CLI.
FossilOrigin-Name: a5f922b0832d9544b083f3d55d4029aa80e320bf5505547c5a1ddb21f4685e3e
2025-12-31 20:43:31 +00:00
drh
f395df1307 The header setting from the legacy ".headers" dot-command takes precedence
over the current ".mode" setting, for backwards compatibility.
[forum:/forumpost/2025-12-31T19:14:24z|Forum post 2025-12-31T19:14:24z].

FossilOrigin-Name: d2c5df41285a9c8a66e9bdea4e28d86fe10665ad01cfbab5a7ce43b8e39b4e34
2025-12-31 20:35:16 +00:00
drh
d964b8cfa3 Add the new "retest" command to testrunner.tcl, which reruns any tests that
failed or never completed in the previous invocation.  New makefile target
"retest" for both unix and Windows that runs testrunner.tcl with "retest".

FossilOrigin-Name: 9b668d56bf0eca3eb826df3edd6705cc809d920494c192a9949cafda791d83f9
2025-12-31 17:21:30 +00:00
drh
634a915132 Enhance testrunner.tcl so that it can always be run from an ordinary tclsh
as long as that tclsh can load the sqlite3 package.

FossilOrigin-Name: 1a08b85a862e8c9ac56c11e05f76abc25ad98b510fb13ad0716206ba797e53a8
2025-12-31 14:17:51 +00:00
drh
31f6052f03 Fix test/shellB.test so that it works under Device-One. Also bring the
header comment of shellB up to date.

FossilOrigin-Name: 836d02468c7749fa9cdb656c9f80cfef9a41e2eb1321d4bb56c0e0cbc5f37df4
2025-12-31 11:46:26 +00:00
drh
03380a55a5 Fix a typo in [0819fe670f9ceec7] that lead to incomplete protection against
buffer overflow in the zipfile extension.
[forum:/forumpost/2025-12-30T23:57:19z|Forum post 2025-12-30T23:57:19z]

FossilOrigin-Name: a6abbadacbb88c1ddcc236b40fb34eddf3bb0891189bd00a5af8d34b42871967
2025-12-31 01:01:14 +00:00
drh
9924b07cc2 Fix the new .import logic in the CLI so that it honors ".bail on".
[forum:/forumpost/6c1c0e213d|Forum post 6c1c0e213d].

FossilOrigin-Name: d58846e74b6971a5fd80e5f030985273b7dfa0087c2f3c9d0c088c248e183f8a
2025-12-29 23:56:05 +00:00
drh
fb795dbe73 Fix error messages associated with .import, along with corresponding
test cases.

FossilOrigin-Name: 2084e805d0d9da8f419b8506fccd652a7d20262bd95729250a2d2eabfdd079ad
2025-12-29 21:39:48 +00:00
drh
7dfb1431dc Incremental improvements to .import, and new test cases.
FossilOrigin-Name: 5a1e931b19c346bdc8d1a51fa6ef8ee04b7371cdf5df2ee32e1333226c42d327
2025-12-29 19:04:41 +00:00
drh
6693e78772 Test cases for .import, as well as minor enhancements to .import and to .check.
FossilOrigin-Name: 0252ac1c946cd2101f0084f11951b1aeea330dea23b707934c8852d9abe136b9
2025-12-28 21:37:58 +00:00
drh
38c8014940 Improvements to the .import command of the CLI.
FossilOrigin-Name: 436ed7937bcd3b5781539d883ff2957b81d74abccb75f65a2ffb7446a5944522
2025-12-28 14:01:52 +00:00
dan
4056656047 To ensure that the sqlite3_hard_heap_limit() call it makes is effective, add "sqlite3_config(SQLITE_CONFIG_MEMSTATUS, 1);" to fuzzcheck.c.
FossilOrigin-Name: f7736af849d910f04d8622ed7c6e705d84cf22f0a73dca0f30eead9bd1f28bc7
2025-12-26 17:23:25 +00:00
drh
683df60dbf Enhance the omit-noop-join optimization so that it is able to omit a
chain of noop-joins.  Optimization improvement suggested by
[forum:/forumpost/11a53f2bad|forum post 11a53f2bad].

FossilOrigin-Name: 5a85b83b9f21ad88938e273bb35b398e91133424683e915836f322b69f277673
2025-12-24 14:03:15 +00:00
dan
add73c831b Add the SQLITE_PREPARE_FROM_DDL flag to sqlite3_prepare_v3(). Use this to prevent fts3/4 tables in non-trusted schemas from calling unsafe SQL functions.
FossilOrigin-Name: 26f39ac806a5582fab1497e38a4ce68dad2b79df8c8aade43c4e21eed7576931
2025-12-22 15:22:02 +00:00
drh
683c563241 Bug fix in the vt02.c test virtual table.
FossilOrigin-Name: a7a73d30c552195c95c282688eb3d067746c722b702c7f2ba151996ec92136f5
2025-12-18 20:44:48 +00:00
dan
65bc1f0ff4 Allow queries that use "GROUP BY e1 ORDER BY e2" where e1 and e2 are identical aprt from ASC/DESC sort-orders to be optimized using a single index. Also allow virtual tables to optimize DISTINCT in cases where the result-set of a query does not exactly match the ORDER BY clause.
FossilOrigin-Name: fba29a8b560d839e42c2a46421ab870da6e6ed6e15a17aa51f223e32ec3aa8ae
2025-12-18 18:47:49 +00:00