Commit Graph

9169 Commits

Author SHA1 Message Date
drh
af527231c1 Immediately fail a CREATE TABLE statement that attempts to create a
table that has a generated column loop.  Legacy allows the table to be
created but the table would not be usable for anything.

FossilOrigin-Name: 3237bf964117c1ef71143042837ef21872bb3d04bfd682075672e768953ec802
2023-10-13 13:49:46 +00:00
larrybr
99d43979d3 Avoid potential overflow in hex(). [forum:/forumpost/7ac0c9c5ea|See forum post 7ac0c9c5ea.]
FossilOrigin-Name: 2e968114fd0e60eebcc088dec02684e10b06ac1ec42d6bedb5287362f5cbf032
2023-10-13 01:39:47 +00:00
dan
a11499a156 Add test case for [29937081].
FossilOrigin-Name: d3b983edf7164d30ddb8b4b745a3feff9737149d85b1c428d6ad488ac6a1960a
2023-10-12 18:09:27 +00:00
drh
ac4aea5102 Fix the use of an uninitialized value that occurs when doing a json_insert()
of a string value that contains embedded U+0000 characters.

FossilOrigin-Name: d3c0cbb90966316be9cd25e3edb501da42731e8a83c13227b90ce17d3975a2c3
2023-10-11 17:24:31 +00:00
drh
faef28e6bd Fix a potential UAF caused by JSON parser cache spill.
[forum:/forumpost/b25edc1d46|Forum post b25edc1d46].

FossilOrigin-Name: a163fecca90cab9d1b7bf8ebac78d498775eed7b6d81e7920e3401633c3a4b60
2023-10-09 12:46:53 +00:00
drh
8f0634549c Add a test case to prevent a regression of the leak fixed in the previous
trunk check-in.

FossilOrigin-Name: f99ff655d09763c4a22d065041644ece793d84c82c644931e89ccf50c4f4564a
2023-10-07 08:15:47 +00:00
drh
1935887a68 Ensure that all fields of static sqlite3_module objects are explicitly
initialized, in order to hush-up nuisance compiler warnings.

FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7
2023-10-06 12:51:05 +00:00
dan
bee5657042 Add test case to ensure the assert() removed by [f090af77] no longer fails.
FossilOrigin-Name: 615ab71761754b072439f92e73fdb98c916b820937bcca8904f4be34936d5f9c
2023-09-29 15:56:40 +00:00
dan
1c67749166 Remove a NEVER() from a condition in the partial-index constant value optimization that can sometimes be true.
FossilOrigin-Name: 63aea8c3e0605edcf49ad1e5ce1a56d2690dcb8c4857043997545daab46ca035
2023-09-26 19:26:47 +00:00
dan
873849b81e Fix a bad interaction between LEFT JOIN, bloom filters and partial indexes.
FossilOrigin-Name: 5775f92b31f0539c66d37e50689bec17a82c0e857a781331c03e34bc18157087
2023-09-25 11:12:39 +00:00
dan
af7cce98c5 Add extra tests for changes on this branch.
FossilOrigin-Name: cb45f5b070cfdbb4358e8e909b0b34d658b5925db06e282b38046298a159c545
2023-09-23 21:31:40 +00:00
dan
7a9bbfe1fa Avoid an error when parsing a schema that contains indexes with WHERE clauses containing unknown collation sequences.
FossilOrigin-Name: d5dd39e37ab994ce5d75688a40c6494c17807431529e85eb2b11d58f367fe232
2023-09-23 19:25:03 +00:00
dan
c18c7523a4 Fix a failing assert() caused by changes on this branch.
FossilOrigin-Name: d0e21f20bd8643d21c4b88fb75b83939d68e9b7118f7289a164656f11d2ee555
2023-09-23 18:52:22 +00:00
dan
bd42642431 In partial index scans, if the WHERE clause implies a constant value for a table column, replace occurences of that table column with the constant. This increases the likelihood of the partial index being a covering index.
FossilOrigin-Name: 66ed7abdfa228abde2052e3988589371f0e49b11582b1b4a83255d2df3a0aefa
2023-09-22 20:21:27 +00:00
dan
f99a27fab9 Fix resolution of "rowid" and similar identifiers in queries that use nested joins.
FossilOrigin-Name: 37ec43d92bde13efc71fa57ff5e59c4a95b9054c298f844aefeb06d4a91ad0d4
2023-09-16 18:18:57 +00:00
dan
2e8edc1d45 Further tests and assert() statements for the change on this branch.
FossilOrigin-Name: 1c202d540ac362bfc747a9f8472e83c9d7614e38467f8b48787a669fb34664ba
2023-09-16 14:42:18 +00:00
dan
63702bccaa Fix resolution of unqualified "rowid" identifiers in queries with nested joins.
FossilOrigin-Name: bbcbd3d537d6790373d97f59386b8ce7fa2177db572af0f1babe058a76e25cc3
2023-09-15 20:57:05 +00:00
drh
c09701db9b Do not reduce subquery output row count estimates due to DISTINCT until
after the decision of whether or not to use an index for ORDER BY has been
made.

FossilOrigin-Name: 27390051e86ad86fb35219329d359be9e83073f59782631af7fc519225e10565
2023-09-15 19:00:47 +00:00
dan
81b70d97eb Allow expressions like "<tbl>.rowid" to refer to implicit rowid columns of tables in nested FROM clauses.
FossilOrigin-Name: 59a1bbc69f5dbb33418fa4b383393fb13a46bc1e531577da8ad54ae2fad5a10e
2023-09-15 18:36:51 +00:00
drh
658096e124 The view-scan optimization was added to enhance the performance of one specific
query, but it causes performance regressions on a host of others.  Disable it
(at least temporarily) in order to try to find an alternative way of fixing the
one specific query that it was created to fix - an alternative way that does
not cause performance problems for other unrelated queries.

FossilOrigin-Name: d9625a9eafe88859c3255849ee750cc6322d5a13ddad45107f9b2085c20eff50
2023-09-15 14:06:44 +00:00
dan
fb77b3ed3f Add -DSQLITE_OMIT_LOOKASIDE=1 to the "Sanitize" configuration in testrunner_data.tcl.
FossilOrigin-Name: a917ebf17b27951d1c6906e9068e816ef29861701f2e8f4f1a13acce5737f680
2023-09-07 17:54:12 +00:00
dan
09f1652f36 Fix a buffer overread in the sessions extension that could occur when processing a corrupt changeset.
FossilOrigin-Name: 0e4e7a05c4204b47a324d67e18e76d2a98e26b2723d19d5c655ec9fd2e41f4b7
2023-09-07 13:53:09 +00:00
drh
961c2a9f36 Add the xIntegrity method to the sqlite3_module object. Implement this
method in RTREE, FTS3/4, and FTS5 so that "PRAGMA integrity_check" also
verifies the correctness of shadow tables associated with those virtual
tables.

FossilOrigin-Name: 17bede8cdefd968210dd8a5a2617acbe12ba2c99fdd5e88c5def8665e7bec2d7
2023-09-06 12:52:00 +00:00
dan
8628c10e27 Do not disable unused columns in a UNION ALL sub-query if any component of the sub-query is DISTINCT.
FossilOrigin-Name: c84d5602ac9bfb4f12c3cf62033af616e51913c26877d1a0761363a625295f53
2023-08-31 18:00:10 +00:00
drh
a7ec1f9a1b Fix a bug in json_array_length() introduced in version 3.43.0 by
check-in [df099ad713011b67].  If the JSON input comes from json_remove(),
the removed array entries are still counted as part of the array length.

FossilOrigin-Name: 69a635958a4a14187e88dd297df8978a4805b1b0c7bff3ec29d5632c0f68d889
2023-08-30 18:19:40 +00:00
drh
7bb5a6db40 Fix the AVG() and TOTAL() functions (after the SUM() fix of [77d3dcd283595c52])
so that they work with infinitites.  Fixes a bug introduced by check-in.
[c63e26e705f5e967].  Bug reported by
[forum:/forumpost/8960fb40cc|forum post 8960fb40cc].

FossilOrigin-Name: 6df6f17ccb404c648076ccff4200d0eb5437f0e3e82424bf3da5ea682b107bb4
2023-08-30 16:03:27 +00:00
drh
a910f3f1c5 New conversion letters added to strftime(): %e, %k, %I, %l, %R, %P, %p, %T, %u.
FossilOrigin-Name: 058722b2d0b995195a8ce3effe9722ae1c18cb1e7a520b481030da0bd579fe41
2023-08-29 18:28:08 +00:00
drh
e1e67abc5c Add support for the CONCAT() and CONCAT_WS() SQL functions, modeled after
the PostgreSQL behavior.

FossilOrigin-Name: 0b434ca7aa19eff4ad134a8c6f88f6a7ccab88864faa55e93579a2462d8ac3bc
2023-08-29 15:24:41 +00:00
dan
35c7f538e9 Updates to testrunner.tcl so that it runs fuzztest using multiple jobs.
FossilOrigin-Name: ceeabe9f8b31a30c65147fd270b92d43c7842247548cee9de165113991f6c2cf
2023-08-28 20:14:19 +00:00
dan
ecdc5b3e6f Fix the "sdevtest" testrunner.tcl command so that it correctly enables asan on windows.
FossilOrigin-Name: 6463192369ff22eb15d4e34590ef55cd8a6f2501227835664816277806bf961b
2023-08-28 20:02:59 +00:00
dan
9b0e9f9089 Fixes for testrunner.tcl on windows.
FossilOrigin-Name: 26ae090889640bfcf02a6dd5aa58044edd4d0708a11d8e005149f1a3c8495bba
2023-08-28 18:15:14 +00:00
dan
d7def73c97 Another fix for valgrind permutation. Remove the "copydir" table column - just add a [cp] or [copy] command to the test script where this functionality is required.
FossilOrigin-Name: 448b9a575e66960a0885864f88b99b6ea15655c77a42eef956c09c8dc70e539a
2023-08-28 16:28:00 +00:00
drh
bd953dfcad Fix an issue with infinity handling by the SUM() function that goes back
to the extended-precision SUM() enhancement of
[check-in c63e26e705f5e967].  Problem reported by
[forum:/forumpost/1c06ddcacc86032a|forum post 1c06ddcacc86032a].

FossilOrigin-Name: 77d3dcd283595c52f24c07fc59ba60c9133b71c440cf3f799cf48c907c6fae3e
2023-08-28 12:20:18 +00:00
dan
f98612b1c5 Fix the valgrind permutation on this branch.
FossilOrigin-Name: ccbf06760e8377f9209ba3fd4895a25fe1a5ea688c384bf357e765b6a2b4c2f7
2023-08-28 11:22:33 +00:00
dan
1f1169ad09 Updates to testrunner.tcl so that it runs "make fuzztest" using multiple jobs.
FossilOrigin-Name: 7596ea7074e0ac73312586ed3d28cdacf97f54b8af73f804cbc8066c94d4b4ef
2023-08-26 21:04:54 +00:00
dan
36018803d6 Add doc/testrunner.md, for documenting the testrunner.tcl script.
FossilOrigin-Name: 9c69a28401c7273823f2c2b291fd417febeb278afb9ce085a4b944505ca13d23
2023-08-24 19:08:50 +00:00
dan
44e24e9640 Add makefile target "sdevtest" - like "mdevtest" except asan and usan enabled for the non-debug test.
FossilOrigin-Name: a449d650cd3dcd1baaeb3a3de2aaaac45594397e04f95fe637b0fe4ddb273404
2023-08-22 15:19:50 +00:00
drh
3404b452a4 Fix another UBSAN inaccuracy in fuzzcheck.
FossilOrigin-Name: a6fb9de8f87261194e6034376f62b1cac30b764f106dd3adcf728e020f8a4fd5
2023-08-21 14:40:19 +00:00
drh
114ad2f86f Address minor inaccuracies in fuzzcheck and RTREE found by UBSAN.
FossilOrigin-Name: a64e6c2fd8ef1d2d7f14aa9265629853298bbc480c2683c79dfd24847a61b68b
2023-08-21 14:28:47 +00:00
drh
4d8eb16f07 Rename the decimal_sci() function to decimal_exp().
[forum:/forumpost/fa027bb0ab|Forum post fa027bb0ab].

FossilOrigin-Name: c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695
2023-08-18 15:39:38 +00:00
dan
d5a9d522fb Avoid running test case sort2.2.3 under address-sanitizer. It runs out of memory on some 32-bit platforms.
FossilOrigin-Name: 925be7539947078547ee129b3d328ab0c59b19c6e2e5a391840f2d58f6d59acd
2023-08-18 15:17:52 +00:00
drh
f0eabde9a4 Enhance the CLI and the fuzzcheck utility programs to report whether they
are compiled as 32-bit or 64-bit for things like the --version option.

FossilOrigin-Name: ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008
2023-08-18 12:15:44 +00:00
drh
2e0ce58d2c Do not allow bound parameters in the ON CONFLICT clause of an UPSERT.
dbsqlfuzz 9983e2c77634a8ccf33b5c91fa9982599de5f9e9

FossilOrigin-Name: 3c06709335eb4b98e3a684e3ebbae69eeb6a21b452bce29159c82bb632d6a042
2023-08-17 17:48:20 +00:00
dan
699803e114 Add "Windows-Sanitize" configuration to "testrunner.tcl release" tests on windows.
FossilOrigin-Name: e68b46dc6aff48c81a2a5e7662d0f694615b64aa50bcfee9a0b8b25fa4e5f33d
2023-08-17 16:06:17 +00:00
dan
58c44132d1 Have all test names in json101.test start with "json101".
FossilOrigin-Name: af56d7b6b9c50f2541a51fcb7d94b89aafba4f343a9103b21a15aad3f283c63e
2023-08-17 15:14:43 +00:00
dan
af8980bdce Update testrunner.tcl to use environment variable %NUMBER_OF_PROCESSES% when running under tclsh on windows. Also modify the internal database schema used by testrunner.tcl to be compatible with old versions of SQLite.
FossilOrigin-Name: 6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b
2023-08-16 14:18:53 +00:00
dan
fe18355267 Fix test script problem preventing veryquick.test from running.
FossilOrigin-Name: e73886574042108eb31641d0820c273c10b83fbf08ac6cb52d3e4c27830e2c23
2023-08-16 13:55:38 +00:00
dan
f05630fb1c Update testrunner.tcl to make it easier to add things like mdevtest.
FossilOrigin-Name: a531b71c4fd64fff6008876af825107ebc403f80dcb95273a05936ff6587b7aa
2023-08-15 18:52:25 +00:00
drh
00eee07911 Fix the PRAGMA case_sensitive_like command so that the LIKE function continues
to be innocuous after the PRAGMA.
[forum:/forumpost/925dc9f67804c540|Forum post 925dc9f67804c540].

FossilOrigin-Name: 84c268c34cba7207a90dad2a8e972ce90c85304e91f4933c76963822ad1ae48b
2023-08-15 11:58:22 +00:00
dan
46451fa8b5 Fix the mdevtest target so that it works with msvc.
FossilOrigin-Name: 01f49448cd0cfe3af499aedfe887b7b0be4f1ab09cd5a16119ddafb32b107708
2023-08-12 19:58:47 +00:00