1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-21 11:13:54 +03:00
Commit Graph

9852 Commits

Author SHA1 Message Date
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
dan
3eccaa7915 Fix a buffer overread in the zipfile extension code.
FossilOrigin-Name: 70c2c99b6f12a3467c23b44adcaf2d7d780ba8317b72de2f6730b1d892cf0c85
2025-09-29 18:55:05 +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
stephan
a4476ea1fa Overhaul the wasm build to (A) support more coexisting variants, e.g. 32/64-bit of both vanilla and esm, and (B) build each variant to its own subdir so that they can build in parallel. It can, with make -j4, now build all new variants in half the time it previously took for just the 32-bit builds. The new build logging output, though unconventional, serves two purposes: (A) improve my build-time situational awareness and (B) it help demystify some of the build steps and output files.
FossilOrigin-Name: 2f4be98614b49def2c2951887796c736269ef3bb7ba5b045cae5f748ae165a83
2025-09-25 15:17:58 +00:00
drh
dc868ef879 Convert the ShellText object in the CLI to use sqlite3_malloc64() rather than
plain malloc().  Avoid unnecessary quoting of table names in .dump output
and similar.  Improved detection of OOM in set_table_name().

FossilOrigin-Name: 6ce4f6dc15a575c318669051fe6590ad114b52ff3f3e260cdf7accccdd922d63
2025-09-25 10:55:54 +00:00
drh
2c88a2ffb5 Rework the set_table_name() function in the CLI to use modern APIs.
[forum:/forumpost/2baa4acd64|Forum post 2baa4acd64].

FossilOrigin-Name: 821cc0e421bc14a68ebaee507e38a900e0c84ff6ba7ee95bf796cad387755232
2025-09-24 19:10:58 +00:00
drh
96bb92e70c Special case the "decimal(-0.0)" output to show exactly 0.0, just as it
does for positive zero. 
[forum:/forumpost/adc719d88d56ab22|Forum post adc719d88].

FossilOrigin-Name: 9ca4163bd93d78be5e4daf2b5d2b920d54d038c6fa8217dd2add0be0da6cd6b0
2025-09-24 17:49:09 +00:00
dan
2364fe3b38 Improve performance of window function queries that use "BETWEEN :x FOLLOWING AND :y FOLLOWING" where :y is a very large number.
FossilOrigin-Name: 1f0b7143575634929c0f77bafa888f0be2dd83f0c6c3deadd8299ac4ab8a8c01
2025-09-24 16:10:46 +00:00
drh
feeacfb897 Fix incorrect buffer size computation for the base64() extension function.
[forum:/forumpost/b1993c858f|Forum post b1993c858f].

FossilOrigin-Name: 603efcd404f0013559ca5bd936fc39481a3aa33a10340bac27b751b6b286d0b7
2025-09-24 12:01:50 +00:00
stephan
4500a87c95 In speedtest1, always use fatal_error() to exit fatally, instead of an fprintf/exit() pair, so that stdout/stderr get flushed consistently (which is significant for the WASM build).
FossilOrigin-Name: 1bd15cb343f6ce57f108291a8ed0f3ee2046932591d44edec133fe3ea43a2ef0
2025-09-24 06:59:47 +00:00
drh
cac1ef709f Improvements to short-circuit evaluation of AND and OR operators.
This is a partial and incomplete response to
[forum:/forumpost/f5adeb59ff77c056|forum post f5adeb59ff77c056].

FossilOrigin-Name: cea8bf79e18d55a8658e48a967cd0b7970b6f88badb769cfbb1f66ab24fb9ec8
2025-09-23 17:00:53 +00:00
drh
611ffbc981 In the ieee754 extension, render -0.0 as 'ieee754(-1,-3071)' instead of
'ieee754(1,-3071)' as that makes the sign clearer.  Both strings still
convert back to -0.0.  Note that negative zero
and positive zero are distinct values in ieee754.
[forum:/forumpost/1eab7e4a08|Forum post 1eab7e4a08].

FossilOrigin-Name: 136188c161a8a2d5166798fcbd341bd1d3f81da7291011f806d6b2153544832c
2025-09-23 16:01:45 +00:00
drh
65a445d750 Fix the decimal_cmp() extension function to give correct results in
corner cases such as negative zero and two equivalent values where one
has extra trailing zeros to the right of the decimal point.
[forum:/forumpost/367c770224|Forum post 367c770224].

FossilOrigin-Name: 25b3626a018fa5916d0e129ee057c3f709c6e4d0b84a1a3102cad127a39a3db9
2025-09-20 14:32:12 +00:00
drh
49a37f333a Improvements to imposter tables: (1) They are read-only unless writable-schema
is enabled.  (2) Because they are now read-only, the ".imposter" command
in the CLI no longer requires the --unsafe-testing command-line option.
(3) Imposter tables do not participate in a PRAGMA integrity_check and hence
do not cause false-positive errors.  However, you can still do an
integrity_check on the the imposter table itself by naming the imposter
table as the argument to integrity_check.

FossilOrigin-Name: ad152ddc4bcf6cfe840b9a36ab76a5ec36afdb1dd96eb7697e4b3df1bf63b00d
2025-09-19 17:24:12 +00:00
drh
e7efe1e201 Fix the new walckptnoop.test test module so that it works in various
alignments.

FossilOrigin-Name: 08689dacc1237a2b90dff4d32186b28054214f709dbff9e07057d3175c1c423a
2025-09-18 23:23:50 +00:00
drh
12ed2fea03 In the date/time functions, a timezone suffix of "+00:00" should work
the same as "Z".
[forum:/forumpost/2025-09-17T10:12:14z|Forum post 2025-09-17T10:12:14z].

FossilOrigin-Name: 3b7a5babf0843c4b3ce93d26f1447218585ce645ec3acd942ac649204e16675a
2025-09-17 14:55:47 +00:00
dan
cf0ba94657 Merge trunk changes into this branch.
FossilOrigin-Name: 3bac76a86baae830d4fdc9e4055470d84549fde56b4cf217ebd96cb486554461
2025-09-08 14:40:17 +00:00
dan
b9bf2d9382 Add tests to check that SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER is working.
FossilOrigin-Name: beb092d8105e5a1ce95339527bf96799e2ce073591b055f71a5f1dc1d0a0c49c
2025-09-05 11:20:11 +00:00
dan
d8d88d9390 Add "PRAGMA wal_checkpoint = noop" and SQLITE_CHECKPOINT_NOOP. To request a checkpoint that checkpoints zero frames.
FossilOrigin-Name: 48be3d020cf0c732557b3d956198a1abcab79424be03f447e2bb89f4d68dc8ff
2025-09-04 19:33:23 +00:00
dan
7fa9e45746 Add test case for pushing WHERE constraints into a UNION sub-query that uses virtual tables.
FossilOrigin-Name: 13c80e903ee7f178528918716b11fc0b57fc50b923dcd8aeabf9e6e04e93cdae
2025-09-02 14:59:16 +00:00
dan
20bfeccb65 Update test script reservebytes.test so that it works with the "prepare" permutation.
FossilOrigin-Name: 4ac774364b693a4b992c997c64bf425e2765133a7a25963cbf2b02c180eeaba5
2025-08-29 16:51:16 +00:00
dan
1df00568b3 Add test to ensure that changing the number of reserved bytes in a database using VACUUM does not confuse other connections in stock SQLite.
FossilOrigin-Name: 6bf54bbc4d503e8ebeb804dfb318383770e85d434dacbbbd8f6dadc7595b1856
2025-08-27 11:21:44 +00:00
dan
3c2b02d919 Check that certain ON clauses do not refer to tables to their right as a separate step after parsing a SELECT statement, instead of as part of the planner stage. For for [forum:ccfb3b5052 | forum post ccfb3b5052].
FossilOrigin-Name: e0beda7ffe92abf6322db8314c42940adab7f89a35d38124355cb3464ee70b9f
2025-08-25 14:27:31 +00:00
dan
7af1d61886 Add test case to this branch to show that it handles cases where ON clauses use select-list aliases to refer to columns to their right.
FossilOrigin-Name: 4d34ab4acf0343a22ea8097fa4b1e87a1b0a13be864d5bee0c7a8341c09b8002
2025-08-25 11:47:15 +00:00
dan
4bace197e1 Fix the cases in joinI.test on this branch.
FossilOrigin-Name: 23ac2377315af02b73db6ae37bfeeda1453e41efb702a6b707346956c2d41a9d
2025-08-23 16:26:36 +00:00
drh
81b8ad0830 Fix cksumvfs test case added by [e3bd1feccaee8ff2] so that it works
with varying page sizes.  Test case change only - no changes to code.

FossilOrigin-Name: b6f8f086dacd11f57bdb0eef79f25bce209816a0748f16009372c62dc3edd5ae
2025-08-23 11:09:53 +00:00