Commit Graph

9235 Commits

Author SHA1 Message Date
larrybr
7667f5f12f Add tests for generate_series(), and change an existing test that enforced varying rowid-to-value mapping with query ordering. (That no longer varies.)
FossilOrigin-Name: 9605db4ae37ef383f8e5568af4543a9e6f336bace6ed80ff80fe4c0b0f437078
2023-04-28 23:39:16 +00:00
drh
016f46666b Fix indentation and omit trailing whitespace in the random JSON generator
script.

FossilOrigin-Name: 629db09fceb7bf37561b52ccee06ebf4df261291e9a8ffcca82b243f6db5ff07
2023-04-28 13:25:35 +00:00
drh
1170fb52e1 Fix json_tree() so that it is able to deal with the JNODE_RAW labels of
a JSON5 object.

FossilOrigin-Name: f56528d413d8e622f7c4f18b2f9f2e620bfb441c020461299b35a90072ee6c13
2023-04-28 11:02:01 +00:00
drh
ea2529528e Merge all the latest trunk fixes and enhancements into the json5 branch.
FossilOrigin-Name: b5ca15cfc19380cf870b70be6a86e70f2026cc3d6d89005b45891d58c4f11c2d
2023-04-28 10:23:01 +00:00
drh
52da6d2607 Test cases added, and some bugs fixed.
FossilOrigin-Name: bc84a82e4ddc1b71025c56c49e62a44f0b12fa87a6417ad61967d9d3121a0d4e
2023-04-27 23:29:09 +00:00
drh
f14b2e35fa Partial implementation of JSON5 numeric literal extensions. Use a switch()
statement in the parser for better performance.

FossilOrigin-Name: 78404dc37024cad5fe7eacf78ea85b56f08b129a1b9a046c3e1b11275068a485
2023-04-26 17:30:28 +00:00
drh
5255102e04 Improvement to the way the JSON performance measure scripts work → keep the
test database in the directory of the test, not in the source tree.

FossilOrigin-Name: ac411dbdcbf0b9040fb5b7de173271f383a6aa303d57f22ebd200809a5b4a6d3
2023-04-26 15:58:08 +00:00
drh
f62518f65d Work toward implementing JSON5 whitespace. Untested and incomplete.
FossilOrigin-Name: d262c059455ebe0650a45a6c1c04d1baf9609c635df352732dd192426e1bdc39
2023-04-26 15:19:19 +00:00
drh
ddc8b9ee0e Fix to the json-speed-check.sh script.
FossilOrigin-Name: d839c9544d7f28c1abc779eb2d40f95c1a9386984656fbd29d19b1e7830171bc
2023-04-26 13:52:20 +00:00
drh
02efa7be96 Add scripts for JSON performance testing.
FossilOrigin-Name: 3051d6a7c12cbf86634d8fab64f3f3bc9a1eb184260e56a82eb543cb634ba7ef
2023-04-26 13:25:30 +00:00
dan
0941ea8a62 Avoid assuming that an expression in an ON() clause that evaluates to zero implies that the query will return zero rows when the query contains a RIGHT JOIN. [forum:95849acbe1|Forum Post 95849acbe1].
FossilOrigin-Name: 1783655ea422185e75593b89e4ef452a6f5496aefd389f88ce7fe4b7d41d6a98
2023-04-25 14:37:12 +00:00
drh
be5bada4d0 Allow trailing commas in objects and arrays of JSON.
FossilOrigin-Name: 4031b231c223db598b45dbd192b027a99a9b82a981d43c75f723a3fb06720b82
2023-04-24 23:14:34 +00:00
drh
223c6b48a9 The sqlite_stat4.idx field is case insensitive. It should work even if
some entries use a different case than others.  Fix for
[forum:/info/6c118daad0f1f5ef|forum post 6c118daad0f1f5ef].

FossilOrigin-Name: f097ca70b5b967d1aadebd74ac5020813e00b7c30cc543814dbf5f359d1328f1
2023-04-22 22:32:19 +00:00
dan
3115b36d67 Fix a segfault that could occur if a non-empty in-memory database was the destination of a backup operation from a database with a smaller page size.
FossilOrigin-Name: 020968f857d7b90bab3525fc9d6b859a019f6a80422c3d5ffb88f5bdb8e02a11
2023-04-19 17:07:35 +00:00
drh
f84aeac274 Another fix to the indexed expressions in aggregate queries with GROUP BY
enhancement of ticket [99378177930f87bd] and implemented by
check-in [b9190d3da70c4171] to address a problem described by
[forum:/forumpost/f34e32d120|forum post f34e32d120],

FossilOrigin-Name: 5acc3ef83e16a9f2803981a6e61eca62fe177cac4eed1befe2ade3a5977a1eab
2023-04-18 14:13:54 +00:00
drh
053a29c291 Add the --fullsync option to speedtest1.
FossilOrigin-Name: 960fe54c8227a376c97bb2a3ba604d97e79e27e51a9798be9d318cf56c04fa99
2023-04-18 11:35:09 +00:00
drh
2142b7c0a6 Avoid double de-quoting of table names when processing RESTRICT actions
in foreign key constraints.
[https://bugs.chromium.org/p/chromium/issues/detail?id=1405220|Chromium 1405220].

FossilOrigin-Name: bb2b5ab172f0751c00343facf36fb12db10c88220caece31849f2711f12293d9
2023-04-14 00:20:16 +00:00
drh
731a1aaeb2 Fix an obscure issue with ALTER TABLE RENAME that comes up with triggers
that have UPDATE statements that contain errors.
[forum:/forumpost/ff3840145a|Forum post ff3840145a].

FossilOrigin-Name: c4845a7c5f7f219848d3ee32eef0f9c69ad6dc6e8509da84d612f41e1e05f007
2023-04-13 18:44:59 +00:00
dan
8efa288f99 Add extra test cases to window1.test.
FossilOrigin-Name: ebc844fbfb046c5789efe21fd607c9301cb7b3d78edef72b2926b8c889b048a9
2023-04-13 14:53:19 +00:00
drh
017bdf7838 Fix a code-generator issue associated with very unusual use of window
functions.  Both the expr.c or the window.c changes will each
independently fix the problem.  They are both included in this patch for
defense in depth.  [forum:/forumpost/0d48347967|Forum post 0d48347967].

FossilOrigin-Name: 1ba22631a7831e3562eda0eb6a5edf7f009c85c7ab4451d9eacd13ef0fb6036a
2023-04-13 14:50:50 +00:00
drh
82aacda7eb Remove an ALWAYS() that can sometimes be false. Add a test case that makes
the test false.

FossilOrigin-Name: c8fb143d64d8e823684cd26799080da4b42bef121ca3c6315b1803a593490926
2023-04-11 15:06:20 +00:00
drh
ed36917835 New assert() statements to validate the parameters to
sqlite3BtreeCursorHint().  Fix a problem with the construction of those
parameters discovered by
[forum:/forumpost/0b53708c95|forum post 0b53708c95].

FossilOrigin-Name: 4c5a3c5fb351cc1c2ce16c33314ce19c53531f09263f87456283d9d756002f9d
2023-04-10 18:44:00 +00:00
drh
8346f8dacc Sync the vt02.c test virtual table with TH3, in order to pull in the fix
for long delays when there are huge OFFSET values.

FossilOrigin-Name: 49ba030080dd00b4fdf788fd3da057b333e705fa0fe37d653e2461bf96ca3785
2023-04-10 13:20:51 +00:00
drh
072a02ce2c Add a test case for the ALWAYS() macro removed by the previous check-in.
FossilOrigin-Name: 68a1a837493a0bc5e0e0f2373ac76cb575078cec08990c017fdcb51a4ba363a1
2023-04-05 02:55:08 +00:00
drh
8907cb2f88 Fix the function that determines the collating function for an expression
tree to handle new cases that arise as a result of the recently added
ability to use indexed expressions in aggregate queries.
[forum/forumpost/0713a16a44|Forum post 0713a16a44].

FossilOrigin-Name: cc5041f3f067cf610adffb868b4e2d1b5d248dc5a0ecc551339b670800ecb0ff
2023-04-05 02:21:57 +00:00
drh
c6a54f418c Remove an assert() statement that is no longer valid due to enhancements
to query planner for improved use of indexes.
[forum:/forumpost/dc16ec63d3 |Forum post dc16ec63d3].

FossilOrigin-Name: 2b23dd249d0bc254308f5539936d33ee558f1100dec616caac7317dbe70db761
2023-04-04 18:10:23 +00:00
drh
39b07f1afc When translating arguments of aggregate functions into references to
expression indexes, make sure to only translate them for the current
aggregate when there are nested aggregates.
[forum/forumpost/409ebc7368|Forum post 409ebc7368].

FossilOrigin-Name: 898bfa1afd8260eaaf2aa6db94e74d99ebf4e8a6dc02cf21d20cd981393609a5
2023-04-03 23:49:00 +00:00
drh
555970bf83 When changing a COLLATE expression node into TK_AGG_COLUMN because the nodes
value is contained in an indexed expression, be sure to clear the
EP_Collate property from the expression node.  Fix for the assertion faults
reported by [forum:/forumpost/e45108732c|forum post e45108732c] and
[forum:/forumpost/44270909bb|forum post 44270909bb].

FossilOrigin-Name: cf6454ce26983b9c3ae924c44a802f3f760eaaae9547b40aee9e14e7b0c47cab
2023-04-03 17:46:14 +00:00
drh
af33654533 Earlier detection of corruption in sqlite3BtreeDelete().
dbsqlfuzz a4c48c291d6e40157a1b749a05eaa7c7faf5a625.

FossilOrigin-Name: 978dc71c388b37740da38c310674315c7d7fe814d1daa16a146b4df71385d1e1
2023-04-02 16:43:20 +00:00
drh
e5ea81ae85 Improved error messages from PRAGMA integrity_check. Identify the root of
the tree when a problem is found in a b-tree, making it easier to track the
problem to a specific table or index.

FossilOrigin-Name: a1cb152e69c7c6cdd99300c91a8104716089de459d9d19e33ef38432aad70908
2023-04-01 13:14:53 +00:00
drh
1839b7990d Omit the the count-of-view optimization if there is a HAVING clause.
dbsqlfuzz 6a107e3055bd22afab31cfddabc2d9d54fcbaf69

FossilOrigin-Name: babe2b5e59647ac9db4601e67c25190aac14eb76d5fcb9fa5b3692b955fefd61
2023-03-31 23:48:59 +00:00
dan
53ed383075 Fix an error in new test script test/aggfault.test.
FossilOrigin-Name: 8724fe7426da55d19dba7b30e09321ba30c73286513864cb05de32f72e50ee31
2023-03-30 12:19:38 +00:00
dan
8fe84a40c7 Fix a crash that could follow an OOM error while processing aggregate functions.
FossilOrigin-Name: 804435a2731bd3c26278c47098854b9ee7727a686587f6208e793738fbfc0555
2023-03-30 11:05:36 +00:00
dan
e1afa2bd24 Avoid having OP_SeekScan jump over an OP_IdxGT or OP_IdxGE that follows the OP_SeekGE opcode. Fix for [b50528af4468237c].
FossilOrigin-Name: c9c4f287652933eb6262a3419efe7e7288f55d3db7e2ac032eeae025f665d306
2023-03-29 21:58:06 +00:00
dan
7b56e97866 Fix a problem with sqlite3_stmt_scanstatus() from within an SQLITE_TRACE_STMT callback made from within a trigger.
FossilOrigin-Name: 1fa78fafa1340de458546526b03cf8b3e9c823913c4225d7c747ad182df5c0fc
2023-03-29 18:54:01 +00:00
drh
e1be2b7ad9 Fix a weird corner case in aggregate function processing that results from the
recent addition of support for index expressions on aggregate queries.
[forum:/forumpost/bad532820c|Forum post bad532820c].

FossilOrigin-Name: c34fd9fe1b76e0a5943f014f46141cbe55d41bb1e6980adf9bcb6785a03e7883
2023-03-28 16:02:28 +00:00
drh
3cbf38c783 Fix multiple problems with RETURNING on a DML statement against a view,
all inspired by [forum:/forumpost/dc3b92cfa0|forum post dc3b92cfa0].
(1) Do not allow a RETURNING clause to trick the code generator into thinking
that the view being updated has an INSTEAD OF trigger.
(2) Generate all result columns for a view in a DML statement.
(3) The automatic covering index for a view should cover all result columns
of the view.

FossilOrigin-Name: c8bedef0d61731c29ae34de1594222d15b578f9e2cddbbd5b74fb3059644fe0f
2023-03-28 11:18:04 +00:00
drh
3594b2b303 Do not allow constant factoring during PRAGMA integrity_check, since the
constants might be stored in registers that are later reused for other
purposes.  dbsqlfuzz dc9ab26037cf5ef797d28cd1ae0855ade584216d.  Problem
discovered by a new assert() statement added in [6f8b97f31a4c8552].

FossilOrigin-Name: 0bba27b78112b2b2271e498f41c437df985aa2faab302ee5b29d9b60003a8379
2023-03-27 13:24:02 +00:00
drh
7bb842642c When reading sqlite_stat4 data during query planning, be sure to expand
zeroblobs prior to running comparisons.  Fix for the issue identified
by [forum:/forumpost/5275207102|forum post 5275207102].

FossilOrigin-Name: 5c8dd8dfcaab9c364b3a126ca35880ef57f5cecbe030771e646c934c8cf43709
2023-03-25 22:37:23 +00:00
drh
2c16ec829b New test case to further validate the fix at [221fdcec964f8317].
[forum:/forumpost/d34ad68c36|Forum post d34ad68c36].

FossilOrigin-Name: a6e218a6e1ddd74be6a313b1d336334071747efd4ecd354ed7efe303d09c849c
2023-03-25 02:07:20 +00:00
drh
ed8e12e97b Fix an error in the OP_SeekScan opcode added by check-in [4a43430fd23f8835].
Problem reported by [forum:/forumpost/8cc1dc0fe9|forum post 8cc1dc0fe9].

FossilOrigin-Name: 651a13fcd16f03e89eb6228c9f3250e25910b9bbe2637f627f65ff78f8ba2059
2023-03-24 21:24:52 +00:00
drh
b3ad5444d0 Fix the handling of indexed expressions in an outer query that appear as
corelated values inside an aggregate function within a subquery.
[forum:/forumpost/79cf371080|Forum post 79cf371080].

FossilOrigin-Name: d8259877eaa962e6f90675790d3770ef02bd1a5d86d319cd8c1834710df844c4
2023-03-24 20:35:56 +00:00
drh
d23924d1ea Fix a problem in cursor-hints for WITHOUT ROWID tables used in a RIGHT JOIN.
[forum:/forumpost/591006b1cc|Forum post 591006b1cc].

FossilOrigin-Name: 221fdcec964f8317b2c23e926cc23799615cd3b4239a8a9ff87a83588d05bc64
2023-03-24 19:17:25 +00:00
drh
28fe02cd51 Fix byte-code register allocation in ANALYZE for STAT4 when there multiple
indexes with differing numbers of columns.
[forum:/forumpost/bc39e531e5|forum post bc39e531e5].

FossilOrigin-Name: 2bf5413dc2c19d5feb32e5b01aa9b990ec2f74f45f5ca0dca15215f8c9dbc9b9
2023-03-24 16:57:21 +00:00
drh
c03dbc5a24 The attempt to bring STAT4 up to 100% MC/DC at [55a26c67ed4a3a93] and
at [168fa2fb22b8c1ad] are incorrect.  Back them out and replace them with
a simple NEVER() macro.  Error reported by
[forum:/forumpost/dc4854437b|forum post dc4854437b].

FossilOrigin-Name: 5992370a89f8de7a6e941130b381f85d369856dbdb7860405e6fb17dad2293df
2023-03-23 10:54:07 +00:00
drh
c408c155d7 The double-to-text conversion renders infinity as 9e999, so that JSON
output is compliant and so that values can be round-tripped.

FossilOrigin-Name: b52081d0acd07dc5bdb4951a3e8419866131965260c1e3a4c9b6e673bfe3dfea
2023-03-22 16:24:17 +00:00
dan
bb130c9223 Fix a problem causing a cursor to retain an out-of-date cell-info cache when processing a DISTINCT query on values that are identical according to their collation sequence, but different on disk. [forum:/forumpost/e132e6cde44fb505|Forum post e123e6cde4].
FossilOrigin-Name: 1b3abc1daeac29714256b5a1d5a07a75dc986f1089054a8bee44a00583b7383a
2023-03-20 14:59:19 +00:00
drh
667b5cc985 Fix json rendering so that it shows positive and negative infinity as
9.0e+999 and -9.0e+999 respectively.

FossilOrigin-Name: efce4690a52592c4f5fc7d023eebe771b0e615bb03c0fe203493f853b28e8f85
2023-03-17 20:31:24 +00:00
drh
f204be8098 Add the ability to name functions using one of the join keywords like
CROSS FULL INNER LEFT NATURAL OUTER RIGHT.

FossilOrigin-Name: 0910b1925e97f7ae4dae86894c9e2f54273c85115e19d0d9bff1280ffee35eed
2023-03-17 19:18:17 +00:00
drh
2eacecfe51 Add test cases for functions named the same as join keywords.
FossilOrigin-Name: 94944b239ce674d984c88ef6029b0260a972f1b25f01614b559ca07c3ebaf8f5
2023-03-17 19:07:48 +00:00
drh
a84ead119e Fix assert() statements that would (incorrectly) fire if an IF NOT EXISTS
trigger that already exists contained two or more RETURNING clauses.
Tickets [89d259d45b855a0d] and [d15b3a4ea901ef0d].

FossilOrigin-Name: 648899e4ded72cac6cc24bccf7ebfc709ee7309a003452b21fd6ab0ba20c34b8
2023-03-17 00:01:32 +00:00
drh
b816ca9994 Correctly handle SELECT DISTINCT ... ORDER BY when all of the result set terms
are constant and there are more result set terms than ORDER BY terms.
Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24],
[d6fd512f50513ab7].

FossilOrigin-Name: 12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4
2023-03-16 20:54:29 +00:00
drh
7a9c235aaf Additional debug/test output from the query invariant checker showing the
row-number that is being checked.

FossilOrigin-Name: e4b6eb58e65f7fa0c92768f42bc820614169b7c2f37ded391b866ddb0d894de0
2023-03-16 12:28:48 +00:00
drh
db8c6aa03a Update the tracing output for the query-invariant checker such that it shows
the SQL that is run to verify that a found query-invariant discrepency is
valid.  Changes to testing logic only.

FossilOrigin-Name: 8f45ad27403e971d88ec62e674c03f82eb19df0b43aa58d20b3400cdb6611d90
2023-03-16 11:50:44 +00:00
drh
7d5a549121 Do not use the one-pass optimization on an UPDATE if there is a subquery
in the WHERE clause, since if the subquery is hidden behind a short-circuit
operator, the subquery might not be evaluated until after one or more rows
have been updated.  Fix for the problem reported by
[forum:/forumpost/0007d1fdb1|forum post 0007d1fdb1].  This is the same
problem that was fixed by [73f0036f045bf371] only for UPDATE instead of
DELETE.

FossilOrigin-Name: 2c56b984a0bd3be5ec326a2109ea7b8f1d4ef63c8fc325caac9663cf2479eaff
2023-03-16 10:17:30 +00:00
drh
ffcad5893a Disallow the one-pass optimization for DELETE if the WHERE clause contains
a subquery.  Fix for the problem reported by
[forum:/forumpost/e61252062c9d286d|forum post e61252062c9d286d].  This fix
is more restrictive than necessary.  It could be relaxed if the subquery does
not involve the table that is the subject of the DELETE.

FossilOrigin-Name: 73f0036f045bf37193b6e87ae45b578c5831614c530488257c69666178da3aa5
2023-03-15 17:58:51 +00:00
drh
cdfb518f6f Fix Bloom filters on an expression index.
[forum:/forumpost/2e427099d5|forum post 2e427099d5] and
[forum:/forumpost/d47a0e8e3a|forum post d47a0e8e3a].

FossilOrigin-Name: c028fb669a5ae34dbaf50fffab1ae49bc568b994435cf02e145d24da3cfb48d7
2023-03-14 20:08:39 +00:00
drh
80511f32f7 The check-in at [198b3e33dcfd74c7] caused a performance regression for some
queries, which is here fixed.  Problem reported by
[forum:/forumpost/b405033490fa56d9|forum post b405033490fa56d9].

FossilOrigin-Name: dc9f025dc43cb8008e7d8d644175d8b2d084e602a1513803c40c513d1e99fea4
2023-03-11 23:21:21 +00:00
larrybr
a9fffc179f Give CLI a no-more-options option. (--)
FossilOrigin-Name: 0822788752621f6bf6af44b420b594ddd352634b3b0ed0eb835abea34b45817a
2023-03-10 20:54:44 +00:00
dan
1211e1d112 Fix countofview.test so that it works with SQLITE_OMIT_PROGRESS_CALLBACK builds.
FossilOrigin-Name: 2fc7c3fcee05c2a251ceb3666f3f6e9014cfe6e2f8570b72c43f251067e6b252
2023-03-09 15:08:06 +00:00
drh
8c26e6fa16 Fix a possible NULL pointer dereference due to the sqlite3_interrupt()
enhancement at [bd8fa10e59f58886].  Reported by
[forum:/forumpost/f5a2b1db87|forum post f5a2b1db87].

FossilOrigin-Name: 84417bbd144b2197c9930a520feb94b59053957c190be79f8deaaaebca68ecf1
2023-03-08 23:05:18 +00:00
drh
217e860053 Fix a problem in the count-of-view optimization that can lead to incorrect
bytecode.  dbsqlfuzz 23d782160b71c3f8f535ccb2da313dfc8eb8c631.

FossilOrigin-Name: f45009533a79a59b302598ee2545ef787c51d0128f4e1dca60dd83589f660619
2023-03-08 00:47:53 +00:00
drh
cad225d6fc Fix a bug introduced 4 days ago by [e95439119ac200cb]: do not set the
Expr.affExpr field of a generated column expression if the expression is a
RAISE() function, as affExpr has a different meaning for RAISE.
[forum:/forumpost/b312e075b5|Forum post b312e075b5].

FossilOrigin-Name: 1096b5a7cc8104db01f8820ace47020baad2f12e6711e3a7b4514ed1becc7b66
2023-03-07 23:47:38 +00:00
drh
5b6ba9b250 Improvements to query invariant testing such that it uses the new
SQLITE_DBCONFIG_REVERSE_SCANORDER opcode to sqlite3_db_config() to make more
accurate judgements about when a query is ambiguous, and hence when query
invariant testing is approprate.

FossilOrigin-Name: be9ab292cd14889b1c9648b47138260b33fe5be282ff2d90653b1387885a7d02
2023-03-06 23:38:44 +00:00
drh
89b3cbed67 Fix to check-in [b9190d3da70c4171] - the agg-with-indexed-expr optimization
requested by ticket [99378177930f87bd] - that can cause an incorrect answer
if an aggregate subquery has a GROUP BY clause, and that GROUP BY contains a
term that is not in the result set, and the outer query makes use of expression
indexes.  Problem reported by
[forum:/forumpost/a68313d054|forum post a68313d054].

FossilOrigin-Name: e06973876993926fd56181281d04b8dd504c689abf883fa21a5721cc1d478ea8
2023-03-04 15:36:51 +00:00
dan
3410e550dc Make the SQLITE_DBCONFIG_STMT_SCANSTATUS option on by default.
FossilOrigin-Name: 5a09191186bc03b374e0c0d029e1a15208c6b845bc2f5f5f9f6a8a882809d9f3
2023-03-03 21:17:12 +00:00
dan
0433789863 When it is known when preparing a statement that X cannot be NULL, transform the expression (X IS NULL) to integer value 1 instead of 'true'. This is because under some circumstances, "Y IS TRUE" may not be equivalent to "Y IS 1".
FossilOrigin-Name: cc4bb05b3653e9502b95ea6fe0bfb77feebc11285b66e1dde4c7b945928efbf1
2023-03-03 16:25:18 +00:00
drh
dc81902445 Do not use an expression index on a generated column if generated column
has the wrong affinity.  dbsqlfuzz 65f5eb57f8859344d5f1f33e08c77ee12960ed83

FossilOrigin-Name: e95439119ac200cb47d0e277622f41ee7986b364487cd252b485ce5fa030d70f
2023-03-03 15:12:46 +00:00
drh
3f23ce664e When flattening the right operand of a LEFT JOIN
(check-in [41c27bc0ff1d3135]), ensure that the OP_IfNullRow opcode does not
NULL-out a subquery result that was computed within OP_Once.  This fixes
the problem problem reported by
[forum:/forumpost/402f05296d|forum post 402f05296d].

FossilOrigin-Name: 8fe13f7a5e5eb798189acb25a608df7a94c2f5cc83463331a048b779c7890c82
2023-03-02 13:49:50 +00:00
drh
bf90114867 When flattening a view that is the right operand of a LEFT JOIN, using
the optimization of check-in [41c27bc0ff1d3135], always insert the
TK_IF_NULL_ROW expression nodes, even for TK_COLUMN expressions, as
the TK_COLUMN might be a column from an outer query and hence still need
to be NULLed out. This fixes the problem described by
[forum:/forumpost/26387ea7ef|forum post 26387ea7ef].

FossilOrigin-Name: 198b3e33dcfd74c7ba6abcf789ee81dfed464a50ebf15c8edeff349d36789fca
2023-03-01 20:23:46 +00:00
drh
fe37348255 Follow-up to [bbaf1f2eb1e1637b]: Make sure subtypes do not cross a subquery
boundary even if the function that returned the value with a subtype is
buried down inside a larger expression.  This fixes a problem identified
by [forum:/forumpost/37dd14a538|forum post 37dd14a538].

FossilOrigin-Name: e72661eb680ea707a839cb3d5cf6c7ef03706e7b40af1b84760147e59cd61a50
2023-03-01 15:21:53 +00:00
drh
46960e4677 Do not attempt to apply the count-of-view optimization to a CTE.
dbsqlfuzz ef8623915d843b150c159166ee4548c78cc6895a

FossilOrigin-Name: abc3a383636c0346053b5d09d96585f56c64cacb5751673ea3bf339e4955d1cd
2023-03-01 13:54:07 +00:00
drh
f1f4f090c7 Activate SQLITE_DBCONFIG_STMT_SCANSTATUS in fuzzcheck.
FossilOrigin-Name: 4fe1419ac3161ea8735241b04913593170c636cf3e1583756fe94edd396cd38b
2023-02-28 21:23:46 +00:00
drh
0bdee38969 Updates to speedtest1.c and the speed-check.sh test script so that they work
with the new SQLITE_DBCONFIG_STMT_SCANSTATUS control.

FossilOrigin-Name: bd02df052e1ef78b5335915a38f3c5e13c3c04ab82fd251aeb42a440d1d39257
2023-02-28 20:06:30 +00:00
dan
06382de2a3 Change the name of SQLITE_DBCONFIG_STMT_SCANSTATS to SQLITE_DBCONFIG_STMT_SCANSTATUS.
FossilOrigin-Name: a63e4a150b505fc309fac847131009ee9965eb1b798ebcb202ec8b52f9189240
2023-02-28 20:04:01 +00:00
dan
45163fc45e Add an sqlite3_db_config() option - SQLITE_DBCONFIG_STMT_SCANSTATS - for enabling and disabling the collection of sqlite3_stmt_scanstats() statistics in SQLITE_ENABLE_STMT_SCANSTATUS builds. Collection of statistics is disabled by default.
FossilOrigin-Name: 0f5579bef27b84ee855065cfe87703c51e1f9773906a9e0d4e4dafc90bd0e553
2023-02-28 19:39:59 +00:00
drh
4990fc84f1 Only use a Bloom filter on an automatic index if one or more of the key
columns in the index can take on non-TEXT values.

FossilOrigin-Name: 5916705c731604d2e6b51a307cc8d7b67f4c102062bfdfcbc716a2916e0b0d86
2023-02-28 18:06:52 +00:00
drh
a353369f57 In the Bloom filter optimization, hash all strings and blobs into the same
value, because we do not know if two different strings might compare equal
even if they have different byte sequences, due to collating functions.
Formerly, the hash of a string or blob was just its length.  This could
all be improved.  Fix for the issue reported by
[forum:/forumpost/0846211821|forum post 0846211821].

FossilOrigin-Name: 090304b870419acb5b05205a07fc75830b556928149f76a843cda526f77a6fc0
2023-02-28 14:28:54 +00:00
drh
f43ffb30b0 When an automatic index creates a Bloom filter, show that in the
EXPLAIN QUERY PLAN output.

FossilOrigin-Name: d7b2ac1c1a31fa4285cf6df0995db7e7705bb6a1bc94850c14c94cc4e3eb239a
2023-02-28 13:46:01 +00:00
drh
baef8442d3 Further to [46639f682975dac6], the parameters of a table valued function that
is on the left side of a RIGHT JOIN do not need to be in the ON clause.  Add
new test cases and tags to associated test cases with the code.

FossilOrigin-Name: 18ee689de3d1ae43b05ca52e0b62c49442ebf68a88814a7c679e8856250a4b0d
2023-02-27 14:48:54 +00:00
drh
4edbcdd391 In the [/info/7c2d3406000dc8ac|omit-unused-subquery-columns optimization], be
sure to remove the EP_Skip and EP_Unlikely flags from the result set expressions
that get nulled-out.  dbsqlfuzz bf1d3ed6e0e0dd8766027797d43db40c776d2b15.

FossilOrigin-Name: 21aec65e5e2a01e58dd0bb8c8b9b29b8414373b53353fc7ca80a152fdd27566b
2023-02-26 11:36:35 +00:00
drh
acf8905425 Adjust testrunner.tcl to make use of the new number_of_cores TCL command
available in testfixture, and to use no more than half the available cores.

FossilOrigin-Name: e0122d3863ed03e7bb64400d6561cbc824ecb14d228949ffde443069dbb4223a
2023-02-24 13:45:51 +00:00
drh
4b04ced3e0 Fix an incorrect optimization that was attempted as part of
check-in [18de3a8e6b431a07].

FossilOrigin-Name: f32055e8110a2eac6c9e26d1d1e620f0668bcb475d49d309dc549cea05e1e582
2023-02-24 01:08:35 +00:00
drh
4df23a3248 Increased precision of floating-point to decimal conversions when the
floating point value has no fractional part.
[forum:/forumpost/d1387c3979c7f557|Forum post d1387c3979c7f557]

FossilOrigin-Name: 18de3a8e6b431a075143631eafdcf0e1b1a21868b417394c365d46d2feca10b5
2023-02-23 21:18:47 +00:00
drh
af03eb3241 Enable the count-of-view optimization by default.
Enhancement request [eaed8e36ce888f1e].

FossilOrigin-Name: a4aacdd323a854d771c8cb1e2e4cfc4fb66b0020cfed23525733603605f5c63b
2023-02-22 21:47:02 +00:00
drh
95dee6d2e3 Avoid computing the values for unused result-set columns in subqueries.
Performance optimization request [baa5bb76c35a124c].

FossilOrigin-Name: 7c2d3406000dc8ac5a99cc205b036356b67e4b0b94738592ffc5680749696904
2023-02-22 21:11:34 +00:00
drh
bcb3215630 Remove the push-down optimization restriction that was added by
check-in [1ad41840c5e0fa70] because it is no longer needed after
the enhancements to compound query processing in check-in [27655c9353620aa5]
This resolves the performance regression reported by
[forum:/forumpost/bcc4375032|forum post bcc4375032].

FossilOrigin-Name: aa6bd6dff751223e302575c60f335707e4bb820bff716cab3706b564e18ed7ed
2023-02-22 20:42:15 +00:00
drh
1603f7edee Fix stale requirement marks and fix a typo in the documentation for
sqlite3_preupdate_hook().

FossilOrigin-Name: 655991f5d9afdd3281049eb430921046e0ba90eef215020c2fb149adc0d3c4c5
2023-02-18 20:31:26 +00:00
drh
16cdb4b632 Fix a harmless typo in the test case added by [29fc06465efb948f].
FossilOrigin-Name: e0a0bf56f11f32f58705098e76c276deaf90cfa87e110032bdaad10ce9674f61
2023-02-17 22:48:46 +00:00
drh
ab31a5df93 Do not allow the COUNTOFVIEW optimization to run if the count() contains
a FILTER clause.  dbsqlfuzz 4f8e0de6e272bbbb3e1b41cb5aea31e0b47297e3

FossilOrigin-Name: 29fc06465efb948f98d2733bb25ffa1e0662a0189304006b3d0be9fec7dd28c5
2023-02-17 18:27:48 +00:00
drh
e43d101c83 A few simple test cases for the omit-unused-subquery-column optimization.
FossilOrigin-Name: cf8f57c53425d89619ece10edc197d7d28946d3b23fcb4f526330196c76d9cc1
2023-02-16 19:41:39 +00:00
drh
90b7af7715 Do not perform the omit-unused-subquery-columns optimizations on a
subquery that is DISTINCT, as that can lead to incorrect results.

FossilOrigin-Name: cc148503db8ef180bce984328da7e84959afadd6a9613c2d03bc1eafeb95dfad
2023-02-16 15:54:55 +00:00
drh
e3ec00ccb8 Do not compute result columns of subqueries that are never used. Make those
columns NULL instead.  This optimization potentially resolves the enhancement
request described by [/tktview/baa5bb76c35a124c|ticket baa5bb76c35a124c].

FossilOrigin-Name: 5dec3cc0225296a043d17f73126d477d90a604f82b3180628176d8f950adbce8
2023-02-15 17:53:17 +00:00
dan
bdb2ec409a Update testrunner.tcl to run zipvfs test scripts on unix.
FossilOrigin-Name: e6c8e19ab0d6e7526d4596b75a45bb6becaf3c029690f7e75c016eac803c9990
2023-02-14 18:09:40 +00:00
drh
d6ba4252b2 Ignore extra parentheses around a subquery on the RHS of an IN operator,
because that is what PostgreSQL does.

FossilOrigin-Name: ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712
2023-02-13 19:32:40 +00:00
drh
b4dc263ec5 Do not allow WHERE clause terms to match constant string index terms, which
can happen if DQS_DDL is enabled.  Follow-up to
[44200596aa943963].  dbsqlfuzz 54c9db85ed4af7055f5fd0d50877875c82b11d46.

FossilOrigin-Name: 2d2b91cc0f6fed8cb6f738dc7019047ce0f1e86b5eb8efa997095d08a32cbcb6
2023-02-13 18:42:01 +00:00
dan
0c69938511 Allow vector-IN expressions like "(a, b) IN ( (?,?), (?,?) )" to use an index.
FossilOrigin-Name: 1815b15ddb8785a25b7617aab19e13c2410b9377389c16a85176025b3d9400e8
2023-02-13 16:10:31 +00:00
drh
80e936aef0 Do a better job of detecting when a WHERE clause term might be useful to
an expression index.  Fix for performance regression reported by
[forum:/forumpost/e65800d8cb|forum thread e65800d8cb].

FossilOrigin-Name: 44200596aa943963bc6ca98b5d4fd5b9235d1109d8dfc1a75eeae353b4239142
2023-02-10 21:53:33 +00:00
drh
9a8330b550 New test cases added to fuzzdata8.db.
FossilOrigin-Name: be67bafccd79ba835ed7e287e09852ce83805da0797b164d0c8e44be05d9d28a
2023-02-09 12:47:15 +00:00
drh
601e4d4a0f Back out the 'txn' enhancement to date/time functions. The duration of a
"transaction" is confused and needs to be straightened out prior to moving
forward with this change.

FossilOrigin-Name: 4a145f07322d768a07619bed27e0390d50f3a01d07787b9296234a5ceb6f1218
2023-02-08 20:29:48 +00:00
drh
159cbfe1cb Test cases to show that CURRENT_TIMESTAMP and similar hold the same value
across a transaction.

FossilOrigin-Name: 7b2fa20e31b8a0314b9ccb97bb556898d552505dbc5943f248df3f86c0f4e008
2023-02-08 12:31:47 +00:00
drh
3393ee7ff6 Simplify the code and add test cases.
FossilOrigin-Name: d3bed4caff561e71c396cc869c5b4d9bf216ba203485e738c12ec62741f1aba5
2023-02-07 23:55:59 +00:00
drh
da3d655fd8 Remove the long obsolete "client/server" mode tests.
FossilOrigin-Name: 08e3114caec0633fc54f8febb7f4732b46a1f47508bbca0a6a2bff02591254d5
2023-02-06 15:46:34 +00:00
dan
6896da42c6 Update test scripts speed1.test and speed1p.test so they may be run by testrunner.tcl.
FossilOrigin-Name: e761d4b9c8dcacccc927d23f20fdf779a0ae5304281b5bd6aa998bade56f0a37
2023-02-06 15:46:01 +00:00
drh
634ed64312 Shorten the status line for testrunner.tcl so that it fits on an 80-character
terminal.

FossilOrigin-Name: b760a7307c453d95cf3b302c9867c84a9c899956c16c2ce1ea6cce8f025db425
2023-02-06 14:48:02 +00:00
dan
ee18659f69 Fix a formatting problem in scanstatus2.test introduced by [81c118d9].
FossilOrigin-Name: 928ab40edbf11c02b3f03e660051d9587243002b9220adc77f972c3758c12b19
2023-02-06 13:36:34 +00:00
dan
0bd0843eb1 Add the --fuzztest option to testrunner.tcl. Also, have it print whitespace over the top of the old report line before writing the new.
FossilOrigin-Name: d83ce01fe1f21edcc93ad4c6308026156f235bab75e16e15389e27ad388fb274
2023-02-06 11:43:22 +00:00
dan
2288ecbb9c Fix problems with test scripts preventing them from running with SQLITE_DEFAULT_MEMSTATUS=0 builds. Or builds without SQLITE_ENABLE_STAT4.
FossilOrigin-Name: c0fbc89ed26b6eb361c1a05e2fb0d78d101fe2daf2947bbe5e0e58e0c2a779a2
2023-02-06 11:02:31 +00:00
dan
e734207a79 Fix some test scripts that were failing with SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: 81c118d90b281b30f40b3eeefaeb2c8350aa40080b4fe7de8f21d263986c6acb
2023-02-06 10:47:57 +00:00
drh
072f48e556 Do not use a Bloom filter if any outer loop lacks STAT1 data, since without
STAT1 data, the query planner cannot make an accurate determination of
whether or not a Bloom filter will be useful.  This fixes the problem
reported by [forum:/forumpost/56de336385|forum post 56de336385].

FossilOrigin-Name: e6ab96bd0b9efc51fd703bf7e92b079943ad9a3b92183d434adc11fb7d238afb
2023-02-05 20:29:10 +00:00
drh
e88b209874 In fuzzcheck, only show the description of each database if the -v option
is specified.

FossilOrigin-Name: 6a58179aaffa77a5542ab620ffce6f68135e399de957b1a97113fd2f1dc0c098
2023-02-05 17:09:18 +00:00
drh
fdde4042eb Modify the status line output from testrunner so that each line overwrites
the previous rather than scrolling.

FossilOrigin-Name: ad4d28cd68589a9259069c77c8d375ae49cfd0bcdf3b03d3e84418569e12ebfc
2023-02-05 00:32:32 +00:00
dan
a3d4d7a0ae Avoid running rbu tests under permutation "journaltest", which does not support wal. Fix some other test script problems.
FossilOrigin-Name: 92f018698a87ed32acc31d83f7246dbb7295867bd6a801b7984a16f97a5c7786
2023-02-04 21:25:17 +00:00
dan
b713d501f6 Changes so that wapptest.tcl still works.
FossilOrigin-Name: 7624de3a93e03e9e825b1a283ccde8ad3aa41f93dd5c7f63692620a5177cbda9
2023-02-04 18:58:51 +00:00
dan
0415dd9c56 Update testrunner.tcl usage message.
FossilOrigin-Name: b7c246bc3f462098f6281ee2cd2e4e870b6d6481263d277f04956596a4764558
2023-02-04 18:50:16 +00:00
dan
4e5ff3b820 Add testrunner.tcl "njob" and "status" commands.
FossilOrigin-Name: 3869cd3d306ed68ec6e118aa10b4e835f2bab1294039888d88a30b3cfcf1d7be
2023-02-04 18:47:59 +00:00
dan
bd55d3ddab Fixes for testrunner.tcl on windows.
FossilOrigin-Name: b98e19fc41cb7f89ae9e063b8af414bc01d14833a14de5d646069483ef0127b2
2023-02-03 21:18:58 +00:00
dan
33d3559736 Have testrunner.tcl run various builds as part of the 'release' command.
FossilOrigin-Name: ba2fae30a81e2574f13a7351c9f843b8c2c7d2c93fcd71fb2de98f5b34f3e109
2023-02-03 18:47:00 +00:00
dan
60228cb3d2 Avoid using Tcl command [clock] in testrunner.tcl.
FossilOrigin-Name: b2faf9289f6fbbcd4491e1b063da731b35aeed9ff1fc97f64798e99cac847b4a
2023-02-03 11:32:51 +00:00
dan
e18fdcd35f Do not run test script pendingrace.test as part of the inmemory_journal permutation.
FossilOrigin-Name: 69d934a1bfad86f3f60dab146db539645f5735f1bdb07dfe3a3d88828a03390b
2023-02-02 20:15:42 +00:00
dan
b0c8e2f900 Add configuration data for osx and windows to testrunner_data.tcl
FossilOrigin-Name: e45d34656a110f85671d8b5d33f0d6d807fd64dfef5777fefba22ac6836f0e86
2023-02-02 19:41:43 +00:00
dan
986c22a6d0 Update testrunner.tcl to use a separate process for each test script. And to run some extra tests too.
FossilOrigin-Name: d090948a69a9c4b86693bd3caedba3d7e5883e4b2ad1f2d4bf7ae14c105ddea7
2023-02-01 20:14:59 +00:00
drh
54725efd80 Just because a CTE is used more than once, does not mean it should be
tagged with M10d_Yes and thereby prohibited from participating in the
query flattening optimization.  See
[forum:/forumpost/1d571c02963355ed|forum thread 1d571c02963].

FossilOrigin-Name: 66f29c403d28630bfaea9124bd63ee4a047b1fe4a7e27dc5d10d67d1601b15e0
2023-02-01 15:41:07 +00:00
dan
ca3aabdf53 Fix a race condition during hot-journal rollback that could theoretically cause spurious corruption errors.
FossilOrigin-Name: 20ea53ddf590a9dd19501fabd2bfdb9c10b5eb265cd2995bdb335769c936c763
2023-01-31 20:21:06 +00:00
drh
f7af9ba13c Additional tweaks to the enhancement at [609fbb94b8f01d67] to further reduce
the cost estimate for constructing an automatic index on an ephemeral table,
in order to resolve the performance problem described by
[forum:/forumpost/1d571c0296|forum post 1d571c0296].

FossilOrigin-Name: bf1aae7a8c7f2c74681aa29baa35259d10ce6a1737d2607def6bf27fed592131
2023-01-30 20:44:54 +00:00
dan
20438431c8 Fix a problem causing "PRAGMA quick_check" to return spurious corruption errors for a WITHOUT ROWID for which all columns are either virtual or part of the primary key, and for which the order of the columns in the primary key definition is different from the order in the table.
FossilOrigin-Name: a7530f897127f35a212db6557edbcbbb286cc0e094754c1c1b74ce8dbf724470
2023-01-28 17:37:37 +00:00
dan
54c9250b09 Update sqllimits1.test to account for the fact that if an odd value is specified as the length in bytes of a utf-16 string, it is truncated to the largest smaller even number.
FossilOrigin-Name: 74508470c4caff04638e750cd84073f3137b8a9f72c6fe390a279da7b1c13398
2023-01-28 16:37:30 +00:00
dan
3db12cd7c4 Have some RBU tests run as part of veryquick.test/testrunner.tcl.
FossilOrigin-Name: f51406e3bf92f2b46f13d08fb7c7fe7683feba68b5a8fa18f6f6b8845662deac
2023-01-26 18:16:51 +00:00
dan
a0fe1e7d13 Fix a problem with fts3 auxiliary functions and one or more NEAR expressions ORed together.
FossilOrigin-Name: de4690a10ad4631e7452ccbb05b177a821d9dda387a854d216a6c54c7a189ead
2023-01-25 15:45:45 +00:00
dan
0fa2bbf9e1 Fix another problem with fts3/4 auxiliary functions and NEAR expressions that consist entirely of deferred tokens.
FossilOrigin-Name: a8c91c132f6157b7e3649f57a799984b1d7f8a18fd434515c875617d4195db29
2023-01-25 13:42:55 +00:00
dan
f36fa4e902 Add scalar SQL function unhex().
FossilOrigin-Name: 890e9629a7480138c9c1d3acc2d1e7b3c05e0d156e5c5fba428bc1aeb790fbfb
2023-01-24 20:17:43 +00:00
dan
a50db438eb Update unhex() to allow a second argument, specifying a set of characters that are permitted to appear between pairs of hexadecimal digits.
FossilOrigin-Name: 66c8562690b19f17972589611810e1dccad3a48777acb05208289c1f77076f71
2023-01-24 17:19:47 +00:00
dan
e35d1e1e6a Fix a problem with using fts3 auxiliary functions with expressions like "E AND ...", where E is a NEAR expression that consists entirely of deferred tokens.
FossilOrigin-Name: 39bfae4c4698a13e07c4a0725f2790955e03b601fe64e17a000c691def1bdcb8
2023-01-24 11:24:28 +00:00
dan
e3c11d55db Add experimental user function unhex().
FossilOrigin-Name: dbe424b5db33ce2c7562dfb44daf2969cf3074234cc891eb9b8d0d907faf6a78
2023-01-23 14:11:34 +00:00
drh
a96cd076fe Extend the carray extension to allow the use of BLOB values to be bound
as an array of "struct iovec" objects.

FossilOrigin-Name: e117a03ca6560e958884f277db827c51ae337a970c17143a0a5f9b150f52f87a
2023-01-20 21:00:03 +00:00
dan
d993b15aa3 Ensure that the database encoding cannot be changed while there are statements running. And that the connection is left in a valid state after an obscure OOM within sqlite3_deserialize().
FossilOrigin-Name: a02da71f3a80dd8e817e89cdaa775c95e38c90d2471f8fec516bed086539e2c0
2023-01-20 17:50:24 +00:00
dan
ab5ebc4082 Add tests for changing the database encoding via RESET_DATABASE/VACUUM. And test that it is not possible to trick another connection with this.
FossilOrigin-Name: b869054acb8f171cbc16808eb87be85e6e38d5c5670522ff4e49aef92250d5b2
2023-01-20 15:13:30 +00:00
dan
b8f9913baf Fix numbering issue in and remove duplicate test from windowB.test.
FossilOrigin-Name: fa10e561f5dcdb23af862c2e486e877d379f12eae077ae5fd3da6028f1c20b49
2023-01-19 18:16:09 +00:00
dan
19ab86f3ff Update virtual tables json_each and json_tree so that adding "ORDER BY rowid" to a query does not require an external sort.
FossilOrigin-Name: ce18f0ed684824e67ed6c09acab8e735fef2c52b2ed32270dee1a2a67802c59b
2023-01-17 15:46:27 +00:00
drh
c37af308fa Add test cases to confirm that the schema parsing quirk in which an
ON CONFLICT clause is accepted and ignored on table CHECK constraints but
raises an error on column CHECK constraints.  We want to continue supporting
this harmless quirk to avoid breaking legacy applications and databases that
accidentally use it.

FossilOrigin-Name: 92b6a9cd0fb027fe675b3913aa07c75445bba0cfac9530d08d7e48f7869c04cc
2023-01-17 13:33:51 +00:00
larrybr
e8f114baa6 Cause .clone to not trip over sequence table as reported at [forum:/forumpost/71ff9e6c4c|forum post 71ff9e6c4c].
FossilOrigin-Name: b44d04f7b051d807a81152a6e4f15a765f7b9ed1f01b48b40dc5420c11e0c251
2023-01-16 21:49:37 +00:00
drh
475e76d43e In expression nodes of type REGISTER with sub-type COLUMN, ensure that the
iColumn field is set correctly, as otherwise the "IS NULL" operator might
be incorrectly optimized.  Fix for the problem described by 
[forum:/forumpost/d010a26798915b53|forum post d010a26798915b53].

FossilOrigin-Name: 0819a1869a39d54a405259ea323365506a182962a02affdef16a03446005da64
2023-01-13 19:29:46 +00:00
drh
2fc9dc9330 Fix sqlite3_prepare() so that it only invokes the progress handler on every
N-th call to sqlite3ProgressCheck(), where N is the progress handler step
count.  Also fix faulty asserts exposed by the ability to interrupt in the
middle of sqlite3_prepare().

FossilOrigin-Name: 05461651599bb490ac6cfd893645dabab9cccedc6adcce15aee2487b2ea6027a
2023-01-12 19:51:49 +00:00
drh
3b7a19b033 Add a new sqlite3_is_interrupted() interface that can be used by long-running
app-defined functions and similar to see if they need to exit early due to
an sqlite3_interrupt() call.

FossilOrigin-Name: d030f341369b7f32789cbcf3d0ad9a2ac5cad99a56dac7dfe68b7f06dc339b17
2023-01-11 00:27:06 +00:00
drh
706631de32 When computing the datatypes for columns in a view, use the same datatype name
as the underlying table if such is available and is consistent with
the computed affinity of the column.
[forum:/forumpost/7fb1fe9dcf310ef5|Forum thread 7fb1fe9dcf310ef5].

FossilOrigin-Name: 497a98363fd1ed079544620ec5d0883f987ed03013131542741c93d7568e8568
2023-01-10 19:57:26 +00:00
dan
2e77734b98 Fix handling of unix paths that contain ".." components such that "/" is considered its own parent directory.
FossilOrigin-Name: 3c6cadb396de3981bd950eddd532daa8134bd4bf22c578620e323835c96a8500
2023-01-10 14:31:56 +00:00
drh
6791891f92 Fix JSON functions so that they work correctly under PRAGMA trusted_schema.
[forum:/forumpost/c88a671ad083d153|Forum thread c88a671ad083d153].

FossilOrigin-Name: 51a5d83c425d2e31508b73074d0076156817afb19003f847d16bf4a69ae5077b
2023-01-09 12:01:30 +00:00
larrybr
4ff47d3e37 Doc-only update, sqlite3_preupdate_hook() return
FossilOrigin-Name: 2da51d7e1b9f16ef03efbb096ce2a84e8c23b883380f48b2d374bdc521865aeb
2023-01-07 22:28:00 +00:00
dan
e3b1c3868b Fix a problem with applying integer affinity to a MEM_IntReal value. Forum post [forum:/forumpost/d270125fae|forum post d270125fae].
FossilOrigin-Name: e58bba93717cd6ff950c6f9e077b4327b59b1956dd5f6668be3de9509584b8fe
2023-01-05 13:35:23 +00:00
drh
b8a655beeb In the zipvfile extension (which is not part of the SQLite amalgamation, but
which is included in the CLI by default) ensure that fopen() is not invoked
using a NULL filename.  Fix for the issue reported by
[forum:/forumpost/d1c96a9032e564f8|forum post d1c96a9032e564f8].

FossilOrigin-Name: d32757ddf5d311b6f62545c861fd606244e03f02cb2e317c1131ee6b80c2299c
2023-01-05 01:26:58 +00:00
dan
52c08ee982 Ensure that LIMIT clauses may be passed through to virtual table implementations even if the WHERE clause uses operators that may only be optimized by virtual, not built-in, tables (!=, functions, MATCH etc.).
FossilOrigin-Name: f38caab23bcef1df02618376de22d208a3333d023628cde310345505933329f1
2023-01-04 17:46:29 +00:00
drh
d0fe0fc531 Enhance PRAGMA integrity_check so that it verifies that the string values
stored in indexes are byte-for-byte identical to the values in the table, and
not just equivalent according to the collating sequence.
dbsqlfuzz 686e2e205e0c0594d3fb524bea0c25e621d1a870.

FossilOrigin-Name: 9302e4bfdce5905576b8f0af7d6b3a864e1dcd58ed89bb303010a1c4f826e915
2023-01-04 15:18:52 +00:00
drh
12e1eb344f A call to sqlite3_declare_vtab() should not cause DML/DDL authorization
failures.

FossilOrigin-Name: eed1e030722deb24674e7c2d165a2a359576c6bb5769d3bdd5fa645bc0f2ecc7
2022-12-29 18:54:15 +00:00
larrybr
0953c5354a Add base64() and base85() text/blob conversions to the CLI.
FossilOrigin-Name: 4bc98a2d9520efa9b80142163cbfab72a5f2fe9854cd6ba8291dcefdb872e657
2022-12-23 19:04:59 +00:00
stephan
913dcaf0ca sessionfuzz.c: use lt/gt brackets instead of double-quotes when #including zlib.h, as reported in [forum:91a104bd65 | forum post 91a104bd65].
FossilOrigin-Name: 7d7780c350f3239f9c9feb91924a01a4eba31b88060946c766719c9d50c16bcd
2022-12-22 10:53:08 +00:00
drh
87bdc152a1 Add about 150 new fuzzer cases to test/fuzzdata8.db.
FossilOrigin-Name: a8d8d9cd65e64e0a492a80c00050f54ab75de82651230049f65c9d2b78a164f2
2022-12-20 15:22:57 +00:00
drh
1379b9f51a Improvement to the dbsqlfuzz fix of [f113eebdbe68246f].
FossilOrigin-Name: 79d62956f206cb2987891d4ba5985cece21fc8c8c1158f46c2951f65c0dcf4e8
2022-12-20 14:02:35 +00:00
drh
98164c3452 Do not use indexed expressions to replace the expression being indexed on a
RIGHT JOIN as that leads to problems, as shown by
dbsqlfuzz a644e70d7683a7ca59c71861a153c1dccf8850b9.

FossilOrigin-Name: f113eebdbe68246fd38d640b0cdf0fd73ab5d2abad9226274dfa2e41fe286bf0
2022-12-20 01:48:43 +00:00
drh
a9d18d83fc Disallow some of the query invariant tests on SQL statements that contain
a GROUP BY since output terms that are no covered by the GROUP BY are
indeterminant.

FossilOrigin-Name: 28ba1fec4519e7ca9466f1a2f787c905f2cf880d38a004639f99f948e46a51e7
2022-12-16 18:32:07 +00:00
drh
d980442188 In the fuzzer invariant checker, do not add new WHERE clause terms that
make use of an ambiguous column name.

FossilOrigin-Name: d5b46541c30bcbeb7e57b5b5951856d564e81f7f9638d66d205157797964418c
2022-12-16 12:07:48 +00:00
drh
00d6b2755f Create a new affinity called FLEXNUM that works like NUMERIC except that it
never tries to convert integer to real or real to integer.  The affinity is
only used internally - it is not possible to create a table column with this
affinity.  This affinity is used on subqueries and views that are built off
of a compound SELECT and where the datatype is controlled by a CAST expression.
dbsqlfuzz c9ee6f9a0a8b8fefb02cf69de2a8b67ca39525c8

FossilOrigin-Name: 44135d6ea84f7ba6b36549954b38a8bc048d5ffea5a9779e35950afa4eb2dfb2
2022-12-15 20:03:08 +00:00
dan
118b53bd21 Fix an incompatibility between the Tcl interface and the "memdb" vfs by allowing memdb to accept filenames that begin with '\' characters.
FossilOrigin-Name: bd537f2057a4800bd30e7dd57405c3e57df649471104c80bd32573a89568029e
2022-12-15 18:56:12 +00:00
dan
8b58fbf5ee Update a test case in scanstatus2.test to account for recent planner enhancements.
FossilOrigin-Name: 53e07dc6b6521bb7757d0bc2cf12a501bb929afafdb16737058496afca8e6742
2022-12-15 11:39:12 +00:00
drh
604314d94e Merge all the latest trunk enhancements into the coroutines-exp2 enhancement
branch.

FossilOrigin-Name: ea278438b72e85d217e72c836cbefd68bd8b336baf33507b2d8d12ef436424cd
2022-12-14 17:52:15 +00:00
drh
ed07d0ea76 If the SELECT that implements a subquery or a VIEW or a CREATE TABLE AS is
a compound with different result datatypes on two or more arms of the compound,
then the overall column type becomes BLOB (ANY).

FossilOrigin-Name: 6ebb178c6b688ebd632e91a5ec4c748567833037c679ab3d72fb770deb230fe1
2022-12-14 14:41:35 +00:00
drh
a8b5c8739c Back out the part of the change in [88a05141c28e5ff1] that adds affinity to
the materialization of a view, as the affinity can be undefined for a compound
query.  This passes all TCL tests, but shows failures in the TH3 tests derived
from [forum:/forumpost/6f842bc5b2dadcb2|forum post 6f842bc5b2dadcb2], presumably
because the WHERE clause of the query uses constraints of the form
"source_crs_code='8675'" instead of "source_crs_code=8675".  Perhaps further
changes on this branch should reimplement affinity on joins in cases where
the affinity is unambiguous.

FossilOrigin-Name: fe5a77bcc4de8f49cc4fe6bd2e2e1f31da8d3bc84120daaa99eb853b06291d15
2022-12-14 09:06:45 +00:00
drh
177b8c9c28 Use standard datatype names for the column datatypes in views and subqueries.
FossilOrigin-Name: baf2c2413346feb72ecb0bac800be9b945ebb4e01b42212132434d8ddef9cad0
2022-12-13 16:55:23 +00:00
drh
393021938d Merge recent trunk changes into the coroutine-exp2 branch.
FossilOrigin-Name: c43f433bcab29db0f1f8afd3948f5a4149e1f277c853c66f99c31f226d82bc0f
2022-12-13 00:51:34 +00:00
drh
7ca4312ff2 Further fix for ticket [57c47526c34f01e8]. If a subquery has a result set
column of the form "CAST(expr AS NUMERIC)" do not give that column NUMERIC
affinity.  NUMERIC affinity always goes to an integer if able, but a CAST
to numeric is a no-op if the input is a number.  So the two are not equivalent.

FossilOrigin-Name: f0325359d5795237b79f90f21b42d7d942c7e918137cb0231d404365d3041e81
2022-12-12 21:22:23 +00:00
drh
89e160a96a If a subquery has a result column of the form "CAST(... AS NUMERIC)" then
give that column no affinity rather than NUMERIC affinity.  This is because
casting to numeric preserves real values that could be integers but numeric
affinity does not.  By using no affinity on the column, we make the behavior
consistent if the subquery is implemented as a co-routine or is materialized.

FossilOrigin-Name: ece07d091c2ef3367a914187e0b6512c1f2390b8c34844536ad50e88c7e8c2f2
2022-12-12 18:58:53 +00:00
dan
6fce561905 Ensure that the types and collation sequences of a view are taken from the leftmost component of compound SELECTs, even when column names are explicitly provided for the view. Possible fix for [679ed6a2].
FossilOrigin-Name: b0e49aa81a09c183b8baf8346b8a9b593c2b13073958617b6594500958d5bd46
2022-12-10 17:54:55 +00:00
drh
a60d61bf14 Improved comments on the new co-routine logic. Fix a C++-ism in the code.
Update test cases to accommodate the more aggressive use of co-routines.

FossilOrigin-Name: 9243e850ae656d16adc8f0e5c4dcf3dcf476312cee192c39c38685fc437ccbbd
2022-12-08 16:47:16 +00:00
dan
f2cc3387f7 Have sqlite3_stmt_scanstatus() report cycle, loop and row counts separately for creating an automatic index and using that automatic index.
FossilOrigin-Name: 3bc9df82ea5b0fb085c56a326a65e19c9baf98d48d8fa6344c0d7004747594ba
2022-12-07 17:29:17 +00:00
drh
b54f71e205 Fix a (harmless) off-by-one error in code generation that comes up when
doing a DISTINCT query against a virtual table with an OR term in the
WHERE clause and where the ORDER BY clause has 64 or more references to
the result set.  [forum:/forumpost/dfe8084751|Forum post dfe8084751].

FossilOrigin-Name: 04af7ef77043702f93cbff23548610759786893bd3d4d6fc08181e1e249c6663
2022-12-07 00:14:25 +00:00
dan
2adb309ead Have sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not just virtual tables ones. The value returned is the sum of the NCYCLE counts for the various opcodes that move or read data from the table or index cursor associated with the loop.
FossilOrigin-Name: 9499b2f51e8174c6b8a67840c92ba23b7dd1dc8dc2b91fca0c5dc07b71662149
2022-12-06 18:48:06 +00:00
dan
d2db31c971 Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of enhanced query performance reports.
FossilOrigin-Name: 4893b4e3eafc7c9c22b24717f90a585862203f987cf108b079ce6e946093e675
2022-12-05 19:16:23 +00:00
dan
77e171e8fa Merge latest trunk changes.
FossilOrigin-Name: 1a72777b1279f74f212fb2f675a4594a238e5d28f048879d7f5ad5287673c3c4
2022-12-05 18:26:37 +00:00
dan
a3d0c158a0 Add loops and rows counters to "USE TEMP B-TREE FOR ORDER BY" records. Also fix the sqliteHwtime() function so that it returns a 64-bit value.
FossilOrigin-Name: 41a0e05e8c0fca3b803fe4bd017a157c172b2ca518356a2a4d4ed4f12d01a1e3
2022-12-05 18:19:56 +00:00
dan
49d402684b Add test case that should have been part of previous commit.
FossilOrigin-Name: dc7dd2d3e50e7cc474b22f1b5b219da32bcd7aa1ba56864d1dbcf0d3a6fa06f2
2022-12-05 14:20:54 +00:00
drh
95ade3bdb9 Improved query planner cost estimates. Fix for ticket [e8b674241947eb3b].
FossilOrigin-Name: 1b779afa3ed2f35a110e460fc6ed13cba744db85b9924149ab028b100d1e1e12
2022-12-05 02:52:37 +00:00
larrybr
8af6d712da Fix safe mode authorizer callback to reject disallowed UDFs. Reported at [forum:/forumpost/07beac8056151b2f|Forum post 07beac8056151b2f].
FossilOrigin-Name: cefc032473ac5ad244c0b6402c541b2f76c0c65a041bda03bfbe7c0e2c11fac2
2022-12-04 23:20:38 +00:00
dan
ad23a47acd Enhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables.
FossilOrigin-Name: 622d8eb3724bee617b55d6fb71f1a2d683db6858065adced6bf3ce9525bcd6b5
2022-12-03 21:24:26 +00:00
dan
f6f01f15dd Add CYCLES scanstat measurement to "USE TEMP B-TREE FOR ORDER BY" lines.
FossilOrigin-Name: 365011ae8b7e3fcaa2c4ea9601231a3ef2223e60d7a53ec33013109dca22ad58
2022-12-03 18:16:25 +00:00
drh
fcf4243c36 Add a test case to show that ticket [e8b674241947eb3b] has been fixed.
FossilOrigin-Name: e20de6d450c2b4d5bde737f625de16ff53262c22ce7aa6917b64f1665170d33f
2022-12-03 17:23:29 +00:00
drh
1edd0a089c Tuning the query planner by adjusting the weights that predict the relative
performance of sorting and index lookup.

FossilOrigin-Name: 9f2806da4d88beceac2e81e05421f00481dd3dd100b096cd2ae6c828adb42ca7
2022-12-03 00:52:21 +00:00
dan
231ff4b027 Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports.
FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb
2022-12-02 20:32:22 +00:00
drh
cbb9585805 Test cases added derived from the enhancment ticket.
FossilOrigin-Name: c022c0152ad61a4f56e36f4062609073e2273fbf6f826c20652159be229c2d46
2022-11-28 18:17:42 +00:00
larrybr
d8d68a5b8e Sync w/trunk, zap surplus space.
FossilOrigin-Name: b8345630a2a322234bda49ee4b996f6ba20e2b080621e229a2ec5e820892a663
2022-11-28 14:11:48 +00:00
dan
abbfa7aa17 Ensure the RETURNING clause is honoured when a row of a temp table is updated by an ON CONFLICT clause.
FossilOrigin-Name: a2449bcc2c71d0f4c3289621fbf1cb97f0f407c9f7b5bf18245b7854a07c6cfa
2022-11-28 13:47:27 +00:00
larrybr
c1ca183abf Conform CLI .trace arg handling to its help.
FossilOrigin-Name: 31546ea320e8daa020f8a9f491718ffc3dde0e32954018afed88e8494a6aff6c
2022-11-28 02:28:44 +00:00
drh
ae5cfda656 Immprove the query planner such that it is able to make use of indexed
expressions within an aggregate query with GROUP BY.  This implements
enhancement request [99378177930f87bd].

FossilOrigin-Name: b9190d3da70c41717eb188474fd225ee43d0b46646e1b03de5967bd332553870
2022-11-25 16:10:48 +00:00
drh
23f61a4ba8 Add restriction (9) to the push-down optimization: If the subquery is
a compound then all arms of the compound must have the same affinity.
dbsqlfuzz 3a548de406a50e896c1bf7142692d35d339d697f.

FossilOrigin-Name: 1ad41840c5e0fa702ba2c0df77a3ea126bd695b910b5d1271fa3129c38c58f5f
2022-11-25 15:52:00 +00:00
larrybr
472de149ae Speed up base85() conversions and sync w/trunk.
FossilOrigin-Name: 17b823500a2ed135c1f40aa7f4d87ba5b2eab35c0abd9e0856041cf0f510cbee
2022-11-24 20:11:34 +00:00
dan
eb84c81c53 Fix a test case in fts3expr4.test to account for different locales.
FossilOrigin-Name: a2b6883ac2ef878f525ee847b170beb9f9ab9d1fa67557101be2cdae1e7f7a57
2022-11-24 17:58:55 +00:00
dan
647b0dd12d Update multiplex3.test to account for the fact that the multiplexor xDelete method may return an error even if it manages to delete the first chunk of a file.
FossilOrigin-Name: 1a7f3254735054ed8ca32d5ec7c8cde9195a64702638bdc50392007e396fead2
2022-11-24 15:32:00 +00:00
drh
b669bb5e2b New test cases. Fix the logic so that it works for GROUP BY aggregates
that do not require sorting.

FossilOrigin-Name: ef6ebe7922f56c1584a005deedc85ca1070b4fe5082ada8bbf8d06df54f1c9ef
2022-11-24 13:19:25 +00:00
larrybr
9b9017def4 Speed up base64 conversions, and add test with more data for the baseNN conversion to grind.
FossilOrigin-Name: 6c84ae4ba83713c751fddff8be41686bbcb525ac8135e1520436c62d0bc23d2c
2022-11-24 02:59:33 +00:00
drh
9b80cb5f39 Add explanatory comment to the new optimization. And add a test case.
FossilOrigin-Name: e6c20f61de7d048eee65c8e74a3eb36760ab9747ebd1ab50e49642b777c10306
2022-11-24 01:40:20 +00:00
larrybr
809be56218 Add more baseNN tests, get oversize error trapping working, and sync w/trunk
FossilOrigin-Name: 03819e9368fd9f78f351147a1dc865743f9634893e43a9d1e3d7cbaf4c966069
2022-11-22 22:46:41 +00:00
larrybr
bf82c95e08 Add test/basexx1.test to test is_base85(t), base85(x) and base64(x). Sync w/trunk.
FossilOrigin-Name: 4e4334547795f659b4a5dc5fdaf842535643750a5f1ce1af799c526931a473e4
2022-11-22 19:04:09 +00:00
drh
d8e48fffdf Fix corner cases in UTF8 handling in the REGEXP extension.
[forum:/forumpost/3ffe058b04|Forum post 3ffe058b04].

FossilOrigin-Name: abb18f61c5cec0f524acc41453b4c06b61c5af51ff46417588837fc0c3967288
2022-11-17 19:24:39 +00:00
drh
1da477d3ab Change the fake_big_file test command so that it fails for files larger than
2MB on Windows, as we have observed that Window10 will sometimes bluescreen
when operating on very large sparse files.

FossilOrigin-Name: d39ffd2abadcc85c46ba17612f9f575005b4818e18bf39362b8ee574837cfad9
2022-11-14 18:57:21 +00:00
dan
cfce889cda Avoid running bigsort.test with SQLITE_DEBUG builds. The assert() statements added in [7c96a56] make it too slow.
FossilOrigin-Name: fa68dd8928c76888d535e649794743eeefd3abe0f909792a128955710bfc948a
2022-11-14 17:48:26 +00:00
drh
7e475e571f Disable the ability to change the schema_version cookie when
SQLITE_DBCONFIG_DEFENSIVE mode is enabled.  This is a security
enhancement inspired by the question in
[forum:/forumpost/2b9cc3dae1f1e5f6|forum post 2b9cc3dae1f1e5f6].

FossilOrigin-Name: 1d81381e8f5db5d7064cc313b8544ca3cb1ca9e8cd61e71368a2d2e598befc9c
2022-11-12 17:17:01 +00:00
dan
50ba1a0213 Fix a problem with URI formatting in calls to sqlite3rbu_vacuum(zDb, NULL) causing problems on win32. First reported here <https://sqlite.org/forum/forumpost/a7ae915a9d>.
FossilOrigin-Name: 77ccc8ea8a901df64feabe08e1210087d060f0bc133242e87a94a71b68b5b5fa
2022-11-08 20:04:05 +00:00
dan
afe768193f Do not attempt to run test script dbpagefault.test with SQLITE_OMIT_VIRTUALTABLE builds.
FossilOrigin-Name: 901918c4867557e51160ef9c495e4e007de26cfe07c237addc00a388662957e8
2022-11-08 19:36:26 +00:00
drh
da01757870 Fix requirements marks so that they match documentation corrections.
FossilOrigin-Name: 10d6189d23133006b39ea230045a918483721dd48f5558f77e57e23693097d16
2022-11-07 12:21:06 +00:00
dan
f53c0a0d4e Update test file dbpagefault.test to account for the restriction on using SQLITE_VTAB_DIRECTONLY virtual tables from within triggers.
FossilOrigin-Name: 2b68fc8aa35cc69e4d2c26aaebbf3f2b1f1c08d15ca9efcbe5be21d45735d3f1
2022-11-05 19:26:45 +00:00
dan
a16edfa29b Tweaks to recover module test scripts to work with various permutations.
FossilOrigin-Name: 454c61e818f6941c9a23f6600e37828a3f2b2ad3c6dbc8d6223570aed5d9cd8b
2022-11-04 18:32:45 +00:00
dan
5f7e173abf Another test case fix for auto-vacuum builds.
FossilOrigin-Name: c1c47eff48e0831b5aed987e90d797aee99caf1861fa8318c6c3ecfb108de7e6
2022-11-04 17:07:33 +00:00
dan
80dbd818f2 Fixes to recover module test scripts so that they may be used with SQLITE_DEFAULT_AUTOVACUUM and SQLITE_SECURE_DELETE builds.
FossilOrigin-Name: 0e5597ce5353dea2cdb092b166b57ba1d60f8115eb468349f2b2869803691a2c
2022-11-04 16:39:39 +00:00
dan
4868a86513 Add another test case for the OP_Found fix.
FossilOrigin-Name: 6cdd64a445fe16d547d7bf5ea26dad3ab6d9d5f7d1c2b49fdc9d7a2edaa031c6
2022-11-04 11:59:40 +00:00
drh
093677add4 Enhance the ability of the OP_Found and similar opcodes to detect truncated
index records and report SQLITE_CORRUPT.
dbsqlfuzz 2b12f90aeff8e081706c7e9b58834f04869f446c.  Test cases in TH3.

FossilOrigin-Name: 059a09da2c5fd9c7e723c713565fbaf71602079feef0704129cc5cbbd0033936
2022-11-04 11:54:42 +00:00
drh
2cdcc7f01a Clarify documentation regarding the --recovery-db option to ".recover" and
the magic 789 configuration option it is associated with.

FossilOrigin-Name: f6fa0cffa921ccde8910e7fa4a63c2e4ef8ddb376c8ce99e436b27ac332c4498
2022-11-02 14:08:26 +00:00
drh
b6d9167945 Do not flatten a UNION ALL subquery where the column affinities do not match
on all arms.  Force that subquery to be materialized.

FossilOrigin-Name: 1b8a128832c1633cbb86999d347fef64ac45fe134dac61132112fc97f24676a0
2022-11-01 01:07:29 +00:00
drh
5fdb9a352c Enforce column affinity on the materialization of a subquery or view.
FossilOrigin-Name: b6692de374d7f489d8cf8877bdfef19501bc5ecb0781d42750807eeb58f2e7cd
2022-11-01 00:52:22 +00:00
drh
053bb22f35 Fix harmless compiler warnings in testing code.
FossilOrigin-Name: 2f53612388507f9b1ecbec3c15281825beab54b8062d97d0ab6f009c5fed347b
2022-10-28 18:52:05 +00:00
drh
71b65e88e8 Add sqlite3recover() support to fuzzcheck.
FossilOrigin-Name: e65c5bdc5bd6e1989c3de59798ff0a761125fc490fdec8c7671ca70ed688c4f8
2022-10-28 18:35:06 +00:00
dan
f7fea5b4b8 Change the name of the ".recover" command option "--freelist-corrupt" to "--ignore-freelist".
FossilOrigin-Name: afce8443ace57c3c99c6810be98f05ed716ae504b68098726c869843c643bbf0
2022-10-27 18:19:45 +00:00
dan
195687f1bf Disable the push-down optimization for sub-queries that are INTERSECT, UNION or EXCEPT compounds. dbsqlfuzz a34f455c91ad75a0cf8cd9476841903f42930a7a.
FossilOrigin-Name: 346a3b12b861ce7ba369e98cd336f79a1d4f7a7bb9acd7a4f63f37b391755bf5
2022-10-26 21:14:21 +00:00
dan
5ad03a486e Merge further changes from trunk, including fix to dbdata.c.
FossilOrigin-Name: bcf6b48d52c1ce656899f50bd508c0920cae8cf2ef3c0758a7633981f0f0f484
2022-10-26 18:22:22 +00:00
stephan
16603ecfcb speedtest1: use the current (or default) vfs->xDelete method to unlink the db. This is specifically necessary when running the opfs vfs in a wasm build of speedtest1. This worked without this fix until recently because the affected test code was performing similar acrobatics in its stead.
FossilOrigin-Name: d3c830bd37a402161b486d3631feceae5d00f89c2522aed65fcd2e666bd64238
2022-10-25 15:38:38 +00:00
dan
5f726694eb Merge latest trunk changes with this branch.
FossilOrigin-Name: 757e3f585959f4f113fee48fe3d504f037604c53a95c8d47ce5c2bccfb2af8ff
2022-10-25 11:05:31 +00:00
dan
80b30f995e Use the same "PRAGMA synchronous" setting for the output of a "VACUUM INTO" as are configured for the database being vacuumed.
FossilOrigin-Name: 86cb21ca12581cae9a29f42ba707bd9d789e667e5ddc0f64b24940d5d5c9a118
2022-10-24 15:51:24 +00:00
drh
4073706a47 Improve the ability of the query planner to recognize covering indexes even
on tables with more than 63 columns and where the index is over columns
beyond the 63rd column.

FossilOrigin-Name: f058773e41495ddbae698f9e9a4f62b7003112ea8614dfad69471340058735e4
2022-10-24 13:20:48 +00:00
drh
2d75c1aa3d Update the fuzzinvariant logic in fuzzcheck to the latest code from
dbsqlfuzz.

FossilOrigin-Name: 739ad584765f1fc0eb196db870785da1726805cc2d9dd0a831a37a9e55a4afe9
2022-10-24 12:38:32 +00:00
drh
89b373ab28 Test cases for covering indexes on wide tables.
FossilOrigin-Name: 64c3777eb356b15094a9e9fcc135499ba22f4d847fb117afa6ccf19986e33585
2022-10-24 11:02:02 +00:00
dan
7e089d0c40 Add test case for previous commit.
FossilOrigin-Name: 535867a9c8719358380f89fd80473c484def9bb72744dd2fd28ada65999ee901
2022-10-20 16:22:39 +00:00
dan
ac79fa1c78 Add new test file windowE.test, to test the window functions modules response to an inconsistent collation sequence.
FossilOrigin-Name: 740a2eb0928d54fdf735a8e573c6a61a34dbd295b46e5b6ef39e957fd2623293
2022-10-18 15:02:08 +00:00
dan
8e62d370cf Exclude slow test recovercorrupt.test from veryquick.test.
FossilOrigin-Name: ff9a733532fe11bb253246b45a94681a174c976aafee5c780af571893e8ce694
2022-10-15 19:18:10 +00:00
dan
9dffd36c5d Merge latest trunk changes.
FossilOrigin-Name: 42255ead8e44b24a8abc04aca49f170c55f3b52f42366a0d8ef248ee65fcc7ce
2022-10-15 15:39:46 +00:00
dan
879164ed74 Fix a problem with using the push-down optimization on compound SELECTs where component SELECTs use different collation sequences. dbsqlfuzz 11516f050100243e5a845f5a2b48a90ed2efaf2e.
FossilOrigin-Name: ed14863dd72e35fa3a23320c3d5a8166515faea39a555c28a27b2d35e701eac4
2022-10-14 19:30:34 +00:00
dan
2bc4a6cad0 Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by [forum:61bf7ccbdf].
FossilOrigin-Name: 2da677c45b643482eec39e4db7079c772760bc966dc71bf6c01658cc468f5823
2022-10-14 15:10:36 +00:00
drh
1ffb6be119 Updates to the fuzzer query invariant checker - tracking changes made
over in dbsqlfuzz.

FossilOrigin-Name: 4ca16a304ad10fbb48f78b4384b347fe883e1a4f222f113ac981e89845c3e113
2022-10-12 18:40:25 +00:00
drh
49d77ee642 An attempt to enhance PRAGMA integrity check so that it does data type
checking on non-STRICT tables.  Specifically:  (1) Columns with TEXT affinity
should not contain numeric values, and (2) columns with numeric affinity should
not contain text values that can be converted to numeric.

FossilOrigin-Name: 8b1e7f0524637728cebe81c7d3ff8ad8a5a55782eac6409b425dad538024f596
2022-10-10 18:25:05 +00:00
dan
73c586bcbf Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520.
FossilOrigin-Name: 63d9efe277759d4daa29794846b60c6f55491496618f423f61468df72d0a4633
2022-10-07 18:57:15 +00:00
dan
73ac958c74 Fix a problem that occurred when using a bloom filter to optimize an (ipk = ?) lookup in the case where the RHS of the expression is a TEXT value. First reported by [forum:/forumpost/f61a8b7053|forum post f61a8b7053].
FossilOrigin-Name: 8e14c351b29bb434ac4e2510681e95716424a73e340d39feff4919f0431c2e00
2022-10-06 14:10:11 +00:00
dan
461fa44be0 Merge latest trunk changes.
FossilOrigin-Name: b0feecaa84b88f534edb49056cf7e92256f4a687c8b4c44e1d1186709a304378
2022-10-04 19:47:17 +00:00
drh
16292a5e52 Adjust the --help output for speedtest1 to clarify that the argument to
the --cachesize option is in pages, not bytes.

FossilOrigin-Name: d7c2be6bdc3402e5a339d0f7b76d2c25f3a444dcbf54a77c1ccb790d1195a7cf
2022-10-03 15:22:59 +00:00
drh
277c7d3516 Copy all of the fiddle-opfs changes to speedtest1 into trunk.
FossilOrigin-Name: f3d31c9982cab517a3907a28c571225cee614ee78375c70eb2efb9a2b6b4b042
2022-10-03 13:56:52 +00:00
drh
3044e77b4a Add the --vfs option to speedtest1.
FossilOrigin-Name: aeb884029ac1c68f0d7361dda0a545cff19ed265b608c1e329a1926397c5c8a3
2022-10-03 13:45:03 +00:00
drh
7bc6a818f0 Remove one of the NEVER() macros added by [5166acf3f0040459] because it
is reachable after all.

FossilOrigin-Name: bd8ae5febbb8d3122f1e2e09b9fcdd6ac20c075ae1cf60bcdbd36080f3736417
2022-09-30 22:40:57 +00:00
drh
1337a2291d New test cases in fuzzdata8.db
FossilOrigin-Name: aa367a3c974041323edb759855f0b83803439ceef2846da2d73eadd80efeaac4
2022-09-30 20:59:09 +00:00
dan
bdbd097280 Merge latest trunk changes into this branch.
FossilOrigin-Name: e87fa70ab0f9b95bbcde18567f47906a222a3fd02b4f3c2903d2bb087d361b7c
2022-09-23 11:30:24 +00:00
drh
0f51aa3972 Do not allow EP_InnerON terms to be used on a outer join.
FossilOrigin-Name: f47aa745690c018800243bf76930b2499ff4537411c4e27b4b16ba3854cc2bf8
2022-09-20 22:19:13 +00:00
drh
0cc6f78bcf Add new test cases that (current) get an incorrect answer.
FossilOrigin-Name: fe5c37736444e397ace387b761ec2491229785d7a437f3f60232aedf9d1f00ec
2022-09-20 21:07:52 +00:00
drh
4c5c941b6e New test cases for query flattening when there are ON clauses and outer joins.
FossilOrigin-Name: db55387b1972bc7bc6855bd3497af744a111e7d28d09893cd985fbb01be41bcc
2022-09-20 19:45:04 +00:00
drh
703c208d30 Update the fuzz invariant checker to conform to the latest changes in
dbsqlfuzz.

FossilOrigin-Name: 8d8c124349d2a25200ace9a60d76751594b722468ad0c39d927a5d2c6e2464e0
2022-09-20 17:21:54 +00:00
dan
b8eaf9a10d Fix recovery of utf-16 databases.
FossilOrigin-Name: 5b05be0861f35804270fbd184ad4b89c23e98cc2fbd56b9e4fe6197daef5fe49
2022-09-14 16:37:59 +00:00
dan
bc2e7fc228 Further fixes to comments in sqlite3recover.h. Also rework some data structures in sqlite3recover.c.
FossilOrigin-Name: 599d1f8ec2f9e24924a6f9e66c85664360c7b95531b07a4efe1dd8c096b3fc99
2022-09-09 20:44:56 +00:00