Commit Graph

9875 Commits

Author SHA1 Message Date
dan
8b34ce7d61 Add an OOM test case for the issue with dropping RETURNING triggers when the schema is reset while preparing a statement that uses an eponymous vtab.
FossilOrigin-Name: dc569288dd63754269e14be7a9937c882531685a3e9caec25f86ec8c01eb9583
2025-11-13 18:02:22 +00:00
dan
826bebdb31 Add better test case for the issue with dropping RETURNING triggers when the schema is reset while preparing a statement.
FossilOrigin-Name: 6a9fdde109865b23888f099d066721404e8b853f3dacd55ce08c8bbda2491ec3
2025-11-13 17:42:55 +00:00
drh
237778289b Fix a problem in the EXISTS-to-JOIN optimization ([e33da6d5dc964db8]) so
that it works with nested WHERE and EXISTS statements.
[forum:/forumpost/0704c3c41e49631b|Forum post 0704c3c41e4]

FossilOrigin-Name: d1e901eddc25175174d0706238ae0c33bfa5569e0c2ba4f1164b7a9600203442
2025-11-13 11:36:48 +00:00
drh
7efded5edc Improved concurrency for "make devtest" by splitting fuzzdata1.db and
fuzzdata2.db into slices for asan and ubsan testing.

FossilOrigin-Name: 2c31176607f02a73cf2626cda2dd0711ae74bdf0b4520d4c84ff299c860e419e
2025-11-10 20:01:39 +00:00
dan
14fcb8252a Avoid dropping RETURNING triggers when the schema is reset while preparing a statement.
FossilOrigin-Name: e26bcef7522a6f6ee8d55fa30e7fe06419566cf4e8c2df0c33c92a4c89f58c05
2025-11-10 17:37:59 +00:00
dan
4ac766cc05 Have sqlite3_set_errmsg() return SQLITE_MISUSE if a NULL db handle is passed to it, as documented.
FossilOrigin-Name: 5f5a736f88bc9bc6c9c83d2cbfd74c0b5357d7417d9993d34a78f0b7317ff796
2025-11-10 10:47:29 +00:00
dan
f1c37a357e Add new column "cwd" to the jobs table in testrunner.db. For recording the directory in which the test ran or is running.
FossilOrigin-Name: 334305a469a51ef0d768ba8443d8cab217f45394cc9f720748a489b10703193d
2025-11-03 15:29:51 +00:00
drh
d95fffc9af Adjust the dbstatus2.test module so that it works on 32-bit builds in
addition to 64-bit builds.

FossilOrigin-Name: dcaaa71e750d56afde3e905aaf10729ec95e0ede00522e1b12af6b6345e744ac
2025-11-03 12:36:52 +00:00
drh
4733884eae Update test result output from test/dbstatus2.test module so that it
reports the actual value of nTmpSpill when that value is out of range.

FossilOrigin-Name: 382c8440d7a16eae49fa1644513ae045bfceb072d9b4005963f57f1a57fe94b2
2025-11-03 11:35:13 +00:00
drh
0dfa31d279 Fix the test/speedtest.tcl script so that the CC= command-line option works.
FossilOrigin-Name: 0de0ba878b9ec572d76d47112a0124df9f234fbb7a69c5f5a76ce8c439b11f6f
2025-11-03 10:40:06 +00:00
drh
0c747e1653 Update the test/walthread.test testing script so that it uses a random
database name.

FossilOrigin-Name: ce25a758d4cea1741cb3db6384720f17faef61b352d494ab410a83a41f1721d3
2025-11-01 20:14:43 +00:00
dan
7f70085071 Detect some cases of ambiguous column references in USING clauses that can come up with nested joins.
FossilOrigin-Name: 38c993c8b7137d6d5623d387292639634297c17da11befec9029f12a16a472f8
2025-10-31 16:07:31 +00:00
drh
1c19c06246 Fix the output of ".dump" in the CLI so that the sqlite_sequence table
is created using correct syntax.

FossilOrigin-Name: 4b9f2e1d4485ad3baf9285aa09b468469be929b18cb308f19af471d7aac66076
2025-10-31 11:23:44 +00:00
drh
139ec38ac8 Further improvements the ".dump" command to handle corner cases.
FossilOrigin-Name: cd0c77934ff32050380c2143bba7d4e6c07d5f08187cb5d5e8e7602854d1cda8
2025-10-30 18:52:48 +00:00
drh
c5ff2aa7cf Fix the CLI ".dump" command so that it does not make duplicate
sqlite_sequence table entries as described in
[forum:/forumpost/b1674b56ad|forum thread b1674b56ad].

FossilOrigin-Name: c833f26a6780f919551e50c67d308e96293cec8481899354411d805617481f24
2025-10-30 11:39:49 +00:00
drh
d443f0a95f Fix a logic error introduced by [cea8bf79e18d55a8] which caused
"0 OR 2" to be evaluated as "2" instead of as "1".  Problem reported at
[forum:/forumpost/d5f32040c5d50d2d|forum post d5f32040c].

FossilOrigin-Name: 095cc4f22e63c98cbb2acabdbcaf02e59e67ec6d3cc219b5f42a714e3d53a264
2025-10-29 20:47:01 +00:00
drh
bc2691d5c1 In the CLI, improved error messages on input errors. Limit the size of a
single SQL statement to a little more than 2GB.

FossilOrigin-Name: 0b50e7e10aae3d57f1cbd38d02be50cfbd2d5148ab4a9be712afd8678787b7bd
2025-10-24 12:32:32 +00:00
drh
d41f5ef7e6 Reduce the maximum size of LIKE and GLOB patterns in the ossfuzz.c test
module to avoid false-positive infinite loop reports from OSS-Fuzz based
on long and complex fuzzer-generated LIKE/GLOB patterns that are not actually
infinite loops, but which do take a long time to resolve.

FossilOrigin-Name: 53edea286b0a38f4f9c7017276f3a826037919144d517f8c89ef0f35b65af5f1
2025-10-19 17:30:07 +00:00
drh
e7cf3fe4c8 Add the test/testloadext.c loadable extension to test the ability to use
the latest APIs using the loadable extension mechanism.

FossilOrigin-Name: a9bd7ed6f77c5e53f9130eac7eb999c662e9158fb229a462d29f18653284d6d0
2025-10-14 17:50:55 +00:00
drh
898ac77f55 Merge all the latest trunk enhancements into the dbstatus-spill branch.
FossilOrigin-Name: 55f2613c1bacddb05902d4d5dac3d2b49b91053e6249dd926bb953c763eafeb0
2025-10-14 11:18:45 +00:00
drh
a8bb50ce95 Fix a bug in concat_ws() in which an initial empty string was treated as if
it was a NULL value.

FossilOrigin-Name: eb2e4e46171c12f59aa5d571eeb310534360b110c3e7bda6eaf68f0e25546264
2025-10-13 12:36:54 +00:00
dan
59e1ab5576 Fix an assert() that could fail when reading a blob or text value larger than 1GiB from the database (requires a non-default build configuration). This is an assert() fix only, production builds were functioning correctly.
FossilOrigin-Name: 3e5ec5731f0c8c5f7da357c63d315aae5a2aca5c1b3567bc8c9386ccc2a798cf
2025-10-11 16:23:22 +00:00
drh
8c1670642d Makefile updates to suppose carray() and percentile(). Add Carray to
the CLI and fuzzcheck to support debugging.

FossilOrigin-Name: fe9cf68b513d1e8cfcde90f1982a7f4123f54e3ebb004d961a99bdf6bec03a32
2025-10-10 14:22:05 +00:00
drh
f9d511319b Fix the carrayfault.test script so that it works in configurations that
do not support virtual tables.

FossilOrigin-Name: 767a667b91caff2e789179231f13a0d260c9837020c0ce1553b86e88cf9aa352
2025-10-10 13:43:53 +00:00
drh
97fa2fe414 Fix carrayfault.test so that it works with the new built-in CARRAY.
FossilOrigin-Name: 22f694682107036e68b67e48123d606aeff8cd8b7fedc8ab8ed9cc1a9cccd73f
2025-10-09 19:23:01 +00:00
drh
01f5e6e757 Add ENABLE compile-time options to enable carray() and median(). Hence
there is no new code and no increase in library size without the ENABLE
macros.

FossilOrigin-Name: 7dec290b413ca1bc67694743d8b771e1634fd85251f1a23d60aaf36c63f0f366
2025-10-08 18:11:37 +00:00
drh
ba5cce9f08 This is how the percentile() family of functions might be integrated into
the amalgamation, should we elect to do such a thing.

FossilOrigin-Name: c2cfc9c92e35105e26a4c0887b0401ace15a874fd18046135de4b375ba968795
2025-10-08 16:29:14 +00:00
drh
cdaff852bf Were we to choose to integrate the carray() table-valued function into the
amalgamation, that integration might look something like this.

FossilOrigin-Name: 2b43d5d7dcc5aee14a050c824a5e09b6a38a9c78ddcc25a994eba5d4c5ad9ba2
2025-10-08 15:32:55 +00:00
dan
6147a0f6a1 Add test cases for the carray module.
FossilOrigin-Name: dcfc0164a95eddb5e924c606850fe2015e8f2f516d36b380cbb79d6bdfe034fc
2025-10-07 21:02:37 +00:00
drh
308831d1c7 Improve the invariant checker module so that so that it added "+" before
"column ISNULL" in queries where the base query contains a GROUP BY, to
prevent the ISNULL term from being pushed down into the subquery, since
that can cause ambiguities if column is UNIQUE.

FossilOrigin-Name: b4ff920fbeef9a8590219596d73c09976da3da53c08a685be56f6b2cd2cdc70c
2025-10-07 18:06:05 +00:00
dan
9b6bc61dbd Fix some integer overflow warnings in the base64 and base85 extensions.
FossilOrigin-Name: 06b4bd2aba22c57f5a5fed606c3bee225dee6fdc13bb16cc58194040ef0d7d85
2025-10-07 15:14:03 +00:00
dan
75ef68e385 Avoid using randomblob() in walckptnoop.test, as it produces different results for different test permutations.
FossilOrigin-Name: 94ceb0f0cfef1da89ea2a7420f508024897d9b7c19ef9be9af88d3e6f48c297c
2025-10-06 17:20:26 +00:00
drh
87f53152ed Fix typo in the previous check-in that prevented the script from running.
FossilOrigin-Name: 797664700701effefbf4d87a791febae3bb68544bac23470351a11bcb3a87651
2025-10-06 16:56:12 +00:00
drh
ad7118fa68 Update testrunner.tcl so that the new option is --cases rather than singular
--case, and so that it is a glob pattern.

FossilOrigin-Name: 9488b4f00c9278de8c03f4a3cbd4f54e48e71c1eff45de4454f8bd49c080a930
2025-10-06 16:50:37 +00:00
drh
0ab87fc9a7 Fix typo in the "testprefix" for walckptnoop.test
FossilOrigin-Name: ff205f29934417e8150b5243245fb70389717b219e35bd8d60791a8485b69b33
2025-10-06 16:23:31 +00:00
drh
0611aeeed4 New testrunner.tcl option "--case DISPLAYLNAME" only runs the single case
(and its build dependencies) that exactly matches DISPLAYNAME.

FossilOrigin-Name: 8ea2e097b731514c284f255f12b08e15f63c7f49641a698e61ee7e47cc9d3c45
2025-10-06 15:53:52 +00:00
drh
566348f68b Fix testrunner.tcl so that --help output goes to stdout, not stderr.
FossilOrigin-Name: 441a759c225d4e710a693339402624e7ba52852c08aa64439ed4568c193ad529
2025-10-06 14:30:22 +00:00
dan
cbc3cd47f0 Fix a buffer overrun in the zipfile extension that could occur while processing zip archives with extremely long file-names and comment fields.
FossilOrigin-Name: c284fda848038a61972fd1df5796f608a24ead109170aafe562a5d5787c46488
2025-10-02 11:16:22 +00:00
drh
c8e6f627b8 Fix the new generate_series() to correctly deal with an explicit 0 as the step.
FossilOrigin-Name: b059413c440d1b831c9a462f7165a350001ba7a8cc77ca2a0a8f2bb73c830aba
2025-09-30 17:12:39 +00:00
dan
d05bf5aedf Fix another potential buffer overread in the zipfile extension.
FossilOrigin-Name: 0819fe670f9ceec79f84eb09c234dc29f6581332f86a53d6a0547697404efff1
2025-09-30 11:17:40 +00:00
drh
8f6b797a1b Change the name to SQLITE_DBSTATUS_TEMPBUF_SPILL.
FossilOrigin-Name: 4a60a9c63534f5d2f16af2c3c6581abe7ecf7adfdb39f17e557e73997ae03396
2025-09-29 19:57:43 +00:00
dan
3eccaa7915 Fix a buffer overread in the zipfile extension code.
FossilOrigin-Name: 70c2c99b6f12a3467c23b44adcaf2d7d780ba8317b72de2f6730b1d892cf0c85
2025-09-29 18:55:05 +00:00
drh
c49ff175ef Merge the latest trunk enhancements into the dbstatus-spill branch
FossilOrigin-Name: cb604efdb40da95a759e2eeb9d73608859a94acde9d9782ca82757d3a1c15303
2025-09-29 18:48:00 +00:00
drh
b7f5885b3e Back out check-in [9abaa0ac2b304934] as the code removed there is necessary
after all.

FossilOrigin-Name: 27ae98629406bbaee2857f75c069b2ccd4757b247f0742e51b9e619e96b6dc45
2025-09-28 23:10:54 +00:00
drh
1bf80f2dce Minor bug fixes. Many new test cases.
FossilOrigin-Name: 86dcc68d1816d970d8d5fb158696c3fe6c5ddcac2c255823110d656372503885
2025-09-28 17:24:42 +00:00
drh
54f296389c Rework the bounds calculations on generate_series() in an attempt to
avoid signed integer overflow when the bounds are ridiculous values.

FossilOrigin-Name: 3d9148c7d7379a34a0c2a33a1eb2562234868bc0b14c3d16990b33e52fd4ebc5
2025-09-27 15:03:11 +00:00
drh
b62c26d999 Limit the complexity of a REGEXP pattern using SQLITE_LIMIT_LIKE_PATTERN_LENGTH
FossilOrigin-Name: 869c968569b09d05a5b7d587d8fddb3b4611daf7467dc157701e5dc6c9608606
2025-09-26 15:38:52 +00:00
drh
80d74f0934 In the regexp extension, limit the maximum value of integers in the
"{p,q}" syntax, as performance of the NFA used to do pattern matching
is linear in the maximum such integer.  The limit is SQLITE_MAX_REGEXP_REPEAT
which defaults to 999.  This helps to prevent DoS attacks in systems that
make use of the regexp extension.

FossilOrigin-Name: 911c745f88c0ee8569e67bbcbbab034264f8c981b505aadac3ce7289486a1a68
2025-09-26 13:14:20 +00:00
dan
6553a5d6a6 Fix some integer overflow problems when handling corrupt hexdb dumps in the shell tool. [forum:/forumpost/82b513b116 | Forum post 82b513b116].
FossilOrigin-Name: 730323f95d126162fd2867dbee1e1f1fc1d6e05b8a905a6767c4ab1cb43dacff
2025-09-26 11:45:13 +00:00
dan
51e3a140c9 Include writes to temp files by sort operations in the SQLITE_DBSTATUS_SPILL values.
FossilOrigin-Name: 4c1118ba40172af61d9304dec7a9c7344566e6a5963a317880ad232bebb40176
2025-09-25 19:32:29 +00:00