Compare commits

...

80 Commits

Author SHA1 Message Date
drh 9089f06073 If an ON clause to the left of a RIGHT JOIN is false, that does not imply
that the query returns no rows.

FossilOrigin-Name: 4011b9d34044340bdc49e0d3136614cac70403f805bd29a66c1870cba6cacdcf
2023-04-25 15:12:54 +00:00
drh 30cec123d9 Fixes to SQL extension functions base64() and base85().
FossilOrigin-Name: ab3331f41ec56b4ecbfbe9993292ee1a3ce84b6c158a909acadbe7f37c9e3c1a
2023-04-25 11:52:09 +00:00
drh b5596e8810 Import fixes from trunk into the branch-3.41.
FossilOrigin-Name: 58a1d94c59b8f16db2ceae79b4f3a70439edbdea20daac8fdefc85a51345a8b7
2023-04-22 23:43:42 +00:00
drh d6e12b8d56 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: d37241585cf23b14695611a733fff4940db4c0501836e845dad17d2df0c8c22b
2023-04-19 17:13:26 +00:00
drh d1397b5e13 Do not remove pages from the cache of an in-memory database due to a
failure to acquire the page due to it being larger than the maximum page
size.

FossilOrigin-Name: 551b9dacd0e1c9edb028c8fc76904bf5c22e907ac4e5074b0df39a0de11e1227
2023-04-19 15:39:28 +00:00
drh 69a1da98be Ensure that the VACUUM command is not confused by alternative encodings when
it is the first command run on new database connection.

FossilOrigin-Name: 441f4e4a42796dc3fc9e16226cd2eb31d6575b10cdbba6e5283b11f3ecec2a65
2023-04-18 16:44:40 +00:00
drh 0f67e0b77b 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 post f34e32d120.

FossilOrigin-Name: c37e76104b4dd9ed87ffbcf6db374424122d2ebd63f0832a306c53a453c8cedc
2023-04-18 14:17:59 +00:00
drh ae44eab6e2 Fix a typo in the aggfault.test test script.
FossilOrigin-Name: e915bff7adf1475ab4fa982ed12240b3b834899ca82e64af1173054fddf6963b
2023-04-14 15:42:00 +00:00
drh e71a0cf95f When setting the column types on a subquery, ensure that the COLFLAG_HASCOLL
flag is cleared from column names from when the collating sequence name has
been removed.

FossilOrigin-Name: de61bdc9b96d958c9651f5e8935ebbb0132fcae72de43fbf33d6c5c8e97906e3
2023-04-14 10:46:26 +00:00
drh 3bab007170 Avoid double de-quoting of table names when processing RESTRICT actions
in foreign key constraints.

FossilOrigin-Name: 5af7abffe7865375d9f5d1bede4d98bc5b26bd8c958398bda89a31f6a3f68524
2023-04-14 00:23:13 +00:00
drh 4f70726280 Fix an obscure issue with ALTER TABLE RENAME that comes up with triggers
that have UPDATE statements that contain errors.

FossilOrigin-Name: cf651dee1279455dee5005701a2e8b76c9d2545b192919b84370d2e31a4a3baa
2023-04-13 18:49:58 +00:00
drh 5338d41868 Remove an ALWAYS() that can sometimes be false. And fix
a code-generator issue associated with very unusual use of window functions.

FossilOrigin-Name: fc12743763b2b5707ab101453c996bc18d514dcb6e9e0aaf6968618e9653a86d
2023-04-13 15:11:58 +00:00
drh fe7b3eda3d Fix an assertion fault that can occur when compiling with both
SQLITE_ENABLE_UNKNOWN_SQL_FUNCTIONS and SQLITE_ENABLE_STAT4.

FossilOrigin-Name: 2b02862de6046f032f079b8c8faf54454241077f232ccef0a0d80cf96d750560
2023-04-09 20:48:13 +00:00
drh 1aab1972da Fix a faulty assert() in whereRangeScanEst() that should only apply if there
are not prior errors.

FossilOrigin-Name: 450d8ad85c510efa13753f23dcee5ae1b0ba872096b504ad7e08149d85ecfa67
2023-04-09 10:23:01 +00:00
drh aaa1da4fcc Work around a harmless assertion fault associated with
sqlite3VdbeMemAboutToChange() such that the detection of stale values
in registers is preserved in debugging builds, but we avoid a false-positive
assertion fault in cases involving a virtual table with a LIMIT clause
in an IN-operator loop.

FossilOrigin-Name: 9511d17e2a113dac8933663fabb0294fdc1068fd4f8224818af21266439eb7ea
2023-04-06 17:41:57 +00:00
drh 1476f0a99c A prepared statement that aborts due to SQLITE_SCHEMA should not invalidate
cursors in other prepared statements that are already running.

FossilOrigin-Name: 4eee8401c9ae151ad1baab0def607c5ceb60d3c018bf7ad8f7d547087df5e2f9
2023-04-06 15:32:57 +00:00
drh fe58a2217c In the CLI, during error processing while looking for a word boundary,
avoid being deceived by malformed input that has a very long sequence
of 0x80 characters.
Also fix a problem in the zipfile extension for when a corrupt
zipfile has a zero-length filename.

FossilOrigin-Name: 5323ee77d7ac424021872b204feb5e3ad2a6b83f65a0bd0c1928a26227a6c99b
2023-04-06 02:26:55 +00:00
drh cc4cc1e1a6 Remove an ALWAYS() that can now be false due to the prior check-in.
FossilOrigin-Name: 3bfdb4103d83365c32fb5497004948299399e403096cd3001e775b029a1cd8eb
2023-04-05 03:00:34 +00:00
drh c2b085af3a 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.

FossilOrigin-Name: b29dea0dae3110f7d5d87be7f9096427227563229ed4fe2aef7fc86639856fe4
2023-04-05 02:25:37 +00:00
drh 43a4ca8cb8 Fix an incorrect entry in the array that maps sqlite3_value values into
actual datatype numbers.

FossilOrigin-Name: 80d518fb82ff8d837a35280460242ebb925c112024c29496d1804768a4c3efe8
2023-04-04 18:59:38 +00:00
drh fec3162869 Remove an assert() statement that is no longer valid due to enhancements
to query planner for improved use of indexes.

FossilOrigin-Name: 93fb8c66c5703a8af4c87acb2a60f6b3ea13e1d11b31ddea3032348660508ee8
2023-04-04 18:48:40 +00:00
drh 50ee48b0dc 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.

FossilOrigin-Name: 7ea98aba78d10b26e1c8f67978a88a92aa2378dc50df9b5954bdd796affe4f9b
2023-04-03 23:55:20 +00:00
drh 9c3e28450e 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.

FossilOrigin-Name: af0f55cfcba0f53ee5641f20c5ef171f23f5eaea32d28e3a70899a2e2bf60dd6
2023-04-03 18:00:53 +00:00
drh e49f88d3de Stronger constraint checking in allocateSpace().
FossilOrigin-Name: 0f9e65b6c1e7f2f7a0358163c0ec3ce5fe8ed8814202b03ec167cf2f617f82f3
2023-04-03 12:45:16 +00:00
drh f84a0fa30a Earlier detection of corruption in sqlite3BtreeDelete().
dbsqlfuzz a4c48c291d6e40157a1b749a05eaa7c7faf5a625.

FossilOrigin-Name: 728633c0bd665ed94e4969180a83ef102c54371e339bc06ea6cb006eaefdb267
2023-04-02 18:49:45 +00:00
drh 6943598d39 Omit the the count-of-view optimization if there is a HAVING clause.
FossilOrigin-Name: a8faea2842f412dfa2588b65868acb523c9eae1b5ad15c631a1ab193eaa615a7
2023-03-31 23:59:31 +00:00
drh 9d4437553b Earlier error detection for index expression usage by aggregate functions.
dbsqlfuzz 29214ace4e25c98d2ddff8fbcf97afdda23f28b9

FossilOrigin-Name: cf8dd8cd0857f402afa43feb1b71a88f7429df89448e2321cad3777484d0c438
2023-03-30 19:14:36 +00:00
drh 05e73e1ace Cherrypick three fixes from trunk.
FossilOrigin-Name: 5583ea82c6e4555081a7b9ee3c397663abbcdd626e2d1e964aeb31e6d4d4bc4c
2023-03-30 11:28:38 +00:00
drh 7f375727b3 Enhance PRAGMA integrity_check so that it can detect that a NOT NULL column
contains a NaN value and report that as an error.

FossilOrigin-Name: fbc27e18aac7e403c5888c031a57748eebcd31f47c639281c2febe3a64fc529b
2023-03-29 11:40:56 +00:00
drh b55298edc1 Fix a weird corner case in aggregate function processing that results from the
recent addition of support for index expressions on aggregate queries.

FossilOrigin-Name: 36fd948e34c5f1bb1c49957ea349ac521c97a7298f4f9d61a683e03d20818651
2023-03-28 16:13:55 +00:00
drh 0a2e0623d4 Fix multiple problems with RETURNING on a DML statement against a view.
(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: b49816fcce24d28ac2147a3b9afdc8b5b95ed68f89c74b0e6afb1ad5b9bd8741
2023-03-28 11:21:09 +00:00
drh 614f871502 Do not allow constant factoring during PRAGMA integrity_check, since the
constants might be stored in registers that are later reused for other
purposes.

FossilOrigin-Name: a4b5f499d9429ca219c1a706b4767e528a2baf7ddb45bde9d01a4ce5f15cbb0f
2023-03-27 13:27:25 +00:00
drh 9349f72a4c Improvements to register allocation, especially in the ANALYZE command.
New assert() statements added to help verify that memory allocation is
correct, and to help fuzzer find lingering errors.

FossilOrigin-Name: 636f6fad8d4cf7238ed2281d6c3c29736663935ff58709a783a50bc0289d40f4
2023-03-27 13:10:43 +00:00
drh 91187cf297 When the left table of a RIGHT JOIN is used inside an aggregate function and the left table employs an index on expressions, then make sure the expressions evaluate to NULL for the cases where the left table should be NULL.
FossilOrigin-Name: c51df77ebe5046fdcbd6b45990ba0eb295486a4ce12a1d47d0cacc8ec3310024
2023-03-25 23:56:15 +00:00
drh afeb50b415 When reading sqlite_stat4 data during query planning, be sure to expand
zeroblobs prior to running comparisons.

FossilOrigin-Name: 60f4d19d91ac29f5c84eaab77d5a92b2005a05ef89c8855dd800a1c457eafb16
2023-03-25 22:42:01 +00:00
drh 698e4f8b9d In the byte-code generator, when the result of an expression needs to be in a particular
register, always use the sqlite3ExprCode() routine because it has the smarts
to know whether to use OP_Copy or OP_SCopy.  Do not try to OP_SCopy inline
because an OP_Copy might be required.

FossilOrigin-Name: 2d439ccca4f8fd2bcf2178b4ebea54d6a6434303eeb0fe3c6b0be4f2ea5cbb60
2023-03-25 19:46:21 +00:00
drh d6f2b49030 The fix at [13c8c60bb6b4447b] was incomplete in that it failed to clear
the reusable register cache that might contain registers in the STAT4
buffer region.  This additional change corrects the problem.

FossilOrigin-Name: 671bf6f5320bb3add6c897b2c3c78db504d3f0a21ba5347247bc9073ef669f55
2023-03-25 18:33:42 +00:00
drh 83dfffb098 Fix a problem in cursor-hints for WITHOUT ROWID tables.
FossilOrigin-Name: fc8ec188d943245ce10595aecf4095d3077f5fbafdeef7de8183afe9ad26eaf7
2023-03-25 02:02:10 +00:00
drh 3c2ff90e6b Fix CLI non-handling of OOM.
FossilOrigin-Name: 44c76f001af0d4e48b3e3a8d6a5bc1dedec5afee82d4d3a37562a330a79cc052
2023-03-25 01:50:07 +00:00
drh 6c9ea7ac59 Remove undocumented, vestigial SQL functions in the CLI that were once used
for the ".recover" command but are now no longer needed.  This is a fix for
the problem described by [forum:/forumpost/be9c294ee0|forum post be9c294ee0].

FossilOrigin-Name: 74d14900afd10d0284981f648047e781c7a468bc6b292aa3bb6678fbd19fbd4d
2023-03-24 22:24:08 +00:00
drh 4da32bb3c1 Fix an error in the OP_SeekScan opcode.
FossilOrigin-Name: b95e69330eca0f4561a5a448c43643a83329db1daa48b568b69d0fdb55bbc9ec
2023-03-24 21:27:37 +00:00
drh 9cf654c8e0 Increase the version number to 3.41.3.
FossilOrigin-Name: 9a19c6ce80a73f9b11bbd9e5e82f31fec6df91caa900bf67d201087443fe876d
2023-03-24 20:41:33 +00:00
drh e48c167dbb Fix the handling of indexed expressions in an outer query that appear as
corelated values inside an aggregate function within a subquery.

FossilOrigin-Name: 76b90f267c5cc676d9ba97caa0f664e75af8b21c8eb574ec0c1f11e4deedb49e
2023-03-24 20:39:13 +00:00
drh c83270465c Fix byte-code register allocation in ANALYZE for STAT4 when there multiple
indexes with differing numbers of columns.

FossilOrigin-Name: 13c8c60bb6b4447b52895dd63a4dffafa23b0aa05f37ce8d78896b638b385db6
2023-03-24 17:01:29 +00:00
drh e05bb84ac7 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: 76e683c5f25fe0471215e833a6f4f6e50890bbdd1ca639035754e9a2831dd406
2023-03-23 10:58:19 +00:00
drh e671c4fbc0 Version 3.41.2
FossilOrigin-Name: 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da
2023-03-22 11:56:21 +00:00
drh 8d71d50391 Increment the version number in the TEA configure script to 3.41.2.
FossilOrigin-Name: 2bb74aa501b7245f4e4d789630fe8c5265c7644ce223404fe7360d5a1fe8cd76
2023-03-22 11:12:28 +00:00
drh 4edd69b97b Fix a valgrind error and potential buffer overread when handling a corrupt database.
FossilOrigin-Name: cb8b34fa1aa8bbe756ad9cfd864f93f8b5a78948b2622aaa230d4db18b846a4f
2023-03-21 11:27:41 +00:00
drh 4e6047a5ee 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.
FossilOrigin-Name: b02811847cbb9c80ba886d3e84fc6a8048cde5c932405f50416baf6e0cbd78e9
2023-03-20 15:50:40 +00:00
drh 0979ae5180 Fix problems with the sqlite3_error_offset() function and its use in the CLI.
FossilOrigin-Name: d5cd6c885b71b0939f5832fbb63bf800ae03dbbc2dc0f7beab1270133d414c54
2023-03-20 01:59:58 +00:00
drh 3722998e13 Increase the size of ref-count values in the pager layer to 64-bits, to avoid
any reasonable possiblity of overflowing the counters.

FossilOrigin-Name: 824611ad33011bda676ce6c9c3cb2b46442fc0a48c458bdc86dd960623c1e945
2023-03-19 21:53:35 +00:00
drh 7f990bd3f8 Avoid a buffer overread in fts3 that could occur when processing a corrupt record.
FossilOrigin-Name: 1f91fe4bfc81bf66f9c8f0aebe0acdbac89e2c20d90a5eb4ea0a3c560b82a9cd
2023-03-19 10:30:02 +00:00
dan 32ccccf7ab Fix a potential buffer overread in the recovery extension.
FossilOrigin-Name: 78836713c965066cb9c1cc732a9cecb1d74a25f37775a01c088393881e4fd8d6
2023-03-17 14:22:45 +00:00
drh fd74c4b2d9 Ensure that an error does not delete the Table object out from under
the xConstruct method of a virtual table.
dbsqlfuzz 7cc8804a1c6d4e3d554d79096e6ea75a7c1c7d2d

FossilOrigin-Name: c5bd0ea3b5b2f3ed8e971c5fd6e85e8f06d8055d74df65612c3794138306e6ba
2023-03-17 12:25:10 +00:00
drh d5a1e1967f Increase the version number to 3.41.2
FossilOrigin-Name: 122f12f5363245a4566dc15ce81ecac5fce70ce9aa478408483f88bd86a8e6bc
2023-03-17 10:30:05 +00:00
drh 2d4139dda5 Fix assert() statements that would (incorrectly) fire if an IF NOT EXISTS
trigger that already exists contained two or more RETURNING clauses.

FossilOrigin-Name: 9b43b34d81adb1a8fd5e087f6c61387ed3a2e3e604418e295906d220f5cc5254
2023-03-17 00:10:06 +00:00
drh fe5751815b 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.

FossilOrigin-Name: 097512b60498803570fe80d0403963ed2b5cecbee7156af355418ff9f1851d60
2023-03-16 21:05:59 +00:00
drh a0e71193e5 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.

FossilOrigin-Name: b5d8a9a6a58b4eb81a663192f578e0fbed72e8155bc7e1100ece04e8394a1984
2023-03-16 10:21:52 +00:00
drh 9f773bfde6 Remove a NEVER() from btreeNext().
FossilOrigin-Name: 40623f5ab07481179f1efd5d377555c8d78bf0706a16212c0f6b954c17736a5c
2023-03-16 09:16:31 +00:00
drh 11e8ff65b5 Fix a broken assert() in the recovery extension.
FossilOrigin-Name: 048711e49002e59cbaf51079403a3f37abaa7d3a04e0cb20de4aed2d56c0e837
2023-03-16 09:12:09 +00:00
drh 1a7d1ab06e Disallow the one-pass optimization for DELETE if the WHERE clause contains
a subquery.

FossilOrigin-Name: 25e1831885e8de370482a1e9f664f1590fa49995048fb16e1f948acd2a29c3e3
2023-03-15 18:05:02 +00:00
drh 73dd2b94e1 Fix Bloom filters on an expression index.
FossilOrigin-Name: 11e0256b8c6f29bd2e60a0820f740e9927112bf6a0814751b7a73896298b4826
2023-03-14 20:16:48 +00:00
drh 88894f2b5f The cherry-pick merge at [371838562a675c1b] caused a performance regression
for some queries, which is here fixed.

FossilOrigin-Name: 6d6d95fcedbc8758ab284d3014ae4a97af6247003bb3d0a7056f2e6bffa6cae4
2023-03-11 23:29:34 +00:00
drh cd0b19a37f Version 3.41.1
FossilOrigin-Name: 20399f3eda5ec249d147ba9e48da6e87f969d7966a9a896764ca437ff7e737ff
2023-03-10 12:13:52 +00:00
drh 10e44bf373 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.

FossilOrigin-Name: cc8a0ee40cfc83ab42a0ff452de0a53fe17784aefb944ea7ac2cb078a8310730
2023-03-09 16:04:34 +00:00
dan b08004d947 Fix countofview.test so that it works with SQLITE_OMIT_PROGRESS_CALLBACK builds.
FossilOrigin-Name: d55a7742c9447eba20a7fe252fb3edcabba3793030a55976d5a5e6c65bce7706
2023-03-09 15:08:56 +00:00
drh 322b844815 Update the version number to 3.41.1
FossilOrigin-Name: e4e2e64725a196ee4f287649db33f49fd7329c95cef3ce743cd177c998a6a343
2023-03-09 14:14:18 +00:00
drh da1b094d95 Merge count-of-view optimization fixes from trunk. But count-of-view is
still off by default for this branch.

FossilOrigin-Name: cbbe8986ea26e78a7c5b122170cb5bf3f275f8e3a2941017f9ef11d7f3864256
2023-03-09 13:58:49 +00:00
drh cc4f0f678d Fix a possible NULL pointer dereference due to the sqlite3_interrupt()
enhancement in the 3.41.0 release.

FossilOrigin-Name: 66d24a220e3455a183b61490f42869520744cb3990e13f3ded92f1b6a7e248ce
2023-03-09 01:35:52 +00:00
drh 86ac593b84 Keep the historical datatype ("INT", not "NUM") for a table created as follows: "CREATE TABLE t1 AS SELECT CAST(123 AS INT) AS value;". The use of FLEXNUM only occurs on compound queries.
FossilOrigin-Name: dc1033af4bf707095032f66d7a8ab63204f38bae244fab16a2bc870840d5bffd
2023-03-08 14:37:04 +00:00
drh fe8d2d2497 Fix an assertion fault added by [65ffee234787213c].
FossilOrigin-Name: d00e68baf73238d2f91df6b19525c91539a7fe26406516cbacfff113e79e26ea
2023-03-08 00:04:47 +00:00
drh ec1533e366 Cherry-pick the agg-with-indexed-expr optimization fix from trunk.
FossilOrigin-Name: b2ad89d3f0fe5c7582d97e65770eb93986ba8d4b031aafb04f86160383b47aab
2023-03-04 15:49:33 +00:00
drh 9ebf799d5b Do not use an expression index on a generated column if generated column has the wrong affinity.
FossilOrigin-Name: 65ffee234787213ca3b12afde1b5ed7ae536366c30e984b14c0975da0c57917d
2023-03-03 19:47:09 +00:00
drh 5a7afccd51 Enhance PRAGMA integrity_check so that it can detect when there are extra
bytes at the end of an index record, which might cause OP_IdxRowid to
malfunction.

FossilOrigin-Name: c143f08713ec5dcc7609804f1fa0d795005c7ebd265b73e42342584d759eae01
2023-03-03 18:47:29 +00:00
drh 74273c4369 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: 0fc7f7c2a90ce9bc3462478441b4e628c90e5adff0d461e6cc3521371b7f1f08
2023-03-03 17:11:15 +00:00
drh 7a83522677 When flattening the right operand of a LEFT JOIN,
ensure that the OP_IfNullRow opcode does not
NULL-out a subquery result that was computed within OP_Once.

FossilOrigin-Name: c80b262c9dbde80c51872f36f9c4d406eba1c3f34468d36d5cb7084b1720ee5c
2023-03-02 14:09:11 +00:00
drh 843c71d748 When flattening a view that is the right operand of a LEFT JOIN
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.

FossilOrigin-Name: 371838562a675c1bdd9c80250230eb87ac0e5e135cc39abbdbe1f8b1b8149445
2023-03-01 20:44:34 +00:00
drh cbfa2269c4 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.

FossilOrigin-Name: 9dc460318d98308f51e31df216872ff96ece67c86f50c3fd11bf2a3df112afdd
2023-03-01 15:28:34 +00:00
drh 0a64b581dd When a table-valued function appears as the right table of a RIGHT JOIN,
the argument constraints on the table-valued function should be considered
part of the ON clause of the RIGHT JOIN.

FossilOrigin-Name: d225d077c4fcc526e70d59018479bba723d464cac5ac805eeeebd7d2a48cedcf
2023-02-26 21:09:45 +00:00
drh 72e2aa5096 Provide -DHAVE_LOG2=0 and -DHAVE_LOG10=0 compile-time options for use on systems
that lack the log2() and log10() standard math library routines, to cause
SQLite to substitute its own alternatives.

FossilOrigin-Name: ff3362ab53752de10bd95a16804ce3ef31edd8f0cb3099841c3e4ffc1d79d64d
2023-02-23 17:12:07 +00:00
75 changed files with 1661 additions and 474 deletions
+1 -1
View File
@@ -1 +1 @@
3.41.0
3.41.3
+1 -1
View File
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so that we create the export library with the dll.
#-----------------------------------------------------------------------
AC_INIT([sqlite],[3.41.0])
AC_INIT([sqlite],[3.41.3])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
Vendored
+9 -9
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sqlite 3.41.0.
# Generated by GNU Autoconf 2.69 for sqlite 3.41.3.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.41.0'
PACKAGE_STRING='sqlite 3.41.0'
PACKAGE_VERSION='3.41.3'
PACKAGE_STRING='sqlite 3.41.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1470,7 +1470,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems.
\`configure' configures sqlite 3.41.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1535,7 +1535,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.41.0:";;
short | recursive ) echo "Configuration of sqlite 3.41.3:";;
esac
cat <<\_ACEOF
@@ -1665,7 +1665,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sqlite configure 3.41.0
sqlite configure 3.41.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2084,7 +2084,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sqlite $as_me 3.41.0, which was
It was created by sqlite $as_me 3.41.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -12457,7 +12457,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sqlite $as_me 3.41.0, which was
This file was extended by sqlite $as_me 3.41.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12523,7 +12523,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sqlite config.status 3.41.0
sqlite config.status 3.41.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+5 -3
View File
@@ -2667,16 +2667,18 @@ static int fts3MsrBufferData(
char *pList,
i64 nList
){
if( nList>pMsr->nBuffer ){
if( (nList+FTS3_NODE_PADDING)>pMsr->nBuffer ){
char *pNew;
pMsr->nBuffer = nList*2;
pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer);
int nNew = nList*2 + FTS3_NODE_PADDING;
pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, nNew);
if( !pNew ) return SQLITE_NOMEM;
pMsr->aBuffer = pNew;
pMsr->nBuffer = nNew;
}
assert( nList>0 );
memcpy(pMsr->aBuffer, pList, nList);
memset(&pMsr->aBuffer[nList], 0, FTS3_NODE_PADDING);
return SQLITE_OK;
}
+2 -2
View File
@@ -407,7 +407,7 @@ int sqlite3Fts5ExprAnd(Fts5Expr **pp1, Fts5Expr *p2){
Fts5Parse sParse;
memset(&sParse, 0, sizeof(sParse));
if( *pp1 ){
if( *pp1 && p2 ){
Fts5Expr *p1 = *pp1;
int nPhrase = p1->nPhrase + p2->nPhrase;
@@ -432,7 +432,7 @@ int sqlite3Fts5ExprAnd(Fts5Expr **pp1, Fts5Expr *p2){
}
sqlite3_free(p2->apExprPhrase);
sqlite3_free(p2);
}else{
}else if( p2 ){
*pp1 = p2;
}
+26
View File
@@ -154,4 +154,30 @@ do_execsql_test 3.2 {
}
# 2023-04-06 https://sqlite.org/forum/forumpost/cae4367d9b
#
# This is not a test of FTS5, but rather a test of the of what happens to
# prepared statements that encounter SQLITE_SCHEMA while other prepared
# statements are running. The original problem POC used FTS5, and so
# is seems reasonable to put the test here.
#
# The vdbeaux24.test module in TH3 also tests this same behavior but
# without requiring FTS5 or an other extension.
#
reset_db
db null NULL
do_execsql_test 4.0 {
CREATE TABLE t5(a PRIMARY KEY);
INSERT INTO t5 VALUES(0);
CREATE VIRTUAL TABLE t6 USING fts5(0);
DELETE FROM t6;
CREATE TABLE t7(x);
WITH cte(a) AS (
SELECT a FROM t5
WHERE ((0,0) IN (SELECT 0, LAG(0) OVER (PARTITION BY 0) FROM t6), 0)
< (a,0)
)
SELECT max(a) FROM cte;
} NULL
finish_test
+28
View File
@@ -443,5 +443,33 @@ do_execsql_test -db db2 16.6 {
SELECT * FROM x1
} {abc def}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 17.1 {
CREATE VIRTUAL TABLE ft USING fts5(x, tokenize="unicode61 separators 'X'");
}
do_execsql_test 17.2 {
SELECT 0 FROM ft WHERE ft MATCH 'X' AND ft MATCH 'X'
}
do_execsql_test 17.3 {
SELECT 0 FROM ft('X')
}
do_execsql_test 17.4 {
CREATE VIRTUAL TABLE t0 USING fts5(c0, t="trigram");
INSERT INTO t0 VALUES('assertionfaultproblem');
}
do_execsql_test 17.5 {
SELECT 0 FROM t0(0) WHERE c0 GLOB 0;
} {}
do_execsql_test 17.5 {
SELECT c0 FROM t0 WHERE c0 GLOB '*f*';
} {assertionfaultproblem}
do_execsql_test 17.5 {
SELECT c0 FROM t0 WHERE c0 GLOB '*faul*';
} {assertionfaultproblem}
finish_test
Executable → Regular
+19 -5
View File
@@ -147,9 +147,9 @@ static char* toBase64( u8 *pIn, int nbIn, char *pOut ){
}
/* Skip over text which is not base64 numeral(s). */
static char * skipNonB64( char *s ){
static char * skipNonB64( char *s, int nc ){
char c;
while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s;
while( nc-- > 0 && (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s;
return s;
}
@@ -158,7 +158,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){
if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn;
while( ncIn>0 && *pIn!=PAD_CHAR ){
static signed char nboi[] = { 0, 0, 1, 2, 3 };
char *pUse = skipNonB64(pIn);
char *pUse = skipNonB64(pIn, ncIn);
unsigned long qv = 0L;
int nti, nbo, nac;
ncIn -= (pUse - pIn);
@@ -218,9 +218,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){
sqlite3_result_error(context, "blob expanded to base64 too big", -1);
return;
}
bBuf = (u8*)sqlite3_value_blob(av[0]);
if( !bBuf ){
if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){
goto memFail;
}
sqlite3_result_text(context,"",-1,SQLITE_STATIC);
break;
}
cBuf = sqlite3_malloc(nc);
if( !cBuf ) goto memFail;
bBuf = (u8*)sqlite3_value_blob(av[0]);
nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf);
sqlite3_result_text(context, cBuf, nc, sqlite3_free);
break;
@@ -233,9 +240,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){
}else if( nb<1 ){
nb = 1;
}
cBuf = (char *)sqlite3_value_text(av[0]);
if( !cBuf ){
if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){
goto memFail;
}
sqlite3_result_zeroblob(context, 0);
break;
}
bBuf = sqlite3_malloc(nb);
if( !bBuf ) goto memFail;
cBuf = (char *)sqlite3_value_text(av[0]);
nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf);
sqlite3_result_blob(context, bBuf, nb, sqlite3_free);
break;
+19 -5
View File
@@ -140,9 +140,9 @@ static u8 base85DigitValue( char c ){
#define B85_DARK_MAX 80
static char * skipNonB85( char *s ){
static char * skipNonB85( char *s, int nc ){
char c;
while( (c = *s) && !IS_B85(c) ) ++s;
while( nc-- > 0 && (c = *s) && !IS_B85(c) ) ++s;
return s;
}
@@ -212,7 +212,7 @@ static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){
if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn;
while( ncIn>0 ){
static signed char nboi[] = { 0, 0, 1, 2, 3, 4 };
char *pUse = skipNonB85(pIn);
char *pUse = skipNonB85(pIn, ncIn);
unsigned long qv = 0L;
int nti, nbo;
ncIn -= (pUse - pIn);
@@ -297,9 +297,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){
sqlite3_result_error(context, "blob expanded to base85 too big", -1);
return;
}
bBuf = (u8*)sqlite3_value_blob(av[0]);
if( !bBuf ){
if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){
goto memFail;
}
sqlite3_result_text(context,"",-1,SQLITE_STATIC);
break;
}
cBuf = sqlite3_malloc(nc);
if( !cBuf ) goto memFail;
bBuf = (u8*)sqlite3_value_blob(av[0]);
nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf);
sqlite3_result_text(context, cBuf, nc, sqlite3_free);
break;
@@ -312,9 +319,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){
}else if( nb<1 ){
nb = 1;
}
cBuf = (char *)sqlite3_value_text(av[0]);
if( !cBuf ){
if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){
goto memFail;
}
sqlite3_result_zeroblob(context, 0);
break;
}
bBuf = sqlite3_malloc(nb);
if( !bBuf ) goto memFail;
cBuf = (char *)sqlite3_value_text(av[0]);
nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf);
sqlite3_result_blob(context, bBuf, nb, sqlite3_free);
break;
+4 -1
View File
@@ -1097,7 +1097,10 @@ static int zipfileColumn(
** it to be a directory either if the mode suggests so, or if
** the final character in the name is '/'. */
u32 mode = pCDS->iExternalAttr >> 16;
if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){
if( !(mode & S_IFDIR)
&& pCDS->nFile>=1
&& pCDS->zFile[pCDS->nFile-1]!='/'
){
sqlite3_result_blob(ctx, "", 0, SQLITE_STATIC);
}
}
+6 -3
View File
@@ -512,10 +512,14 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
if( pCsr->bOnePage==0 && pCsr->iPgno>pCsr->szDb ) return SQLITE_OK;
rc = dbdataLoadPage(pCsr, pCsr->iPgno, &pCsr->aPage, &pCsr->nPage);
if( rc!=SQLITE_OK ) return rc;
if( pCsr->aPage ) break;
if( pCsr->aPage && pCsr->nPage>=256 ) break;
sqlite3_free(pCsr->aPage);
pCsr->aPage = 0;
if( pCsr->bOnePage ) return SQLITE_OK;
pCsr->iPgno++;
}
assert( iOff+3+2<=pCsr->nPage );
pCsr->iCell = pTab->bPtr ? -2 : 0;
pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]);
}
@@ -750,8 +754,7 @@ static int dbdataGetEncoding(DbdataCursor *pCsr){
int nPg1 = 0;
u8 *aPg1 = 0;
rc = dbdataLoadPage(pCsr, 1, &aPg1, &nPg1);
assert( rc!=SQLITE_OK || nPg1==0 || nPg1>=512 );
if( rc==SQLITE_OK && nPg1>0 ){
if( rc==SQLITE_OK && nPg1>=(56+4) ){
pCsr->enc = get_uint32(&aPg1[56]);
}
sqlite3_free(aPg1);
+80 -79
View File
@@ -1,5 +1,5 @@
C Version\s3.41.0
D 2023-02-21T18:09:37.622
C If\san\sON\sclause\sto\sthe\sleft\sof\sa\sRIGHT\sJOIN\sis\sfalse,\sthat\sdoes\snot\simply\nthat\sthe\squery\sreturns\sno\srows.
D 2023-04-25T15:12:54.775
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -7,7 +7,7 @@ F Makefile.in 594f07f8829020a45d825234edf14046544b5bf6bc0057a9d5b83b58686b1c46
F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
F Makefile.msc b0026b61d1242add00c28dbe169271a763fffcb3af6762bcdbeb20c3efe6a69f
F README.md 8b8df9ca852aeac4864eb1e400002633ee6db84065bd01b78c33817f97d31f5e
F VERSION 413ec94920a487ae32c9a2a8819544d690662d6f7c7ce025c0d0b8a1e74fa9db
F VERSION 7f6758634fd006beed37d468cb3a7799753d0fe7041a47e44f8cecf73e9ed59f
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
@@ -22,7 +22,7 @@ F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d
F autoconf/tea/Makefile.in 106a96f2f745d41a0f6193f1de98d7355830b65d45032c18cd7c90295ec24196
F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
F autoconf/tea/configure.ac d1eaa72f4d202ca106f4b2762733709d3f89a877da2e385a57881c4ad0427be7
F autoconf/tea/configure.ac df447017c885808673a98fbda338a012c4e18a3fad2d0b4917ae8cade67045c1
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
F autoconf/tea/pkgIndex.tcl.in b9eb6dd37f64e08e637d576b3c83259814b9cddd78bec4af2e5abfc6c5c750ce
@@ -33,7 +33,7 @@ F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea0034
F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
F configure 6ba84abf7878bb072d460766d29e492028468775d4c09464940343092eb6493c x
F configure 9f533f1bb6436ef46d7adc21e88aeff6cf8587a72888f0054c090eb0186b5dbf x
F configure.ac 4654d32ac0a0d0b48f1e1e79bdc3d777b723cf2f63c33eb1d7c4ed8b435938e8
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
@@ -76,7 +76,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154
F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
F ext/fts3/fts3_write.c 4fb644df0ff840267e47a724286c7a1fa5540273a7ce15756dd5913a101ec302
F ext/fts3/fts3_write.c 33d2d0db4dd4e7a7a7e9a7f790414293277f9e7682a2fd9d61c713bfc37cd8b6
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
F ext/fts3/tool/fts3view.c 413c346399159df81f86c4928b7c4a455caab73bfbc8cd68f950f632e5751674
@@ -90,7 +90,7 @@ F ext/fts5/fts5Int.h c0d46e399e345e35985b72a1c1af025973bfaa5b1e3563b0ce3bb0ce144
F ext/fts5/fts5_aux.c f558e1fb9f0f86a4f7489e258c162e1f947de5ff2709087fbb465fddb7092f98
F ext/fts5/fts5_buffer.c 3001fbabb585d6de52947b44b455235072b741038391f830d6b729225eeaf6a5
F ext/fts5/fts5_config.c 501e7d3566bc92766b0e11c0109a7c5a6146bc41144195459af5422f6c2078aa
F ext/fts5/fts5_expr.c 48e8e45261c6030cf5c77f606217a22722b1a4d0b34e2ba6cbfc386581627989
F ext/fts5/fts5_expr.c 7d298d76ea010c339b26ca47f6f69e9aef520ea46c083deaa4e83e87cf0e94b1
F ext/fts5/fts5_hash.c d4fb70940359f2120ccd1de7ffe64cc3efe65de9e8995b822cd536ff64c96982
F ext/fts5/fts5_index.c df5b29576a409f673e54b470723d817df9d5167cff208c48ab9a3773cba6fa89
F ext/fts5/fts5_main.c fe67b6fb2ef134d9dbfa3941c63f777d755b075449be1863cb913a7f8754cb69
@@ -115,7 +115,7 @@ F ext/fts5/test/fts5ag.test 7816f25a0707578f08145ab539fc0ca025f8951e788b28a6a18a
F ext/fts5/test/fts5ah.test 2f047dfe89dc8611fa53e3d8bfc453b79cff037aa423c8d171e91e645745aa2c
F ext/fts5/test/fts5ai.test bc97e4758cc93e06bf851d61c98fdf4e8b8f8315ee28a84fb15f916360856414
F ext/fts5/test/fts5aj.test 745020852d85f5dd49d11cb7ad11d3cc6dafc4fe6d6d24bc0875ac8f43ee4149
F ext/fts5/test/fts5ak.test fc3595f8e6873bb86d70c9bd4b67d0413ce577bd4793c39a2b60a7b8825b60a6
F ext/fts5/test/fts5ak.test f459a64c9d38698af72a7c657ab6349bca96150241dd69fcce752634b2742d41
F ext/fts5/test/fts5al.test 00c4c1c6a1366b73aa48ce2068c634520867c3cf7f5d1676ebbb775ee1f35734
F ext/fts5/test/fts5alter.test 5565f7e4605512b69171ac18ca84398603f9f6456dbe377beeca97e83cc242cd
F ext/fts5/test/fts5auto.test 78989e6527ce69c9eddbef7392fea5c10b0010cd2b2ae68eec7bc869c471e691
@@ -168,7 +168,7 @@ F ext/fts5/test/fts5leftjoin.test c0b4cafb9661379e576dc4405c0891d8fcc27826807405
F ext/fts5/test/fts5matchinfo.test 10c9a6f7fe61fb132299c4183c012770b10c4d5c2f2edb6df0b6607f683d737a
F ext/fts5/test/fts5merge.test e92a8db28b45931e7a9c7b1bbd36101692759d00274df74d83fd29d25d53b3a6
F ext/fts5/test/fts5merge2.test 3ebad1a59d6ad3fb66eff6523a09e95dc6367cbefb3cd73196801dea0425c8e2
F ext/fts5/test/fts5misc.test d6d4fdd7ec164e69e50af539137c0565362a4124547bf841ba474f092298637b
F ext/fts5/test/fts5misc.test c02f3e78aa7e62891b5f711c498a877f03252f10a6974e23bc722533233f2603
F ext/fts5/test/fts5multi.test a15bc91cdb717492e6e1b66fec1c356cb57386b980c7ba5af1915f97fe878581
F ext/fts5/test/fts5multiclient.test 5ff811c028d6108045ffef737f1e9f05028af2458e456c0937c1d1b8dea56d45
F ext/fts5/test/fts5near.test 211477940142d733ac04fad97cb24095513ab2507073a99c2765c3ddd2ef58bd
@@ -264,8 +264,8 @@ F ext/misc/README.md d6dd0fe1d8af77040216798a6a2b0c46c73054d2f0ea544fbbcdccf6f23
F ext/misc/amatch.c e3ad5532799cee9a97647f483f67f43b38796b84b5a8c60594fe782a4338f358
F ext/misc/anycollseq.c 5ffdfde9829eeac52219136ad6aa7cd9a4edb3b15f4f2532de52f4a22525eddb
F ext/misc/appendvfs.c 9642c7a194a2a25dca7ad3e36af24a0a46d7702168c4ad7e59c9f9b0e16a3824
F ext/misc/base64.c d43d2b209c8ab70ca3f860104bb353b0f52a1c5462a2466140025c954e4f3ea7 x
F ext/misc/base85.c 77dfd5813d23ea561d0348f922583888e78f8eaeb2b9a4a28226d092389890b8
F ext/misc/base64.c 995e9f4c7cd952dfc772a8320f3f282a24f78035278e17117510fad051c4fc3e
F ext/misc/base85.c 073054111988db593ef5fdb87ab8c459df1ea0c3aaaddf0f5bfa3d72b7e6280a
F ext/misc/basexx.c 5e859e1820620aa8080fb9145eb47089de426ae808f6abb01a8e12921c3a8e67
F ext/misc/blobio.c a867c4c4617f6ec223a307ebfe0eabb45e0992f74dd47722b96f3e631c0edb2a
F ext/misc/btreeinfo.c d28ce349b40054eaa9473e835837bad7a71deec33ba13e39f963d50933bfa0f9
@@ -316,7 +316,7 @@ F ext/misc/vfsstat.c 474d08efc697b8eba300082cb1eb74a5f0f3df31ed257db1cb07e72ab0e
F ext/misc/vtablog.c 5538acd0c8ddaae372331bee11608d76973436b77d6a91e8635cfc9432fba5ae
F ext/misc/vtshim.c 1976e6dd68dd0d64508c91a6dfab8e75f8aaf6cd
F ext/misc/wholenumber.c a838d1bea913c514ff316c69695efbb49ea3b8cb37d22afc57f73b6b010b4546
F ext/misc/zipfile.c f98239261488397618ce4754c500626d1de20cd2d44bf2f2d571d7ddaab668a7
F ext/misc/zipfile.c b9d615e1d9af7577833861cfaa79b253aec0f26c89239c75af8c790d287d1d39
F ext/misc/zorder.c b0ff58fa643afa1d846786d51ea8d5c4b6b35aa0254ab5a82617db92f3adda64
F ext/rbu/rbu.c 801450b24eaf14440d8fd20385aacc751d5c9d6123398df41b1b5aa804bf4ce8
F ext/rbu/rbu1.test 25870dd7db7eb5597e2b4d6e29e7a7e095abf332660f67d89959552ce8f8f255
@@ -365,7 +365,7 @@ F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69
F ext/rbu/sqlite3rbu.c 348bb6251e6ec459de102f8b2dd50789a98643ef7a28e56e4c787ac9659c15ea
F ext/rbu/sqlite3rbu.h 9d923eb135c5d04aa6afd7c39ca47b0d1d0707c100e02f19fdde6a494e414304
F ext/rbu/test_rbu.c ee6ede75147bc081fe9bc3931e6b206277418d14d3fbceea6fdc6216d9b47055
F ext/recover/dbdata.c dc25628e405c86936c597e28f3e6f56a257029c3034c5ef7f6b10f7c02f41018
F ext/recover/dbdata.c 81115741d685f25cbeb52e233afc5b510bf2a144ea802eb7b64da2b95dc9b274
F ext/recover/recover1.test 2072993624d5e32fef20ae03b17fc06c02bcb344421fe17bb329b24d2a51e647
F ext/recover/recover_common.tcl a61306c1eb45c0c3fc45652c35b2d4ec19729e340bdf65a272ce4c229cefd85a
F ext/recover/recoverclobber.test 3ba6c0c373c5c63d17e82eced64c05c57ccaf26c1abe1ca7141334022a79f32e
@@ -553,34 +553,34 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
F sqlite_cfg.h.in baf2e409c63d4e7a765e17769b6ff17c5a82bbd9cbf1e284fd2e4cefaff3fcf2
F src/alter.c 3ca2f449c890f8b86ec9e06f0c4fccf0648941c3308a16904cb2852227db83f7
F src/analyze.c b597c382f23b19cce563211181e84b7e8edddd6871d5f630bbadedb57e562806
F src/alter.c 482c534877fbb543f8295992cde925df55443febac5db5438d5aaba6f78c4940
F src/analyze.c 1102ff341ee9f9ed85a19499d4e52408fd65fde236f232faf7876bd5e866c09f
F src/attach.c cc9d00d30da916ff656038211410ccf04ed784b7564639b9b61d1839ed69fd39
F src/auth.c f4fa91b6a90bbc8e0d0f738aa284551739c9543a367071f55574681e0f24f8cf
F src/backup.c a2891172438e385fdbe97c11c9745676bec54f518d4447090af97189fd8e52d7
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
F src/bitvec.c 7c849aac407230278445cb069bebc5f89bf2ddd87c5ed9459b070a9175707b3d
F src/btmutex.c 6ffb0a22c19e2f9110be0964d0731d2ef1c67b5f7fabfbaeb7b9dabc4b7740ca
F src/btree.c 2f012aea074de6319c191cbf5c45034de79bf1c762826e381b1cf75421d8d831
F src/btree.c f81185e135d20d55cd061eaf67969616bb687fc6e4794cb650b456bccbe851f7
F src/btree.h aa354b9bad4120af71e214666b35132712b8f2ec11869cb2315c52c81fad45cc
F src/btreeInt.h 06bb2c1a07172d5a1cd27a2a5d617b93b1e976c5873709c31964786f86365a6e
F src/build.c c55ab6d1b089ceef57160e840f05f692955ac90944c3d04fcf01d97fd7bfd08d
F src/build.c 8357d6ca9a8c9afc297c431df28bc2af407b47f3ef2311875276c944b30c4d54
F src/callback.c 4cd7225b26a97f7de5fee5ae10464bed5a78f2adefe19534cc2095b3a8ca484a
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c 20507cc0b0a6c19cd882fcd0eaeda32ae6a4229fb4b024cfdf3183043d9b703d
F src/date.c f21815ca7172ce073db3163ac54c8d9f2841077165c1a6123b4d1c376a0c7ec7
F src/dbpage.c d47549716549311f79dc39fe5c8fb19390a6eb2c960f8e37c89a9c4de0c1052e
F src/dbstat.c ec92074baa61d883de58c945162d9e666c13cd7cf3a23bc38b4d1c4d0b2c2bef
F src/delete.c 86573edae75e3d3e9a8b590d87db8e47222103029df4f3e11fa56044459b514e
F src/expr.c 2e5e67e800c9416996df52409746a2f3c7dadf5d38b5a367ce379b239e3f40c8
F src/delete.c a9c6d3f51c0a31e9b831e0a0580a98d702904b42d216fee530940e40dec34873
F src/expr.c f307007b9e8ebc6cfbbc32609d93fe59a54ca2bb82d683ca0557d7847f99c774
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 722f20779f5342a787922deded3628d8c74b5249cab04098cf17ee2f2aaff002
F src/func.c 64c4cb2eebf6ddb6b4b08dc17790e7152b887f223f8caf0c0fe96da1c5a876ca
F src/fkey.c 03c134cc8bffe54835f742ddea0b72ebfc8f6b32773d175c71b8afeea6cb5c83
F src/func.c d187be57a886ddf4e6b7ef584a494361899be3df5eee6d4a747b68ff4aff4122
F src/global.c e06ff8e0acd85aec13563c9ecb44fbbf38232ccf73594998fd880b92d619594b
F src/hash.c c6af5f96a7a76d000f07c5402c48c318c2566beecdee9e78b9d9f60ce7119565
F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
F src/hwtime.h b638809e083b601b618df877b2e89cb87c2a47a01f4def10be4c4ebb54664ac7
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c 1b11a2e33ee52db93c02fddac67e39d00161d61b69fac2675b82f2aa68c1b61c
F src/insert.c 05ffee42b1e66282989b12fcf99bb1cf42c76c33ee162a8957704924b4c03c66
F src/json.c c85ed6fce06f43d414b0d7fff64749d43a0dbd1067123ee407bd3a0752454161
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c b04eb648cedc45efe4298e1ef439ac4f0096ae27b5f01accb0a1f49d57789128
@@ -608,25 +608,25 @@ F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d87210
F src/os_unix.c 90c4fa0a88c8b0817c7ce4dbea0ac3aebfd7deb0797945ac34dfd25006ba393a
F src/os_win.c 295fe45f18bd86f2477f4cd79f3377c6f883ceb941b1f46808665c73747f2345
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 39af8ff7c73a991f61f4d1e3a6f8f98b1c8e29144723507822774cac5e6ee0b5
F src/pager.c 7227ab6b73f6f1f17e1e448c99da767bb8f13f9671318bbfeddd38eb3ee96b9f
F src/pager.h f82e9844166e1585f5786837ddc7709966138ced17f568c16af7ccf946c2baa3
F src/parse.y 960d2da92a23f8ba2ca22748a51bd75ee2c575564f2cbc59f119640e7f5b4c5d
F src/pcache.c f4268f7f73c6a3db12ce22fd25bc68dc42315d19599414ab1207d7cf32f79197
F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586
F src/parse.y e7afc0b66f64424a7b2bba1994548c3c327bf05fc2276f51493219dcb51a8217
F src/pcache.c 842410539b544e12d5fccfcf29890782f46a58f227a77bc0bd76243799662c0c
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
F src/pcache1.c dee95e3cd2b61e6512dc814c5ab76d5eb36f0bfc9441dbb4260fccc0d12bbddc
F src/pragma.c 82d5090a35eac75876d3b41f48d06b2370553c9576bf2942233c462e03eb94c9
F src/pragma.c 6b4a5bf8f7c19d141b7f612e97cf6168fbfb3b77e6794517512543c9a3765231
F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7
F src/prepare.c ce87a08cfddd45a147150db34190b1986f2d4a0e0828858cb6bd908c78fb02e3
F src/prepare.c 6350675966bd0e7ac3a464af9dbfe26db6f0d4237f4e1f1acdb17b12ad371e6e
F src/printf.c ff4b05e38bf928ff1b80d3dda4f977b10fe39ecbfe69c018224c7e5594fb2455
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c d62c5665279cc7485f9d45b5e20911cc7b19c203f268321a90d05d74f4725750
F src/resolve.c 6a0253379cc15b3f80321362a61f487a8ef7cd2487fe62e1eb2317b3f871c61f
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
F src/select.c d44e78e103cb52b3bdf8d0b7ac2518b7a4cbaf12237bd9078f6897d230d2516e
F src/shell.c.in 6f36f5ca05f1bebf74935a7fcf2dce983016e807a09cbd752a673583ad7da087
F src/select.c af040f37370a2eb7959fe93425c7f3bb71534c24144af60abb1cd6d66aafa16e
F src/shell.c.in 0fe714f63b7b1afa155c1b3dd3bd7d6764784e114d338562571f6713da1b9005
F src/sqlite.h.in 662a2fa083d093896b92560c871dea6d86792b49dc4bf7b4e8dbeca8e7171488
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4
F src/sqliteInt.h 4dcc36b21dd0c77efeb0bb38b0d31916bc63fb429c8a89d186c945eba0816447
F src/sqliteInt.h fc2e4e97faadb6ae4cd018913ce3847ab7064f13df3d5833d1cab659e46f21de
F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657
F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
@@ -685,36 +685,37 @@ F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
F src/tokenize.c 1305797eab3542a0896b552c6e7669c972c1468e11e92b370533c1f37a37082b
F src/treeview.c fccf3b8c517c1f55cb380c1522febe6921fcb2bd800c16c78cab571d0eb0ccbd
F src/trigger.c 5e68b790f022b8dafbfb0eb244786512a95c9575fc198719d2557d73e5795858
F src/update.c f118e51768d2c1309e3c81e9f91141b22b8a1339cbc5969b1b2d810feaa25b22
F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0
F src/update.c 3f4fb5ad7c9b48d7911974d6579192bb3a6c27f46140b6cbb9139cc8a77b8691
F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
F src/util.c 3ff7bc2b48dd425b1448304bb86273b05da1621f136d51dbb9789f8803559a1f
F src/vacuum.c 84ce7f01f8a7a08748e107a441db83bcec13970190ddcb0c9ff522adbc1c23fd
F src/vdbe.c 0bf4804f6e9cae872502aa4533a62ba3f6e97ee28523302deb27f9c990b5f44f
F src/vdbe.c 7415af77b86d79e51298b7be58c2e419263bc148c6ea8db9cd12e8c26197de09
F src/vdbe.h 73b904a6b3bb27f308c6cc287a5751ebc7f1f89456be0ed068a12b92844c6e8c
F src/vdbeInt.h a4147a4ddf613cb1bcb555ace9e9e74a9c099d65facd88155f191b1fb4d74cfb
F src/vdbeapi.c 40c47b1528d308a322203de21d2e0d711753257ed9771771b6129214b1d65932
F src/vdbeaux.c 3f9e3b6585e7434aa11300169dd66ddf0fc963a0c6f7940bdc058335dadeb353
F src/vdbeapi.c 41986f8c43ef4753a641ac10ac4169923ca5608c1e8afa0095f1385be406eb5e
F src/vdbeaux.c 6408c013e9aeef3d3f8ab7f54f2007d37c954a5217d0a01c067050b7bc431b44
F src/vdbeblob.c 5e61ce31aca17db8fb60395407457a8c1c7fb471dde405e0cd675974611dcfcd
F src/vdbemem.c 0388576b7cf0be13ce14b9e3b8aa90b8a1b923b60321d0242131ae0b5732b43b
F src/vdbemem.c 97143297050924c11bcfadffeb65db320a7a3fcf134006e7cff66d6fb8b502d6
F src/vdbesort.c 43756031ca7430f7aec3ef904824a7883c4ede783e51f280d99b9b65c0796e35
F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823
F src/vdbevtab.c aae4bd769410eb7e1d02c42613eec961d514459b1c3c1c63cfc84e92a137daac
F src/vtab.c a39f6ed161f16a84ff445af9dba4776b2cf0898be08a33bee8e1128a66c0074b
F src/vtab.c 4516e9fecff8d4f353132be0468bc6424b102937c50c52e01fd9a0a9e9e34ca5
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c b9df133a705093da8977da5eb202eaadb844839f1c7297c08d33471f5491843d
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b
F src/where.c 38c36bb654b4172148aef3b295bbbc1342b52078cf20174f771c746caa98f69a
F src/where.c 9a0e55ddb00fbd5d863c2ac0c847e58ff5df8c017abf4ec9598c660df834dcd2
F src/whereInt.h e25203e5bfee149f5f1225ae0166cfb4f1e65490c998a024249e98bb0647377c
F src/wherecode.c b82d0d33315e1526904b95155e55e61149c4462147668e1cc4567c812735eff1
F src/whereexpr.c a60a1f88650c561eded95c5affbe846cda71fac35033e1280f28e47934df33c8
F src/window.c 76a27cff9ea2ded0c2c3527187029259440fabcc4cc4c07b11d942c78494a614
F src/wherecode.c cfb770843e99a4a977c37103e055c2cd8b15d6d694370d1e1b3f5ea59a3b963d
F src/whereexpr.c 16d1eefd95f69843b45aba6d04fe2b63fc4f51584dff85ae380f5c20718f3c75
F src/window.c e075ea85bea322e30e361fa6e69eddba74f461e99e2a564dc09973f8a1fb27d9
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627
F test/affinity3.test f094773025eddf31135c7ad4cde722b7696f8eb07b97511f98585addf2a510a9
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/aggfault.test 777f269d0da5b0c2524c7ff6d99ae9a93db4f1b1839a914dd2a12e3035c29829
F test/aggnested.test 7269d07ac879fce161cb26c8fabe65cba5715742fac8a1fccac570dcdaf28f00
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
F test/all.test 2ecb8bbd52416642e41c9081182a8df05d42c75637afd4488aace78cc4b69e13
@@ -734,13 +735,13 @@ F test/altermalloc.test 167a47de41b5c638f5f5c6efb59784002b196fff70f98d9b4ed3cd74
F test/altermalloc2.test 17fb3724c4b004c469c27dc4ef181608aa644555fbd3f3236767584f73747c81
F test/altermalloc3.test 8531b3086f0a7889f43971a579a8c81832d5123f4703d8c86b89ba1136c63b9a
F test/alterqf.test ff6c6f881485c29ed699b8ef4774864ca1b0c01a6c08f5cdd624a008e4b40fca
F test/altertab.test 7273b8506eab46342be016af78028df49f3bd99037412f997a8f1011b37a6912
F test/altertab.test 8a2712f9076da5012a002d0b5cc0a421398a5bf61c25bab41b77c427586a7a27
F test/altertab2.test 62597b6fd08feaba1b6bfe7d31dac6117c67e06dc9ce9c478a3abe75b5926de0
F test/altertab3.test 6c432fbb9963e0bd6549bf1422f6861d744ee5a80cb3298564e81e556481df16
F test/altertrig.test fb5951d21a2c954be3b8a8cf8e10b5c0fa20687c53fd67d63cea88d08dd058d5
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
F test/analyze.test 547bb700f903107b38611b014ca645d6b5bb819f5210d7bf39c40802aafeb7d7
F test/analyze3.test 4440c4932247adb2b4e0c838f657c19dc7af4f56859255436dc4e855f39b9324
F test/analyze3.test d4e09dc556c9361a699fad816051576d29aa66caf347800847354fc1071e18c3
F test/analyze4.test 68bd069f3ac7ac1e652ddd9f04f57d5606ddb4208450f5297005db7aa0dd707d
F test/analyze5.test fa5131952303ac4146aba101b116b9c8cb89e2637531c334a6df7f7d19dddc0d
F test/analyze6.test 028f5bdfc9e5b5294768fa9a7185b8cd1d019aa7aab5b2f8ee42d7271d9a3b28
@@ -749,7 +750,7 @@ F test/analyze8.test 29ef237d8a59b39cc31c3310134fefe96a690b195e3deed5ecb65283908
F test/analyze9.test 30e1cb99336045a384a11d97900720184333c88174b3b89bc07444ea39e7df19
F test/analyzeC.test 1111830ad355d29a294a5dda654dd5f6a8622c6a223a4f7b7b3d091df7a7a42b
F test/analyzeD.test 485f621cfd2ef0a8f8ac79672586651bfa495bd899db50461bb4b558400ab3c1
F test/analyzeE.test 69d130f9ba78c9853dcd5a18317e81f462a72d704cec0c4c30afb220213acd29
F test/analyzeE.test d2ec7921c162cdc33ac8e7eb01f9ebf78100610af7c94c8552bbf551de1fb397
F test/analyzeF.test 40b5cc3ad7b10e81020d7ca86f1417647ecfae7477cfd88acc5aa7ae1068f949
F test/analyzeG.test 623be33038c49648872746c8dd8b23b5792c08fef173c55e82f1b12fca259852
F test/analyzer1.test 459fa02c445ddbf0101a3bad47b34290a35f2e49
@@ -783,7 +784,7 @@ F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
F test/avfs.test 0c3a38e03cccb0fc3127838462dc05dc3f4c1480d770c084b388304c25de3652
F test/avtrans.test b7dc25459ecbd86c6fa9c606ee3068f59d81e225118617dcf2bbb6ded2ade89e
F test/backcompat.test 3e64cedda754c778ef6bbe417b6e7a295e662a4d
F test/backup.test fc1ecefce723fad5199b55cec7a5a992ec8c3ad6873419e5e8919066dec457f3
F test/backup.test 3b08fd4af69f0fa786931103a31f4542b184aba16e239e5f22b18c3c2476697f
F test/backup2.test 8facb54df1388419d34b362ab1f7e233310ff3a3af64e8ad5ec47ba3c2bbe5cf
F test/backup4.test 8f6fd48e0dfde77b9a3bb26dc471ede3e101df32
F test/backup5.test ee5da6d7fe5082f5b9b0bbfa31d016f52412a2e4
@@ -814,7 +815,7 @@ F test/bind2.test 918bc35135f4141809ead7585909cde57d44db90a7a62aef540127148f91aa
F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0
F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142
F test/blob.test e7ac6c7d3a985cc4678c64f325292529a69ae252
F test/bloom1.test 2785a190fcc2a5e170e5d38b08aca8ff0f3e3b4a74d47453d6ac1bd355180a6a
F test/bloom1.test 80d2a16891a23fbef2a334cc7dcb6b4a60371fbaedac00aa5e3ddacac4fe3b24
F test/boundary1.tcl 6421b2d920d8b09539503a8673339d32f7609eb1
F test/boundary1.test 66d7f4706ccdb42d58eafdb081de07b0eb42d77b
F test/boundary2.tcl e34ef4e930cf1083150d4d2c603e146bd3b76bcb
@@ -883,15 +884,15 @@ F test/corruptE.test 4143791f2dfb443aec5b7fabfa5821e6063eccc3b49b06f212c2f014715
F test/corruptF.test be9fde98e4c93648f1ba52b74e5318edc8f59fe4
F test/corruptG.test adf79b669cbfd19e28c8191a610d083ae53a6d51
F test/corruptH.test 79801d97ec5c2f9f3c87739aa1ec2eb786f96454
F test/corruptI.test a17bbf54fdde78d43cf3cc34b0057719fd4a173a3d824285b67dc5257c064c7b
F test/corruptI.test 9d8cbf6214e492abe9e822e759b9751ae336cec0a6fe3ff3b37bfbd8ff9c22ca
F test/corruptJ.test 4d5ccc4bf959464229a836d60142831ef76a5aa4
F test/corruptK.test 5b4212fe346699831c5ad559a62c54e11c0611bdde1ea8423a091f9c01aa32af
F test/corruptL.test 9d1a0055c8db19baccd12f22ac36a33ec7d63afb59e82eb30835aea8f89b94df
F test/corruptL.test b42978028afc5eefc8b51d8d7cd6a9344ba7362d7ed4511ee2070f56e06d5a1c
F test/corruptM.test 7d574320e08c1b36caa3e47262061f186367d593a7e305d35f15289cc2c3e067
F test/corruptN.test 7c099d153a554001b4fb829c799b01f2ea6276cbc32479131e0db0da4efd9cc4
F test/cost.test b11cdbf9f11ffe8ef99c9881bf390e61fe92baf2182bad1dbe6de59a7295c576
F test/count.test cd4bd531066e8d77ef8fe1e3fc8253d042072e117ccab214b290cf83f1602249
F test/countofview.test e17d6e6688cf74f22783c9ec6e788c0790ee4fbbaee713affd00b1ac0bb39b86
F test/countofview.test 4088e461a10ee33e69803c177a69aa1d7bba81a9ffc2df66d76465a22ca7fdfc
F test/coveridxscan.test f35c7208dedc4f98e471c569df64c0f95a49f6e072d8dc7c8f99bdee2697de1b
F test/crash.test fb9dc4a02dcba30d4aa5c2c226f98b220b2b959f
F test/crash2.test 5b14d4eb58b880e231361d3b609b216acda86651
@@ -907,7 +908,7 @@ F test/createtab.test 85cdfdae5c3de331cd888d6c66e1aba575b47c2e3c3cc4a1d6f5414069
F test/cse.test 00b3aea44b16828833c94fbe92475fd6977583fcb064ae0bc590986812b38d0c
F test/csv01.test 2ab5514005fd308995c8910bc313e47f0368b94213b9d6c27f9a2da78796a091
F test/ctime.test 340f362f41f92972bbd71f44e10569a5cc694062b692231bd08aa6fe6c1c4773
F test/cursorhint.test 0175e4404181ace3ceca8b114eb0a98eae600d565aa4e2705abbe6614c7fe201
F test/cursorhint.test 096c8a210b31934a1964d45d7fb2aedf1e09e91773b0942abd039285b9953906
F test/cursorhint2.test 6f3aa9cb19e7418967a10ec6905209bcbb5968054da855fc36c8beee9ae9c42f
F test/dataversion1.test 6e5e86ac681f0782e766ebcb56c019ae001522d114e0e111e5ebf68ccf2a7bb8
F test/date.test 118e04db8c8b4efeb885542b4918c7b869a34c460a6bebbfe927dfd75706b80d
@@ -924,7 +925,7 @@ F test/dbstatus.test 4a4221a883025ffd39696b3d1b3910b928fb097d77e671351acb35f3aed
F test/dbstatus2.test f5fe0afed3fa45e57cfa70d1147606c20d2ba23feac78e9a172f2fe8ab5b78ef
F test/decimal.test fcf403fd5585f47342234e153c4a4338cd737b8e0884ac66fc484df47dbcf1a7
F test/default.test 9687cfb16717e4b8238c191697c98be88c0b16e568dd5368cd9284154097ef50
F test/delete.test 31832b0c45ecb51a54348c68db173be462985901e6ed7f403d6d7a8f70ab4ef0
F test/delete.test 2686e1c98d552ef37d79ad55b17b93fe96fad9737786917ce3839767f734c48f
F test/delete2.test 3a03f2cca1f9a67ec469915cb8babd6485db43fa
F test/delete3.test 555e84a00a99230b7d049d477a324a631126a6ab
F test/delete4.test 51fafebe9503a40796d1aae1565c60524cada720e50eecac01b7fd0419d9ea0b
@@ -933,8 +934,8 @@ F test/descidx1.test edc8adee58d491b06c7157c50364eaf1c3605c9c19f8093cb1ea2b6184f
F test/descidx2.test a0ba347037ff3b811f4c6ceca5fd0f9d5d72e74e59f2d9de346a9d2f6ad78298
F test/descidx3.test 953c831df7ea219c73826dfbf2f6ee02d95040725aa88ccb4fa43d1a1999b926
F test/diskfull.test 106391384780753ea6896b7b4f005d10e9866b6e
F test/distinct.test a7687c2fb50c93f6a486936c51439a93221c6e1188f9bc7b27b3ec26f9c58b1e
F test/distinct2.test cd1d15a4a2abf579298f7161e821ed50c0119136fe0424db85c52cf0adc230d1
F test/distinct.test 691c9e850b0d0b56b66e7e235453198cb4cf0760e324b7403d3c5abbeab0a014
F test/distinct2.test bb71cc7b5e58e895787f9910a788c254f679928d324732d063fe9bc202ecbe71
F test/distinctagg.test 14ec5026e684eddd414c61c08692b43773e224ac92efbed6ec08c6994bc39723
F test/e_blobbytes.test 4c01dfe4f12087b92b20705a3fdfded45dc4ed16d5a211fed4e1d2786ba68a52
F test/e_blobclose.test 692fc02a058476c2222a63d97e3f3b2b809c1842e5525ded7f854d540ac2e075
@@ -986,7 +987,7 @@ F test/filter1.test 590f8ba9a0cd0823b80d89ac75c5ce72276189cef9225d2436adaf1ee87f
F test/filter2.tcl 44e525497ce07382915f01bd29ffd0fa49dab3adb87253b5e5103ba8f93393e8
F test/filter2.test 485cf95d1f6d6ceee5632201ca52a71868599836f430cdee42e5f7f14666e30a
F test/filterfault.test c08fb491d698e8df6c122c98f7db1c65ffcfcad2c1ab0e07fa8a5be1b34eaa8b
F test/fkey1.test 55663090ab6735319a52647057b9f19f8ec8c6c7d7da25170b71a75e3e5bdeb7
F test/fkey1.test e563bcb4cb108ce3f40363cda4f84009dc89a39e2973076e5057ba99fca35378
F test/fkey2.test 1063d65e5923c054cfb8f0555a92a3ae0fa8c067275a33ee1715bd856cdb304c
F test/fkey3.test 76d475c80b84ee7a5d062e56ccb6ea68882e2b49
F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d
@@ -1152,7 +1153,7 @@ F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14
F test/fuzzerfault.test f64c4aef4c9e9edf1d6dc0d3f1e65dcc81e67c996403c88d14f09b74807a42bc
F test/fuzzinvariants.c a153253600b2b33a7d5710d40e89b2ac1373a1912517867fb995a45b2d67dcb8
F test/gcfault.test dd28c228a38976d6336a3fc42d7e5f1ad060cb8c
F test/gencol1.test cc0dbb0ee116e5602e18ea7d47f2a0f76b26e09a823b7c36ef254370c2b0f3c1
F test/gencol1.test aef8b0670abd4b1ae4cae786b15a43758d86f6cd9f12b381d45d96bb51e597c9
F test/genesis.tcl 1e2e2e8e5cc4058549a154ff1892fe5c9de19f98
F test/having.test a89236dd8d55aa50c4805f82ac9daf64d477a44d712d8209c118978d0ca21ec9
F test/hexlit.test 4a6a5f46e3c65c4bf1fa06f5dd5a9507a5627751
@@ -1162,7 +1163,7 @@ F test/hook2.test b9ff3b8c6519fb67f33192f1afe86e7782ee4ac8
F test/icu.test 716a6b89fbabe5cc63e0cd4c260befb08fd7b9d761f04d43669233292f0753b1
F test/ieee754.test b0945d12be7d255f3dfa18e2511b17ca37e0edd2b803231c52d05b86c04ab26e
F test/imposter1.test c3f1db2d3db2c24611a6596a3fc0ffc14f1466c8
F test/in.test 7399a6562fb09de7f786901f0b24b7bbe7c0b541f29ead9eb13f091edea37da4
F test/in.test d1cad4ededd425568b2e39fb0c31fa9a3772311dd595801ff13ba3912b69bba6
F test/in2.test 5d4c61d17493c832f7d2d32bef785119e87bde75
F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
F test/in4.test fdd1d8134da8376985c2edba6035a2de1f6c731524d2ffa651419e8fe2cd1c5a
@@ -1189,8 +1190,8 @@ F test/index7.test b238344318e0b4e42126717f6554f0e7dfd0b39cecad4b736039b43e1e3b6
F test/index8.test caa097735c91dbc23d8a402f5e63a2a03c83840ba3928733ed7f9a03f8a912a3
F test/index9.test 2ac891806a4136ef3e91280477e23114e67575207dc331e6797fa0ed9379f997
F test/indexedby.test f21eca4f7a6ffe14c8500a7ad6cd53166666c99e5ccd311842a28bc94a195fe0
F test/indexexpr1.test b2a15637dcbae7fd8d7e2fc51f74ac4feaf5510130ee2089a5ec5bd1ef7270e1
F test/indexexpr2.test 2c7abe3c48f8aaa5a448615ab4d13df3662185d28419c00999670834a3f0b484
F test/indexexpr1.test 62558b1cfd7ccbe7bc015849cc6d1a13ef124e80cbd5b3a98dc66c3c9cce0cf4
F test/indexexpr2.test 1c382e81ef996d8ae8b834a74f2a9013dddf59214c32201d7c8a656d739f999a
F test/indexfault.test 98d78a8ff1f5335628b62f886a1cb7c7dac1ef6d48fa39c51ec871c87dce9811
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
F test/insert.test 4e3f0de67aac3c5be1f4aaedbcea11638f1b5cdc9a3115be14d19aa9db7623c6
@@ -1215,7 +1216,7 @@ F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4
F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b
F test/istrue.test e7f285bb70282625c258e866ce6337d4c762922f5a300e1b50f958aef6e7d9c9
F test/join.test e32cb9b1491eed682489e2cde33a22a4eb7611fe5aa3b0aa4b275fe27ab3f3ac
F test/join2.test 466b07233820f5deee66a6c3bf6e4500c8bbf7b83649e67606f5f649c07928c0
F test/join2.test 8561fe82ce434ac96de91544072e578dc2cadddf2d9bc9cd802f866a9b92502e
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
F test/join5.test 91f1f4c7d81fd87b58e9ba7cf4a2b5d39e3583b4f8e498a162722a60259c5208
@@ -1229,7 +1230,7 @@ F test/joinC.test 1f1a602c2127f55f136e2cbd3bf2d26546614bf8cffe5902ec1ac9c07f87f2
F test/joinD.test 2ce62e7353a0702ca5e70008faf319c1d4686aa19fba34275c6d1da0e960be28
F test/joinE.test d5d182f3812771e2c0d97c9dcf5dbe4c41c8e21c82560e59358731c4a3981d6b
F test/joinF.test 53dd66158806823ea680dd7543b5406af151b5aafa5cd06a7f3231cd94938127
F test/joinH.test 15f501b33d848521964afde9865a92aeca79c8c41fa84dc4dc3f865c9ed8c868
F test/joinH.test 705157cf9b9b7c207caf960812a7d0e4dc1dd45aa5fb2b563f12df59088645f3
F test/journal1.test c7b768041b7f494471531e17abc2f4f5ebf9e5096984f43ed17c4eb80ba34497
F test/journal2.test 9dac6b4ba0ca79c3b21446bbae993a462c2397c4
F test/journal3.test 7c3cf23ffc77db06601c1fcfc9743de8441cb77db9d1aa931863d94f5ffa140e
@@ -1333,7 +1334,7 @@ F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf
F test/notify2.test 2ecabaa1305083856b7c39cf32816b612740c161
F test/notify3.test 796c7b7157f55c93b4e672b724e9c923a6fc6aa72ac419379a623e2350472e22
F test/notnull.test a37b663d5bb728d66fc182016613fb8e4a0a4bbf3d75b8876a7527f7d4ed3f18
F test/notnull2.test 8e1aa4f311df37f9d2cd4f5563eea955b8028c692151404e9cc896420a01a3dc
F test/notnull2.test 1ee4acbd614d3cf5f1c4a52f5af7fc771b82352f1a51a86afeaa02c9df1d82ef
F test/notnullfault.test fc4bb7845582a2b3db376001ef49118393b1b11abe0d24adb03db057ee2b73d5
F test/null.test b7ff206a1c60fe01aa2abd33ef9ea83c93727d993ca8a613de86e925c9f2bc6f
F test/nulls1.test 7a5e4346ee4285034100b4cd20e6784f16a9d6c927e44ecdf10034086bbee9c9
@@ -1374,7 +1375,7 @@ F test/pendingrace.test cbdf0f74bc939fb43cebad64dda7a0b5a3941a10b7e9cc2b596ff3e4
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
F test/permutations.test 8bd6b6db541e2a7f9bb894be99ef5c00526b23762c4a00c574e1cba697495125
F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f
F test/pragma.test aeefa47ba5ebbf4ffc6addc223568d2a95dc7ec3ba3e3c4a26b199e805f94514
F test/pragma.test d21ae02249f2a1813f016efebe616a1916b3f9abd71867da6211a50bfea373ba
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
F test/pragma3.test 92a46bbea12322dd94a404f49edcfbfc913a2c98115f0d030a7459bb4712ef31
F test/pragma4.test ca5e4dfc46adfe490f75d73734f70349d95a199e6510973899e502eef2c8b1f8
@@ -1404,7 +1405,7 @@ F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2
F test/releasetest_data.tcl b550dd1b122a9c969df794d05ea272df535f10ff1a245062e7ba080822378016
F test/resetdb.test 54c06f18bc832ac6d6319e5ab23d5c8dd49fdbeec7c696d791682a8006bd5fc3
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
F test/returning1.test 3ef7b264598b3292be0cdb028e4acb7524c5fd409b33b78449f894dfd68db334
F test/returning1.test db532cde29d6aebbc48c6ddc3149b30476f8e69ca7a2c4b53986c7635e6fd8ec
F test/returningfault.test ae4c4b5e8745813287a359d9ccdb9d5c883c2e68afb18fb0767937d5de5692a4
F test/rollback.test 06680159bc6746d0f26276e339e3ae2f951c64812468308838e0a3362d911eaa
F test/rollback2.test 3f3a4e20401825017df7e7671e9f31b6de5fae5620c2b9b49917f52f8c160a8f
@@ -1435,7 +1436,7 @@ F test/savepoint6.test f41279c5e137139fa5c21485773332c7adb98cd7
F test/savepoint7.test cde525ea3075283eb950cdcdefe23ead4f700daa
F test/savepointfault.test f044eac64b59f09746c7020ee261734de82bf9b2
F test/scanstatus.test 74391c2c0926994bf0962db6c04c9ff5b95d15a41d2e076fe011b73f92815e70
F test/scanstatus2.test ca6c258425977e5935f0ff3a8670d9b5d813dd5b83cf0bbe39acfc0fd2b5a0b1
F test/scanstatus2.test 86d60940518f97de69bc5abe8e313d8c5d1e7e841de67c36a10df3d6f09099be
F test/schema.test 5dd11c96ba64744de955315d2e4f8992e447533690153b93377dffb2a5ef5431
F test/schema2.test 906408621ea881fdb496d878b1822572a34e32c5
F test/schema3.test 8ed4ae66e082cdd8b1b1f22d8549e1e7a0db4527a8e6ee8b6193053ee1e5c9ce
@@ -1445,7 +1446,7 @@ F test/schema6.test e4bd1f23d368695eb9e7b51ef6e02ca0642ea2ab4a52579959826b5e7dce
F test/schemafault.test 1936bceca55ac82c5efbcc9fc91a1933e45c8d1e1d106b9a7e56c972a5a2a51e
F test/securedel.test 2f70b2449186a1921bd01ec9da407fbfa98c3a7a5521854c300c194b2ff09384
F test/securedel2.test 2d54c28e46eb1fd6902089958b20b1b056c6f1c5
F test/seekscan1.test d79c97de5bb1dd1fd466687f3014add514fddf8248c57baf51d749c7dfd573d8
F test/seekscan1.test 31af16e3bb3203d153aea320939c5da97ec44705c2710d153c06a01397d45b09
F test/select1.test 692e84cfa29c405854c69e8a4027183d64c22952866a123fabbce741a379e889
F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56
F test/select3.test 8d04b66df7475275a65f7e4a786d6a724c30bd9929f8ae5bd59c8d3d6e75e6cd
@@ -1490,7 +1491,7 @@ F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
F test/shrink.test 2668e607dcdfa19c52828c09b69685b38da793856582ae31debf79d90c7bbbdc
F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329
F test/skipscan1.test 1a9972e1dc15ca3887f306d3cd9a29679afb382eca0f3539f3b746f3c2ccaf68
F test/skipscan1.test e03ba5b977da6fd71662a4b0a668f04053bda4b187ff3214db7533e28c732279
F test/skipscan2.test b032ed3e0ba5caa4df6c43ef22c31566aac67783bc031869155989a7ccdb5bd5
F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5
F test/skipscan5.test 0672103fd2c8f96bd114133f356192b35ece45c794fe3677e1d9e5e3104a608e
@@ -1538,7 +1539,7 @@ F test/subquery.test 3a1a5b600b8d4f504d2a2c61f33db820983dba94a0ef3e4aedca8f0165e
F test/subquery2.test 90cf944b9de8204569cf656028391e4af1ccc8c0cc02d4ef38ee3be8de1ffb12
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
F test/substr.test a673e3763e247e9b5e497a6cacbaf3da2bd8ec8921c0677145c109f2e633f36b
F test/subtype1.test 45c85632abd38f7ea9b33f17448d966d67550f552e0822bab74576814d0d1718
F test/subtype1.test 7a9c55ed84d4ce551203d18046f925e293d75f69da81bff71aaf2696e4a2a748
F test/superlock.test ec94f0556b6488d97f71c79f9061ae08d9ab8f12
F test/swarmvtab.test 250231404fcac88f61a6c147bb0e3a118ed879278cd3ccb0ae2d3a729e1e8e26
F test/swarmvtab2.test c948cb2fdfc5b01d85e8f6d6504854202dc1a0782ab2a0ed61538f27cbd0aa5c
@@ -1562,7 +1563,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
F test/tester.tcl 8d54d40a55e12554b4509bc12078b201b233c8e842a7543629094a21b1ba956d
F test/tester.tcl 68454ef88508c196d19e8694daa27bff7107a91857799eaa12f417188ae53ede
F test/testrunner.tcl e0b36a732956c69ce19370611b8dc69b44e627d5ea8ec2a5455ca3e8a170ddaa
F test/testrunner_data.tcl 8169c68654ac8906833b8a6aadca973358a441ebf88270dd05c153e5f96f76b8
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
@@ -1612,7 +1613,7 @@ F test/tkt-868145d012.test a5f941107ece6a64410ca4755c6329b7eb57a356
F test/tkt-8c63ff0ec.test 258b7fc8d7e4e1cb5362c7d65c143528b9c4cbed
F test/tkt-91e2e8ba6f.test 08c4f94ae07696b05c9b822da0b4e5337a2f54c5
F test/tkt-94c04eaadb.test f738c57c7f68ab8be1c054415af7774617cb6223
F test/tkt-99378177930f87bd.test 2f07020a82ed1c56bdad60a8a6ef508b2f8a1fb056300b7ec650cbd9975b46bf
F test/tkt-99378177930f87bd.test 9d6cff39b50d062c813ae1cb0ebbd1b7acf81ecc23ae5d5215e5bb05667dc137
F test/tkt-9a8b09f8e6.test b2ef151d0984b2ebf237760dbeaa50724e5a0667
F test/tkt-9d68c883.test 16f7cb96781ba579bc2e19bb14b4ad609d9774b6
F test/tkt-9f2eb3abac.test cb6123ac695a08b4454c3792fbe85108f67fabf8
@@ -1769,7 +1770,7 @@ F test/unique.test 93f8b2ef5ea51b9495f8d6493429b1fd0f465264
F test/unique2.test 3674e9f2a3f1fbbfd4772ac74b7a97090d0f77d2
F test/unixexcl.test d936ba2b06794018e136418addd59a2354eeae97
F test/unordered.test 0edaf3411d300693bca595897c5201421c6c5ec787990a1dfe2f7f60ae93f1e2
F test/update.test eb7f4eb172ce270e51bb67d7867521f33a63635bb671e261bbafccaef3bd6db2
F test/update.test 90772ede84cfc779fc3d31884a84ec4c74deb501eeb09a1c6c91c03d8e94c0d8
F test/update2.test 67455bc61fcbcf96923c45b3bc4f87bc72be7d67575ad35f134906148c7b06d3
F test/upfrom1.tcl 8859d9d437f03b44174c4524a7a734a391fd4526fcff65be08285dafc9dc9041
F test/upfrom1.test 8cb06689e99cd707d884faa16da0e8eb26ff658bb01c47ddf72fadade666e6e1
@@ -1895,7 +1896,7 @@ F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2
F test/win32lock.test e0924eb8daac02bf80e9da88930747bd44dd9b230b7759fed927b1655b467c9c
F test/win32longpath.test 4baffc3acb2e5188a5e3a895b2b543ed09e62f7c72d713c1feebf76222fe9976
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
F test/window1.test 08bac934238ff66987635ea3367c5aed5b4c088c414441beaba426e68a8257c1
F test/window1.test cc3cf7ea8cbff3f69dd7e6b3b98fad1b9ccc4450c99fa0de5fffd68f5f44e8c6
F test/window2.tcl 492c125fa550cda1dd3555768a2303b3effbeceee215293adf8871efc25f1476
F test/window2.test e466a88bd626d66edc3d352d7d7e1d5531e0079b549ba44efb029d1fbff9fd3c
F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03
@@ -2045,10 +2046,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 409a19145e9558686acab730b94c6d53691b6d0efcea1e9239fc7e5863586a85
R 8cba8b939a0caa0ad935e665db07c75b
T +sym-release *
T +sym-version-3.41.0 *
P ab3331f41ec56b4ecbfbe9993292ee1a3ce84b6c158a909acadbe7f37c9e3c1a
Q +1783655ea422185e75593b89e4ef452a6f5496aefd389f88ce7fe4b7d41d6a98
Q +faa1575ce0a39a2335a77057e8769a4e67aedd6326b4627988d03f0cb21fc39a
R 96c047f578934e26c12f07eee3a82bb8
U drh
Z dc017a46fcafa54656c31865fbc11b74
Z 6d55ce9d2b6993e3f2d69e5b08ad2af4
# Remove this line to create a well-formed Fossil manifest.
+1 -1
View File
@@ -1 +1 @@
05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d
4011b9d34044340bdc49e0d3136614cac70403f805bd29a66c1870cba6cacdcf
+23
View File
@@ -1279,6 +1279,19 @@ static int renameEditSql(
return rc;
}
/*
** Set all pEList->a[].fg.eEName fields in the expression-list to val.
*/
static void renameSetENames(ExprList *pEList, int val){
if( pEList ){
int i;
for(i=0; i<pEList->nExpr; i++){
assert( val==ENAME_NAME || pEList->a[i].fg.eEName==ENAME_NAME );
pEList->a[i].fg.eEName = val;
}
}
}
/*
** Resolve all symbols in the trigger at pParse->pNewTrigger, assuming
** it was read from the schema of database zDb. Return SQLITE_OK if
@@ -1326,7 +1339,17 @@ static int renameResolveTrigger(Parse *pParse){
pSrc = 0;
rc = SQLITE_NOMEM;
}else{
/* pStep->pExprList contains an expression-list used for an UPDATE
** statement. So the a[].zEName values are the RHS of the
** "<col> = <expr>" clauses of the UPDATE statement. So, before
** running SelectPrep(), change all the eEName values in
** pStep->pExprList to ENAME_SPAN (from their current value of
** ENAME_NAME). This is to prevent any ids in ON() clauses that are
** part of pSrc from being incorrectly resolved against the
** a[].zEName values as if they were column aliases. */
renameSetENames(pStep->pExprList, ENAME_SPAN);
sqlite3SelectPrep(pParse, pSel, 0);
renameSetENames(pStep->pExprList, ENAME_NAME);
rc = pParse->nErr ? SQLITE_ERROR : SQLITE_OK;
assert( pStep->pExprList==0 || pStep->pExprList==pSel->pEList );
assert( pSrc==pSel->pSrc );
+38 -5
View File
@@ -994,11 +994,15 @@ static void analyzeOneTable(
int regIdxname = iMem++; /* Register containing index name */
int regStat1 = iMem++; /* Value for the stat column of sqlite_stat1 */
int regPrev = iMem; /* MUST BE LAST (see below) */
#ifdef SQLITE_ENABLE_STAT4
int doOnce = 1; /* Flag for a one-time computation */
#endif
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
Table *pStat1 = 0;
Table *pStat1 = 0;
#endif
pParse->nMem = MAX(pParse->nMem, iMem);
sqlite3TouchRegister(pParse, iMem);
assert( sqlite3NoTempsInRange(pParse, regNewRowid, iMem) );
v = sqlite3GetVdbe(pParse);
if( v==0 || NEVER(pTab==0) ){
return;
@@ -1104,7 +1108,7 @@ static void analyzeOneTable(
** the regPrev array and a trailing rowid (the rowid slot is required
** when building a record to insert into the sample column of
** the sqlite_stat4 table. */
pParse->nMem = MAX(pParse->nMem, regPrev+nColTest);
sqlite3TouchRegister(pParse, regPrev+nColTest);
/* Open a read-only cursor on the index being analyzed. */
assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
@@ -1276,7 +1280,35 @@ static void analyzeOneTable(
int addrIsNull;
u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
pParse->nMem = MAX(pParse->nMem, regCol+nCol);
if( doOnce ){
int mxCol = nCol;
Index *pX;
/* Compute the maximum number of columns in any index */
for(pX=pTab->pIndex; pX; pX=pX->pNext){
int nColX; /* Number of columns in pX */
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pX) ){
nColX = pX->nKeyCol;
}else{
nColX = pX->nColumn;
}
if( nColX>mxCol ) mxCol = nColX;
}
/* Allocate space to compute results for the largest index */
sqlite3TouchRegister(pParse, regCol+mxCol);
doOnce = 0;
#ifdef SQLITE_DEBUG
/* Verify that the call to sqlite3ClearTempRegCache() below
** really is needed.
** https://sqlite.org/forum/forumpost/83cb4a95a0 (2023-03-25)
*/
testcase( !sqlite3NoTempsInRange(pParse, regEq, regCol+mxCol) );
#endif
sqlite3ClearTempRegCache(pParse); /* tag-20230325-1 */
assert( sqlite3NoTempsInRange(pParse, regEq, regCol+mxCol) );
}
assert( sqlite3NoTempsInRange(pParse, regEq, regCol+nCol) );
addrNext = sqlite3VdbeCurrentAddr(v);
callStatGet(pParse, regStat, STAT_GET_ROWID, regSampleRowid);
@@ -1357,6 +1389,7 @@ static void analyzeDatabase(Parse *pParse, int iDb){
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
Table *pTab = (Table*)sqliteHashData(k);
analyzeOneTable(pParse, pTab, 0, iStatCur, iMem, iTab);
iMem = sqlite3FirstAvailableRegister(pParse, iMem);
}
loadAnalysis(pParse, iDb);
}
@@ -1837,7 +1870,7 @@ static int loadStat4(sqlite3 *db, const char *zDb){
&& IsOrdinaryTable(pStat4)
){
rc = loadStatTbl(db,
"SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx",
"SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase",
"SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4",
zDb
);
+5 -8
View File
@@ -242,13 +242,7 @@ static int backupOnePage(
assert( !isFatalError(p->rc) );
assert( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) );
assert( zSrcData );
/* Catch the case where the destination is an in-memory database and the
** page sizes of the source and destination differ.
*/
if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){
rc = SQLITE_READONLY;
}
assert( nSrcPgsz==nDestPgsz || sqlite3PagerIsMemdb(pDestPager)==0 );
/* This loop runs once for each destination page spanned by the source
** page. For each iteration, variable iOff is set to the byte offset
@@ -381,7 +375,10 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
pgszDest = sqlite3BtreeGetPageSize(p->pDest);
destMode = sqlite3PagerGetJournalMode(sqlite3BtreePager(p->pDest));
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){
if( SQLITE_OK==rc
&& (destMode==PAGER_JOURNALMODE_WAL || sqlite3PagerIsMemdb(pDestPager))
&& pgszSrc!=pgszDest
){
rc = SQLITE_READONLY;
}
+10 -6
View File
@@ -1724,13 +1724,14 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
** integer, so a value of 0 is used in its place. */
pTmp = &data[hdr+5];
top = get2byte(pTmp);
assert( top<=(int)pPage->pBt->usableSize ); /* by btreeComputeFreeSpace() */
if( gap>top ){
if( top==0 && pPage->pBt->usableSize==65536 ){
top = 65536;
}else{
return SQLITE_CORRUPT_PAGE(pPage);
}
}else if( top>(int)pPage->pBt->usableSize ){
return SQLITE_CORRUPT_PAGE(pPage);
}
/* If there is enough space between gap and top for one more cell pointer,
@@ -6084,7 +6085,7 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){
pPage = pCur->pPage;
idx = ++pCur->ix;
if( NEVER(!pPage->isInit) || sqlite3FaultSim(412) ){
if( !pPage->isInit || sqlite3FaultSim(412) ){
return SQLITE_CORRUPT_BKPT;
}
@@ -7302,7 +7303,7 @@ static int rebuildPage(
assert( i<iEnd );
j = get2byte(&aData[hdr+5]);
if( j>(u32)usableSize ){ j = 0; }
if( NEVER(j>(u32)usableSize) ){ j = 0; }
memcpy(&pTmp[j], &aData[j], usableSize - j);
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
@@ -7536,7 +7537,7 @@ static int editPage(
pData = &aData[get2byteNotZero(&aData[hdr+5])];
if( pData<pBegin ) goto editpage_fail;
if( pData>pPg->aDataEnd ) goto editpage_fail;
if( NEVER(pData>pPg->aDataEnd) ) goto editpage_fail;
/* Add cells to the start of the page */
if( iNew<iOld ){
@@ -9171,7 +9172,7 @@ int sqlite3BtreeInsert(
}
}
assert( pCur->eState==CURSOR_VALID
|| (pCur->eState==CURSOR_INVALID && loc) );
|| (pCur->eState==CURSOR_INVALID && loc) || CORRUPT_DB );
pPage = pCur->pPage;
assert( pPage->intKey || pX->nKey>=0 || (flags & BTREE_PREFORMAT) );
@@ -9213,6 +9214,7 @@ int sqlite3BtreeInsert(
assert( szNew==pPage->xCellSize(pPage, newCell) );
assert( szNew <= MX_CELL_SIZE(p->pBt) );
idx = pCur->ix;
pCur->info.nSize = 0;
if( loc==0 ){
CellInfo info;
assert( idx>=0 );
@@ -9285,7 +9287,6 @@ int sqlite3BtreeInsert(
** larger than the largest existing key, it is possible to insert the
** row without seeking the cursor. This can be a big performance boost.
*/
pCur->info.nSize = 0;
if( pPage->nOverflow ){
assert( rc==SQLITE_OK );
pCur->curFlags &= ~(BTCF_ValidNKey);
@@ -9486,6 +9487,9 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ){
return SQLITE_CORRUPT_BKPT;
}
if( pCell<&pPage->aCellIdx[pPage->nCell] ){
return SQLITE_CORRUPT_BKPT;
}
/* If the BTREE_SAVEPOSITION bit is on, then the cursor position must
** be preserved following this delete operation. If the current delete
+4 -2
View File
@@ -1451,7 +1451,7 @@ void sqlite3AddReturning(Parse *pParse, ExprList *pList){
if( pParse->pNewTrigger ){
sqlite3ErrorMsg(pParse, "cannot use RETURNING in a trigger");
}else{
assert( pParse->bReturning==0 );
assert( pParse->bReturning==0 || pParse->ifNotExists );
}
pParse->bReturning = 1;
pRet = sqlite3DbMallocZero(db, sizeof(*pRet));
@@ -1477,7 +1477,8 @@ void sqlite3AddReturning(Parse *pParse, ExprList *pList){
pRet->retTStep.pTrig = &pRet->retTrig;
pRet->retTStep.pExprList = pList;
pHash = &(db->aDb[1].pSchema->trigHash);
assert( sqlite3HashFind(pHash, RETURNING_TRIGGER_NAME)==0 || pParse->nErr );
assert( sqlite3HashFind(pHash, RETURNING_TRIGGER_NAME)==0
|| pParse->nErr || pParse->ifNotExists );
if( sqlite3HashInsert(pHash, RETURNING_TRIGGER_NAME, &pRet->retTrig)
==&pRet->retTrig ){
sqlite3OomFault(db);
@@ -2012,6 +2013,7 @@ void sqlite3AddGenerated(Parse *pParse, Expr *pExpr, Token *pType){
** turn it into one by adding a unary "+" operator. */
pExpr = sqlite3PExpr(pParse, TK_UPLUS, pExpr, 0);
}
if( pExpr && pExpr->op!=TK_RAISE ) pExpr->affExpr = pCol->affinity;
sqlite3ColumnSetExpr(pParse, pTab, pCol, pExpr);
pExpr = 0;
goto generated_done;
+6 -4
View File
@@ -114,13 +114,15 @@ static int tabIsReadOnly(Parse *pParse, Table *pTab){
** If pTab is writable but other errors have occurred -> return 1.
** If pTab is writable and no prior errors -> return 0;
*/
int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){
int sqlite3IsReadOnly(Parse *pParse, Table *pTab, Trigger *pTrigger){
if( tabIsReadOnly(pParse, pTab) ){
sqlite3ErrorMsg(pParse, "table %s may not be modified", pTab->zName);
return 1;
}
#ifndef SQLITE_OMIT_VIEW
if( !viewOk && IsView(pTab) ){
if( IsView(pTab)
&& (pTrigger==0 || (pTrigger->bReturning && pTrigger->pNext==0))
){
sqlite3ErrorMsg(pParse,"cannot modify %s because it is a view",pTab->zName);
return 1;
}
@@ -374,7 +376,7 @@ void sqlite3DeleteFrom(
goto delete_from_cleanup;
}
if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){
if( sqlite3IsReadOnly(pParse, pTab, pTrigger) ){
goto delete_from_cleanup;
}
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
@@ -483,7 +485,7 @@ void sqlite3DeleteFrom(
#endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */
{
u16 wcf = WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK;
if( sNC.ncFlags & NC_VarSelect ) bComplex = 1;
if( sNC.ncFlags & NC_Subquery ) bComplex = 1;
wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
if( HasRowid(pTab) ){
/* For a rowid table, initialize the RowSet to an empty set */
+112 -38
View File
@@ -278,11 +278,10 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr){
}else{
Expr *pNext = p->pRight;
/* The Expr.x union is never used at the same time as Expr.pRight */
assert( ExprUseXList(p) );
assert( p->x.pList==0 || p->pRight==0 );
if( p->x.pList!=0 && !db->mallocFailed ){
assert( !ExprUseXList(p) || p->x.pList==0 || p->pRight==0 );
if( ExprUseXList(p) && p->x.pList!=0 && !db->mallocFailed ){
int i;
for(i=0; ALWAYS(i<p->x.pList->nExpr); i++){
for(i=0; i<p->x.pList->nExpr; i++){
if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){
pNext = p->x.pList->a[i].pExpr;
break;
@@ -2936,7 +2935,6 @@ int sqlite3FindInIndex(
CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
int j;
assert( pReq!=0 || pRhs->iColumn==XN_ROWID || pParse->nErr );
for(j=0; j<nExpr; j++){
if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue;
assert( pIdx->azColl[j] );
@@ -3839,9 +3837,10 @@ void sqlite3ExprCodeGeneratedColumn(
){
int iAddr;
Vdbe *v = pParse->pVdbe;
int nErr = pParse->nErr;
assert( v!=0 );
assert( pParse->iSelfTab!=0 );
if( pParse->iSelfTab>0 ){
if( pParse->iSelfTab>0 ){
iAddr = sqlite3VdbeAddOp3(v, OP_IfNullRow, pParse->iSelfTab-1, 0, regOut);
}else{
iAddr = 0;
@@ -3851,6 +3850,7 @@ void sqlite3ExprCodeGeneratedColumn(
sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1);
}
if( iAddr ) sqlite3VdbeJumpHere(v, iAddr);
if( pParse->nErr>nErr ) pParse->db->errByteOffset = -1;
}
#endif /* SQLITE_OMIT_GENERATED_COLUMNS */
@@ -3867,6 +3867,7 @@ void sqlite3ExprCodeGetColumnOfTable(
Column *pCol;
assert( v!=0 );
assert( pTab!=0 );
assert( iCol!=XN_EXPR );
if( iCol<0 || iCol==pTab->iPKey ){
sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut);
VdbeComment((v, "%s.rowid", pTab->zName));
@@ -4133,6 +4134,7 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup(
IndexedExpr *p;
Vdbe *v;
for(p=pParse->pIdxEpr; p; p=p->pIENext){
u8 exprAff;
int iDataCur = p->iDataCur;
if( iDataCur<0 ) continue;
if( pParse->iSelfTab ){
@@ -4140,6 +4142,16 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup(
iDataCur = -1;
}
if( sqlite3ExprCompare(0, pExpr, p->pExpr, iDataCur)!=0 ) continue;
assert( p->aff>=SQLITE_AFF_BLOB && p->aff<=SQLITE_AFF_NUMERIC );
exprAff = sqlite3ExprAffinity(pExpr);
if( (exprAff<=SQLITE_AFF_BLOB && p->aff!=SQLITE_AFF_BLOB)
|| (exprAff==SQLITE_AFF_TEXT && p->aff!=SQLITE_AFF_TEXT)
|| (exprAff>=SQLITE_AFF_NUMERIC && p->aff!=SQLITE_AFF_NUMERIC)
){
/* Affinity mismatch on a generated column */
continue;
}
v = pParse->pVdbe;
assert( v!=0 );
if( p->bMaybeNullRow ){
@@ -4208,7 +4220,19 @@ expr_code_doover:
AggInfo *pAggInfo = pExpr->pAggInfo;
struct AggInfo_col *pCol;
assert( pAggInfo!=0 );
assert( pExpr->iAgg>=0 && pExpr->iAgg<pAggInfo->nColumn );
assert( pExpr->iAgg>=0 );
if( pExpr->iAgg>=pAggInfo->nColumn ){
/* Happens when the left table of a RIGHT JOIN is null and
** is using an expression index */
sqlite3VdbeAddOp2(v, OP_Null, 0, target);
#ifdef SQLITE_VDBE_COVERAGE
/* Verify that the OP_Null above is exercised by tests
** tag-20230325-2 */
sqlite3VdbeAddOp2(v, OP_NotNull, target, 1);
VdbeCoverageNeverTaken(v);
#endif
break;
}
pCol = &pAggInfo->aCol[pExpr->iAgg];
if( !pAggInfo->directMode ){
return AggInfoColumnReg(pAggInfo, pExpr->iAgg);
@@ -4383,11 +4407,8 @@ expr_code_doover:
#ifndef SQLITE_OMIT_CAST
case TK_CAST: {
/* Expressions of the form: CAST(pLeft AS token) */
inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target);
if( inReg!=target ){
sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target);
inReg = target;
}
sqlite3ExprCode(pParse, pExpr->pLeft, target);
assert( inReg==target );
assert( !ExprHasProperty(pExpr, EP_IntValue) );
sqlite3VdbeAddOp2(v, OP_Cast, target,
sqlite3AffinityType(pExpr->u.zToken, 0));
@@ -4719,17 +4740,16 @@ expr_code_doover:
return target;
}
case TK_COLLATE: {
if( !ExprHasProperty(pExpr, EP_Collate)
&& ALWAYS(pExpr->pLeft)
&& pExpr->pLeft->op==TK_FUNCTION
){
inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target);
if( inReg!=target ){
sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target);
inReg = target;
}
sqlite3VdbeAddOp1(v, OP_ClrSubtype, inReg);
return inReg;
if( !ExprHasProperty(pExpr, EP_Collate) ){
/* A TK_COLLATE Expr node without the EP_Collate tag is a so-called
** "SOFT-COLLATE" that is added to constraints that are pushed down
** from outer queries into sub-queries by the push-down optimization.
** Clear subtypes as subtypes may not cross a subquery boundary.
*/
assert( pExpr->pLeft );
sqlite3ExprCode(pParse, pExpr->pLeft, target);
sqlite3VdbeAddOp1(v, OP_ClrSubtype, target);
return target;
}else{
pExpr = pExpr->pLeft;
goto expr_code_doover; /* 2018-04-28: Prevent deep recursion. */
@@ -4830,16 +4850,19 @@ expr_code_doover:
break;
}
}
addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable);
/* Temporarily disable factoring of constant expressions, since
** even though expressions may appear to be constant, they are not
** really constant because they originate from the right-hand side
** of a LEFT JOIN. */
pParse->okConstFactor = 0;
inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target);
addrINR = sqlite3VdbeAddOp3(v, OP_IfNullRow, pExpr->iTable, 0, target);
/* The OP_IfNullRow opcode above can overwrite the result register with
** NULL. So we have to ensure that the result register is not a value
** that is suppose to be a constant. Two defenses are needed:
** (1) Temporarily disable factoring of constant expressions
** (2) Make sure the computed value really is stored in register
** "target" and not someplace else.
*/
pParse->okConstFactor = 0; /* note (1) above */
sqlite3ExprCode(pParse, pExpr->pLeft, target);
assert( target==inReg );
pParse->okConstFactor = okConstFactor;
sqlite3VdbeJumpHere(v, addrINR);
sqlite3VdbeChangeP3(v, addrINR, inReg);
break;
}
@@ -5076,7 +5099,9 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){
inReg = sqlite3ExprCodeTarget(pParse, pExpr, target);
if( inReg!=target ){
u8 op;
if( ALWAYS(pExpr) && ExprHasProperty(pExpr,EP_Subquery) ){
if( ALWAYS(pExpr)
&& (ExprHasProperty(pExpr,EP_Subquery) || pExpr->op==TK_REGISTER)
){
op = OP_Copy;
}else{
op = OP_SCopy;
@@ -6261,9 +6286,11 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
int iAgg = pExpr->iAgg;
Parse *pParse = pWalker->pParse;
sqlite3 *db = pParse->db;
assert( iAgg>=0 );
if( pExpr->op!=TK_AGG_FUNCTION ){
assert( iAgg>=0 && iAgg<pAggInfo->nColumn );
if( pAggInfo->aCol[iAgg].pCExpr==pExpr ){
if( iAgg<pAggInfo->nColumn
&& pAggInfo->aCol[iAgg].pCExpr==pExpr
){
pExpr = sqlite3ExprDup(db, pExpr, 0);
if( pExpr ){
pAggInfo->aCol[iAgg].pCExpr = pExpr;
@@ -6272,8 +6299,9 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
}
}else{
assert( pExpr->op==TK_AGG_FUNCTION );
assert( iAgg>=0 && iAgg<pAggInfo->nFunc );
if( pAggInfo->aFunc[iAgg].pFExpr==pExpr ){
if( ALWAYS(iAgg<pAggInfo->nFunc)
&& pAggInfo->aFunc[iAgg].pFExpr==pExpr
){
pExpr = sqlite3ExprDup(db, pExpr, 0);
if( pExpr ){
pAggInfo->aFunc[iAgg].pFExpr = pExpr;
@@ -6413,6 +6441,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
default: {
IndexedExpr *pIEpr;
Expr tmp;
int i;
assert( pParse->iSelfTab==0 );
if( (pNC->ncFlags & NC_InAggFunc)==0 ) break;
if( pParse->pIdxEpr==0 ) break;
@@ -6423,7 +6452,12 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
}
if( pIEpr==0 ) break;
if( NEVER(!ExprUseYTab(pExpr)) ) break;
if( pExpr->pAggInfo!=0 ) break; /* Already resolved by outer context */
for(i=0; i<pSrcList->nSrc; i++){
if( pSrcList->a[0].iCursor==pIEpr->iDataCur ) break;
}
if( i>=pSrcList->nSrc ) break;
if( NEVER(pExpr->pAggInfo!=0) ) break; /* Resolved by outer context */
if( pParse->nErr ){ return WRC_Abort; }
/* If we reach this point, it means that expression pExpr can be
** translated into a reference to an index column as described by
@@ -6434,6 +6468,9 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
tmp.iTable = pIEpr->iIdxCur;
tmp.iColumn = pIEpr->iIdxCol;
findOrCreateAggInfoColumn(pParse, pAggInfo, &tmp);
if( pParse->nErr ){ return WRC_Abort; }
assert( pAggInfo->aCol!=0 );
assert( tmp.iAgg<pAggInfo->nColumn );
pAggInfo->aCol[tmp.iAgg].pCExpr = pExpr;
pExpr->pAggInfo = pAggInfo;
pExpr->iAgg = tmp.iAgg;
@@ -6457,7 +6494,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
} /* endif pExpr->iTable==pItem->iCursor */
} /* end loop over pSrcList */
}
return WRC_Prune;
return WRC_Continue;
}
case TK_AGG_FUNCTION: {
if( (pNC->ncFlags & NC_InAggFunc)==0
@@ -6610,6 +6647,35 @@ void sqlite3ClearTempRegCache(Parse *pParse){
pParse->nRangeReg = 0;
}
/*
** Make sure sufficient registers have been allocated so that
** iReg is a valid register number.
*/
void sqlite3TouchRegister(Parse *pParse, int iReg){
if( pParse->nMem<iReg ) pParse->nMem = iReg;
}
/*
** Return the latest reusable register in the set of all registers.
** The value returned is no less than iMin. If any register iMin or
** greater is in permanent use, then return one more than that last
** permanent register.
*/
int sqlite3FirstAvailableRegister(Parse *pParse, int iMin){
const ExprList *pList = pParse->pConstExpr;
if( pList ){
int i;
for(i=0; i<pList->nExpr; i++){
if( pList->a[i].u.iConstExprReg>=iMin ){
iMin = pList->a[i].u.iConstExprReg + 1;
}
}
}
pParse->nTempReg = 0;
pParse->nRangeReg = 0;
return iMin;
}
/*
** Validate that no temporary register falls within the range of
** iFirst..iLast, inclusive. This routine is only call from within assert()
@@ -6629,6 +6695,14 @@ int sqlite3NoTempsInRange(Parse *pParse, int iFirst, int iLast){
return 0;
}
}
if( pParse->pConstExpr ){
ExprList *pList = pParse->pConstExpr;
for(i=0; i<pList->nExpr; i++){
int iReg = pList->a[i].u.iConstExprReg;
if( iReg==0 ) continue;
if( iReg>=iFirst && iReg<=iLast ) return 0;
}
}
return 1;
}
#endif /* SQLITE_DEBUG */
+8 -8
View File
@@ -1317,22 +1317,22 @@ static Trigger *fkActionTrigger(
if( action==OE_Restrict ){
int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
Token tFrom;
Token tDb;
SrcList *pSrc;
Expr *pRaise;
tFrom.z = zFrom;
tFrom.n = nFrom;
tDb.z = db->aDb[iDb].zDbSName;
tDb.n = sqlite3Strlen30(tDb.z);
pRaise = sqlite3Expr(db, TK_RAISE, "FOREIGN KEY constraint failed");
if( pRaise ){
pRaise->affExpr = OE_Abort;
}
pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
if( pSrc ){
assert( pSrc->nSrc==1 );
pSrc->a[0].zName = sqlite3DbStrDup(db, zFrom);
pSrc->a[0].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zDbSName);
}
pSelect = sqlite3SelectNew(pParse,
sqlite3ExprListAppend(pParse, 0, pRaise),
sqlite3SrcListAppend(pParse, 0, &tDb, &tFrom),
pSrc,
pWhere,
0, 0, 0, 0, 0
);
+12
View File
@@ -2161,6 +2161,18 @@ static void ceilingFunc(
static double xCeil(double x){ return ceil(x); }
static double xFloor(double x){ return floor(x); }
/*
** Some systems do not have log2() and log10() in their standard math
** libraries.
*/
#if defined(HAVE_LOG10) && HAVE_LOG10==0
# define log10(X) (0.4342944819032517867*log(X))
#endif
#if defined(HAVE_LOG2) && HAVE_LOG2==0
# define log2(X) (1.442695040888963456*log(X))
#endif
/*
** Implementation of SQL functions:
**
+2 -2
View File
@@ -794,7 +794,7 @@ void sqlite3Insert(
/* Cannot insert into a read-only table.
*/
if( sqlite3IsReadOnly(pParse, pTab, tmask) ){
if( sqlite3IsReadOnly(pParse, pTab, pTrigger) ){
goto insert_cleanup;
}
@@ -1241,7 +1241,7 @@ void sqlite3Insert(
}
/* Copy the new data already generated. */
assert( pTab->nNVCol>0 );
assert( pTab->nNVCol>0 || pParse->nErr>0 );
sqlite3VdbeAddOp3(v, OP_Copy, regRowid+1, regCols+1, pTab->nNVCol-1);
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
+4
View File
@@ -5522,6 +5522,10 @@ static int getPageNormal(
if( !isOpen(pPager->fd) || pPager->dbSize<pgno || noContent ){
if( pgno>pPager->mxPgno ){
rc = SQLITE_FULL;
if( pgno<=pPager->dbSize ){
sqlite3PcacheRelease(pPg);
pPg = 0;
}
goto pager_acquire_err;
}
if( noContent ){
+1 -1
View File
@@ -713,7 +713,7 @@ seltablist(A) ::= stl_prefix(A) nm(Y) dbnm(D) LP exprlist(E) RP as(Z) on_using(N
seltablist(A) ::= stl_prefix(A) LP seltablist(F) RP as(Z) on_using(N). {
if( A==0 && Z.n==0 && N.pOn==0 && N.pUsing==0 ){
A = F;
}else if( F->nSrc==1 ){
}else if( ALWAYS(F!=0) && F->nSrc==1 ){
A = sqlite3SrcListAppendFromTerm(pParse,A,0,0,&Z,0,&N);
if( A ){
SrcItem *pNew = &A->a[A->nSrc-1];
+4 -4
View File
@@ -41,7 +41,7 @@
struct PCache {
PgHdr *pDirty, *pDirtyTail; /* List of dirty pages in LRU order */
PgHdr *pSynced; /* Last synced page in dirty page list */
int nRefSum; /* Sum of ref counts over all pages */
i64 nRefSum; /* Sum of ref counts over all pages */
int szCache; /* Configured cache size */
int szSpill; /* Size before spilling occurs */
int szPage; /* Size of every page in this cache */
@@ -71,7 +71,7 @@ struct PCache {
unsigned char *a;
int j;
pPg = (PgHdr*)pLower->pExtra;
printf("%3d: nRef %2d flgs %02x data ", i, pPg->nRef, pPg->flags);
printf("%3lld: nRef %2d flgs %02x data ", i, pPg->nRef, pPg->flags);
a = (unsigned char *)pLower->pBuf;
for(j=0; j<12; j++) printf("%02x", a[j]);
printf(" ptr %p\n", pPg);
@@ -815,14 +815,14 @@ PgHdr *sqlite3PcacheDirtyList(PCache *pCache){
** This is not the total number of pages referenced, but the sum of the
** reference count for all pages.
*/
int sqlite3PcacheRefCount(PCache *pCache){
i64 sqlite3PcacheRefCount(PCache *pCache){
return pCache->nRefSum;
}
/*
** Return the number of references to the page supplied as an argument.
*/
int sqlite3PcachePageRefcount(PgHdr *p){
i64 sqlite3PcachePageRefcount(PgHdr *p){
return p->nRef;
}
+3 -3
View File
@@ -40,7 +40,7 @@ struct PgHdr {
** private to pcache.c and should not be accessed by other modules.
** pCache is grouped with the public elements for efficiency.
*/
i16 nRef; /* Number of users of this page */
i64 nRef; /* Number of users of this page */
PgHdr *pDirtyNext; /* Next element in list of dirty pages */
PgHdr *pDirtyPrev; /* Previous element in list of dirty pages */
/* NB: pDirtyNext and pDirtyPrev are undefined if the
@@ -121,12 +121,12 @@ void sqlite3PcacheClearSyncFlags(PCache *);
void sqlite3PcacheClear(PCache*);
/* Return the total number of outstanding page references */
int sqlite3PcacheRefCount(PCache*);
i64 sqlite3PcacheRefCount(PCache*);
/* Increment the reference count of an existing page */
void sqlite3PcacheRef(PgHdr*);
int sqlite3PcachePageRefcount(PgHdr*);
i64 sqlite3PcachePageRefcount(PgHdr*);
/* Return the total number of pages stored in the cache */
int sqlite3PcachePagecount(PCache*);
+36 -4
View File
@@ -1524,7 +1524,7 @@ void sqlite3Pragma(
zDb = db->aDb[iDb].zDbSName;
sqlite3CodeVerifySchema(pParse, iDb);
sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow;
sqlite3TouchRegister(pParse, pTab->nCol+regRow);
sqlite3OpenTable(pParse, 0, iDb, pTab, OP_OpenRead);
sqlite3VdbeLoadString(v, regResult, pTab->zName);
assert( IsOrdinaryTable(pTab) );
@@ -1565,7 +1565,7 @@ void sqlite3Pragma(
** regRow..regRow+n. If any of the child key values are NULL, this
** row cannot cause an FK violation. Jump directly to addrOk in
** this case. */
if( regRow+pFK->nCol>pParse->nMem ) pParse->nMem = regRow+pFK->nCol;
sqlite3TouchRegister(pParse, regRow + pFK->nCol);
for(j=0; j<pFK->nCol; j++){
int iCol = aiCols ? aiCols[j] : pFK->aCol[j].iFrom;
sqlite3ExprCodeGetColumnOfTable(v, pTab, 0, iCol, regRow+j);
@@ -1694,6 +1694,7 @@ void sqlite3Pragma(
if( iDb>=0 && i!=iDb ) continue;
sqlite3CodeVerifySchema(pParse, i);
pParse->okConstFactor = 0; /* tag-20230327-1 */
/* Do an integrity check of the B-Tree
**
@@ -1729,7 +1730,7 @@ void sqlite3Pragma(
aRoot[0] = cnt;
/* Make sure sufficient number of registers have been allocated */
pParse->nMem = MAX( pParse->nMem, 8+mxIdx );
sqlite3TouchRegister(pParse, 8+mxIdx);
sqlite3ClearTempRegCache(pParse);
/* Do the b-tree integrity checks */
@@ -1879,15 +1880,29 @@ void sqlite3Pragma(
labelOk = sqlite3VdbeMakeLabel(pParse);
if( pCol->notNull ){
/* (1) NOT NULL columns may not contain a NULL */
int jmp3;
int jmp2 = sqlite3VdbeAddOp4Int(v, OP_IsType, p1, labelOk, p3, p4);
sqlite3VdbeChangeP5(v, 0x0f);
VdbeCoverage(v);
if( p1<0 ){
sqlite3VdbeChangeP5(v, 0x0f); /* INT, REAL, TEXT, or BLOB */
jmp3 = jmp2;
}else{
sqlite3VdbeChangeP5(v, 0x0d); /* INT, TEXT, or BLOB */
/* OP_IsType does not detect NaN values in the database file
** which should be treated as a NULL. So if the header type
** is REAL, we have to load the actual data using OP_Column
** to reliably determine if the value is a NULL. */
sqlite3VdbeAddOp3(v, OP_Column, p1, p3, 3);
jmp3 = sqlite3VdbeAddOp2(v, OP_NotNull, 3, labelOk);
VdbeCoverage(v);
}
zErr = sqlite3MPrintf(db, "NULL value in %s.%s", pTab->zName,
pCol->zCnName);
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, zErr, P4_DYNAMIC);
if( doTypeCheck ){
sqlite3VdbeGoto(v, labelError);
sqlite3VdbeJumpHere(v, jmp2);
sqlite3VdbeJumpHere(v, jmp3);
}else{
/* VDBE byte code will fall thru */
}
@@ -1987,6 +2002,23 @@ void sqlite3Pragma(
jmp4 = integrityCheckResultRow(v);
sqlite3VdbeJumpHere(v, jmp2);
/* The OP_IdxRowid opcode is an optimized version of OP_Column
** that extracts the rowid off the end of the index record.
** But it only works correctly if index record does not have
** any extra bytes at the end. Verify that this is the case. */
if( HasRowid(pTab) ){
int jmp7;
sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur+j, 3);
jmp7 = sqlite3VdbeAddOp3(v, OP_Eq, 3, 0, r1+pIdx->nColumn-1);
VdbeCoverage(v);
sqlite3VdbeLoadString(v, 3,
"rowid not at end-of-record for row ");
sqlite3VdbeAddOp3(v, OP_Concat, 7, 3, 3);
sqlite3VdbeLoadString(v, 4, " of index ");
sqlite3VdbeGoto(v, jmp5-1);
sqlite3VdbeJumpHere(v, jmp7);
}
/* Any indexed columns with non-BINARY collations must still hold
** the exact same text value as the table. */
label6 = 0;
+8 -2
View File
@@ -306,7 +306,9 @@ int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFlags){
#else
encoding = SQLITE_UTF8;
#endif
if( db->nVdbeActive>0 && encoding!=ENC(db) ){
if( db->nVdbeActive>0 && encoding!=ENC(db)
&& (db->mDbFlags & DBFLAG_Vacuum)==0
){
rc = SQLITE_LOCKED;
goto initone_error_out;
}else{
@@ -700,7 +702,11 @@ static int sqlite3Prepare(
sParse.db = db;
sParse.pReprepare = pReprepare;
assert( ppStmt && *ppStmt==0 );
if( db->mallocFailed ) sqlite3ErrorMsg(&sParse, "out of memory");
if( db->mallocFailed ){
sqlite3ErrorMsg(&sParse, "out of memory");
db->errCode = rc = SQLITE_NOMEM;
goto end_prepare;
}
assert( sqlite3_mutex_held(db->mutex) );
/* For a long-term use prepared statement avoid the use of
+5 -9
View File
@@ -947,14 +947,10 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){
testcase( ExprHasProperty(pExpr, EP_OuterON) );
assert( !ExprHasProperty(pExpr, EP_IntValue) );
if( pExpr->op==TK_NOTNULL ){
pExpr->u.zToken = "true";
ExprSetProperty(pExpr, EP_IsTrue);
}else{
pExpr->u.zToken = "false";
ExprSetProperty(pExpr, EP_IsFalse);
}
pExpr->op = TK_TRUEFALSE;
pExpr->u.iValue = (pExpr->op==TK_NOTNULL);
pExpr->flags |= EP_IntValue;
pExpr->op = TK_INTEGER;
for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
p->nRef = anRef[i];
}
@@ -1256,8 +1252,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
assert( pNC->nRef>=nRef );
if( nRef!=pNC->nRef ){
ExprSetProperty(pExpr, EP_VarSelect);
pNC->ncFlags |= NC_VarSelect;
}
pNC->ncFlags |= NC_Subquery;
}
break;
}
+36 -25
View File
@@ -2318,7 +2318,7 @@ void sqlite3SubqueryColumnTypes(
assert( (pSelect->selFlags & SF_Resolved)!=0 );
assert( pTab->nCol==pSelect->pEList->nExpr || pParse->nErr>0 );
assert( aff==SQLITE_AFF_NONE || aff==SQLITE_AFF_BLOB );
if( db->mallocFailed ) return;
if( db->mallocFailed || IN_RENAME_OBJECT ) return;
while( pSelect->pPrior ) pSelect = pSelect->pPrior;
a = pSelect->pEList->a;
memset(&sNC, 0, sizeof(sNC));
@@ -2332,8 +2332,6 @@ void sqlite3SubqueryColumnTypes(
pCol->affinity = sqlite3ExprAffinity(p);
if( pCol->affinity<=SQLITE_AFF_NONE ){
pCol->affinity = aff;
}else if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
pCol->affinity = SQLITE_AFF_FLEXNUM;
}
if( pCol->affinity>=SQLITE_AFF_TEXT && pSelect->pNext ){
int m = 0;
@@ -2347,6 +2345,9 @@ void sqlite3SubqueryColumnTypes(
if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){
pCol->affinity = SQLITE_AFF_BLOB;
}
if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
pCol->affinity = SQLITE_AFF_FLEXNUM;
}
}
zType = columnType(&sNC, p, 0, 0, 0);
if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){
@@ -2362,18 +2363,18 @@ void sqlite3SubqueryColumnTypes(
break;
}
}
}
}
if( zType ){
i64 m = sqlite3Strlen30(zType);
n = sqlite3Strlen30(pCol->zCnName);
pCol->zCnName = sqlite3DbReallocOrFree(db, pCol->zCnName, n+m+2);
if( pCol->zCnName ){
memcpy(&pCol->zCnName[n+1], zType, m+1);
pCol->colFlags |= COLFLAG_HASTYPE;
}else{
testcase( pCol->colFlags & COLFLAG_HASTYPE );
pCol->colFlags &= ~(COLFLAG_HASTYPE|COLFLAG_HASCOLL);
}
}
if( zType ){
i64 m = sqlite3Strlen30(zType);
n = sqlite3Strlen30(pCol->zCnName);
pCol->zCnName = sqlite3DbReallocOrFree(db, pCol->zCnName, n+m+2);
pCol->colFlags &= ~(COLFLAG_HASTYPE|COLFLAG_HASCOLL);
if( pCol->zCnName ){
memcpy(&pCol->zCnName[n+1], zType, m+1);
pCol->colFlags |= COLFLAG_HASTYPE;
}else{
testcase( pCol->colFlags & COLFLAG_HASTYPE );
}
}
pColl = sqlite3ExprCollSeq(pParse, p);
@@ -3861,7 +3862,9 @@ static Expr *substExpr(
sqlite3VectorErrorMsg(pSubst->pParse, pCopy);
}else{
sqlite3 *db = pSubst->pParse->db;
if( pSubst->isOuterJoin && pCopy->op!=TK_COLUMN ){
if( pSubst->isOuterJoin
&& (pCopy->op!=TK_COLUMN || pCopy->iTable!=pSubst->iNewTable)
){
memset(&ifNullRow, 0, sizeof(ifNullRow));
ifNullRow.op = TK_IF_NULL_ROW;
ifNullRow.pLeft = pCopy;
@@ -6377,14 +6380,17 @@ static void optimizeAggregateUseOfIndexedExpr(
NameContext *pNC /* Name context used to resolve agg-func args */
){
assert( pAggInfo->iFirstReg==0 );
assert( pSelect!=0 );
assert( pSelect->pGroupBy!=0 );
pAggInfo->nColumn = pAggInfo->nAccumulator;
if( ALWAYS(pAggInfo->nSortingColumn>0) ){
if( pAggInfo->nColumn==0 ){
pAggInfo->nSortingColumn = 0;
}else{
pAggInfo->nSortingColumn =
pAggInfo->aCol[pAggInfo->nColumn-1].iSorterColumn+1;
int mx = pSelect->pGroupBy->nExpr - 1;
int j, k;
for(j=0; j<pAggInfo->nColumn; j++){
k = pAggInfo->aCol[j].iSorterColumn;
if( k>mx ) mx = k;
}
pAggInfo->nSortingColumn = mx+1;
}
analyzeAggFuncArgs(pAggInfo, pNC);
#if TREETRACE_ENABLED
@@ -6418,11 +6424,13 @@ static int aggregateIdxEprRefToColCallback(Walker *pWalker, Expr *pExpr){
if( pExpr->op==TK_AGG_FUNCTION ) return WRC_Continue;
if( pExpr->op==TK_IF_NULL_ROW ) return WRC_Continue;
pAggInfo = pExpr->pAggInfo;
assert( pExpr->iAgg>=0 && pExpr->iAgg<pAggInfo->nColumn );
if( NEVER(pExpr->iAgg>=pAggInfo->nColumn) ) return WRC_Continue;
assert( pExpr->iAgg>=0 );
pCol = &pAggInfo->aCol[pExpr->iAgg];
pExpr->op = TK_AGG_COLUMN;
pExpr->iTable = pCol->iTable;
pExpr->iColumn = pCol->iColumn;
ExprClearProperty(pExpr, EP_Skip|EP_Collate);
return WRC_Prune;
}
@@ -6804,7 +6812,9 @@ static int countOfViewOptimization(Parse *pParse, Select *p){
if( (p->selFlags & SF_Aggregate)==0 ) return 0; /* This is an aggregate */
if( p->pEList->nExpr!=1 ) return 0; /* Single result column */
if( p->pWhere ) return 0;
if( p->pHaving ) return 0;
if( p->pGroupBy ) return 0;
if( p->pOrderBy ) return 0;
pExpr = p->pEList->a[0].pExpr;
if( pExpr->op!=TK_AGG_FUNCTION ) return 0; /* Result is an aggregate */
assert( ExprUseUToken(pExpr) );
@@ -6815,13 +6825,15 @@ static int countOfViewOptimization(Parse *pParse, Select *p){
if( ExprHasProperty(pExpr, EP_WinFunc) ) return 0;/* Not a window function */
pSub = p->pSrc->a[0].pSelect;
if( pSub==0 ) return 0; /* The FROM is a subquery */
if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */
if( pSub->pPrior==0 ) return 0; /* Must be a compound */
if( pSub->selFlags & SF_CopyCte ) return 0; /* Not a CTE */
do{
if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
if( pSub->pWhere ) return 0; /* No WHERE clause */
if( pSub->pLimit ) return 0; /* No LIMIT clause */
if( pSub->selFlags & SF_Aggregate ) return 0; /* Not an aggregate */
pSub = pSub->pPrior; /* Repeat over compound */
assert( pSub->pHaving==0 ); /* Due to the previous */
pSub = pSub->pPrior; /* Repeat over compound */
}while( pSub );
/* If we reach this point then it is OK to perform the transformation */
@@ -7258,7 +7270,6 @@ int sqlite3Select(
&& countOfViewOptimization(pParse, p)
){
if( db->mallocFailed ) goto select_end;
pEList = p->pEList;
pTabList = p->pSrc;
}
#endif
+9 -147
View File
@@ -1829,6 +1829,7 @@ static void output_c_string(FILE *out, const char *z){
*/
static void output_json_string(FILE *out, const char *z, i64 n){
unsigned int c;
if( z==0 ) z = "";
if( n<0 ) n = strlen(z);
fputc('"', out);
while( n-- ){
@@ -2088,6 +2089,7 @@ static void printSchemaLine(FILE *out, const char *z, const char *zTail){
int i;
for(i=0; i<ArraySize(azTerm); i++){
char *zNew = sqlite3_mprintf("%s%s;", zOrig, azTerm[i]);
shell_check_oom(zNew);
if( sqlite3_complete(zNew) ){
size_t n = strlen(zNew);
zNew[n-1] = 0;
@@ -2774,6 +2776,7 @@ static char *shell_error_context(const char *zSql, sqlite3 *db){
if( db==0
|| zSql==0
|| (iOffset = sqlite3_error_offset(db))<0
|| iOffset>=strlen(zSql)
){
return sqlite3_mprintf("");
}
@@ -2785,7 +2788,7 @@ static char *shell_error_context(const char *zSql, sqlite3 *db){
len = strlen(zSql);
if( len>78 ){
len = 78;
while( (zSql[len]&0xc0)==0x80 ) len--;
while( len>0 && (zSql[len]&0xc0)==0x80 ) len--;
}
zCode = sqlite3_mprintf("%.*s", len, zSql);
shell_check_oom(zCode);
@@ -3675,6 +3678,7 @@ static void exec_prepared_stmt_columnar(
}
if( wx<0 ) wx = -wx;
uz = (const unsigned char*)sqlite3_column_name(pStmt,i);
if( uz==0 ) uz = (u8*)"";
azData[i] = translateForDisplayAndDup(uz, &zNotUsed, wx, bw);
}
do{
@@ -5090,53 +5094,6 @@ readHexDb_error:
}
#endif /* SQLITE_OMIT_DESERIALIZE */
/*
** Scalar function "shell_int32". The first argument to this function
** must be a blob. The second a non-negative integer. This function
** reads and returns a 32-bit big-endian integer from byte
** offset (4*<arg2>) of the blob.
*/
static void shellInt32(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
const unsigned char *pBlob;
int nBlob;
int iInt;
UNUSED_PARAMETER(argc);
nBlob = sqlite3_value_bytes(argv[0]);
pBlob = (const unsigned char*)sqlite3_value_blob(argv[0]);
iInt = sqlite3_value_int(argv[1]);
if( iInt>=0 && (iInt+1)*4<=nBlob ){
const unsigned char *a = &pBlob[iInt*4];
sqlite3_int64 iVal = ((sqlite3_int64)a[0]<<24)
+ ((sqlite3_int64)a[1]<<16)
+ ((sqlite3_int64)a[2]<< 8)
+ ((sqlite3_int64)a[3]<< 0);
sqlite3_result_int64(context, iVal);
}
}
/*
** Scalar function "shell_idquote(X)" returns string X quoted as an identifier,
** using "..." with internal double-quote characters doubled.
*/
static void shellIdQuote(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
const char *zName = (const char*)sqlite3_value_text(argv[0]);
UNUSED_PARAMETER(argc);
if( zName ){
char *z = sqlite3_mprintf("\"%w\"", zName);
sqlite3_result_text(context, z, -1, sqlite3_free);
}
}
/*
** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X.
*/
@@ -5151,97 +5108,6 @@ static void shellUSleepFunc(
sqlite3_result_int(context, sleep);
}
/*
** Scalar function "shell_escape_crnl" used by the .recover command.
** The argument passed to this function is the output of built-in
** function quote(). If the first character of the input is "'",
** indicating that the value passed to quote() was a text value,
** then this function searches the input for "\n" and "\r" characters
** and adds a wrapper similar to the following:
**
** replace(replace(<input>, '\n', char(10), '\r', char(13));
**
** Or, if the first character of the input is not "'", then a copy
** of the input is returned.
*/
static void shellEscapeCrnl(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
const char *zText = (const char*)sqlite3_value_text(argv[0]);
UNUSED_PARAMETER(argc);
if( zText && zText[0]=='\'' ){
i64 nText = sqlite3_value_bytes(argv[0]);
i64 i;
char zBuf1[20];
char zBuf2[20];
const char *zNL = 0;
const char *zCR = 0;
i64 nCR = 0;
i64 nNL = 0;
for(i=0; zText[i]; i++){
if( zNL==0 && zText[i]=='\n' ){
zNL = unused_string(zText, "\\n", "\\012", zBuf1);
nNL = strlen(zNL);
}
if( zCR==0 && zText[i]=='\r' ){
zCR = unused_string(zText, "\\r", "\\015", zBuf2);
nCR = strlen(zCR);
}
}
if( zNL || zCR ){
i64 iOut = 0;
i64 nMax = (nNL > nCR) ? nNL : nCR;
i64 nAlloc = nMax * nText + (nMax+64)*2;
char *zOut = (char*)sqlite3_malloc64(nAlloc);
if( zOut==0 ){
sqlite3_result_error_nomem(context);
return;
}
if( zNL && zCR ){
memcpy(&zOut[iOut], "replace(replace(", 16);
iOut += 16;
}else{
memcpy(&zOut[iOut], "replace(", 8);
iOut += 8;
}
for(i=0; zText[i]; i++){
if( zText[i]=='\n' ){
memcpy(&zOut[iOut], zNL, nNL);
iOut += nNL;
}else if( zText[i]=='\r' ){
memcpy(&zOut[iOut], zCR, nCR);
iOut += nCR;
}else{
zOut[iOut] = zText[i];
iOut++;
}
}
if( zNL ){
memcpy(&zOut[iOut], ",'", 2); iOut += 2;
memcpy(&zOut[iOut], zNL, nNL); iOut += nNL;
memcpy(&zOut[iOut], "', char(10))", 12); iOut += 12;
}
if( zCR ){
memcpy(&zOut[iOut], ",'", 2); iOut += 2;
memcpy(&zOut[iOut], zCR, nCR); iOut += nCR;
memcpy(&zOut[iOut], "', char(13))", 12); iOut += 12;
}
sqlite3_result_text(context, zOut, iOut, SQLITE_TRANSIENT);
sqlite3_free(zOut);
return;
}
}
sqlite3_result_value(context, argv[0]);
}
/* Flags for open_db().
**
** The default behavior of open_db() is to exit(1) if the database fails to
@@ -5366,12 +5232,6 @@ static void open_db(ShellState *p, int openFlags){
shellModuleSchema, 0, 0);
sqlite3_create_function(p->db, "shell_putsnl", 1, SQLITE_UTF8, p,
shellPutsFunc, 0, 0);
sqlite3_create_function(p->db, "shell_escape_crnl", 1, SQLITE_UTF8, 0,
shellEscapeCrnl, 0, 0);
sqlite3_create_function(p->db, "shell_int32", 2, SQLITE_UTF8, 0,
shellInt32, 0, 0);
sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0,
shellIdQuote, 0, 0);
sqlite3_create_function(p->db, "usleep",1,SQLITE_UTF8,0,
shellUSleepFunc, 0, 0);
#ifndef SQLITE_NOHAVE_SYSTEM
@@ -5641,7 +5501,7 @@ static int sql_trace_callback(
utf8_printf(p->traceOut, "-- closing database connection\n");
return 0;
}
if( mType!=SQLITE_TRACE_ROW && ((const char*)pX)[0]=='-' ){
if( mType!=SQLITE_TRACE_ROW && pX!=0 && ((const char*)pX)[0]=='-' ){
zSql = (const char*)pX;
}else{
pStmt = (sqlite3_stmt*)pP;
@@ -6201,7 +6061,9 @@ static int shell_dbinfo_command(ShellState *p, int nArg, char **azArg){
if( sqlite3_step(pStmt)==SQLITE_ROW
&& sqlite3_column_bytes(pStmt,0)>100
){
memcpy(aHdr, sqlite3_column_blob(pStmt,0), 100);
const u8 *pb = sqlite3_column_blob(pStmt,0);
shell_check_oom((void*)pb);
memcpy(aHdr, pb, 100);
sqlite3_finalize(pStmt);
}else{
raw_printf(stderr, "unable to read database header\n");
+8 -2
View File
@@ -3341,7 +3341,7 @@ struct NameContext {
#define NC_HasAgg 0x000010 /* One or more aggregate functions seen */
#define NC_IdxExpr 0x000020 /* True if resolving columns of CREATE INDEX */
#define NC_SelfRef 0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */
#define NC_VarSelect 0x000040 /* A correlated subquery has been seen */
#define NC_Subquery 0x000040 /* A subquery has been seen */
#define NC_UEList 0x000080 /* True if uNC.pEList is used */
#define NC_UAggInfo 0x000100 /* True if uNC.pAggInfo is used */
#define NC_UUpsert 0x000200 /* True if uNC.pUpsert is used */
@@ -3660,6 +3660,7 @@ struct IndexedExpr {
int iIdxCur; /* The index cursor */
int iIdxCol; /* The index column that contains value of pExpr */
u8 bMaybeNullRow; /* True if we need an OP_IfNullRow check */
u8 aff; /* Affinity of the pExpr expression */
IndexedExpr *pIENext; /* Next in a list of all indexed expressions */
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
const char *zIdxName; /* Name of index, used only for bytecode comments */
@@ -3711,6 +3712,9 @@ struct Parse {
u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */
#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */
#endif
#ifdef SQLITE_DEBUG
u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */
#endif
int nRangeReg; /* Size of the temporary register block */
int iRangeReg; /* First register in temporary register block */
@@ -4643,6 +4647,8 @@ void sqlite3ReleaseTempReg(Parse*,int);
int sqlite3GetTempRange(Parse*,int);
void sqlite3ReleaseTempRange(Parse*,int,int);
void sqlite3ClearTempRegCache(Parse*);
void sqlite3TouchRegister(Parse*,int);
int sqlite3FirstAvailableRegister(Parse*,int);
#ifdef SQLITE_DEBUG
int sqlite3NoTempsInRange(Parse*,int,int);
#endif
@@ -4793,7 +4799,7 @@ Select *sqlite3SelectNew(Parse*,ExprList*,SrcList*,Expr*,ExprList*,
Expr*,ExprList*,u32,Expr*);
void sqlite3SelectDelete(sqlite3*, Select*);
Table *sqlite3SrcListLookup(Parse*, SrcList*);
int sqlite3IsReadOnly(Parse*, Table*, int);
int sqlite3IsReadOnly(Parse*, Table*, Trigger*);
void sqlite3OpenTable(Parse*, int iCur, int iDb, Table*, int);
#if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY)
Expr *sqlite3LimitWhere(Parse*,SrcList*,Expr*,ExprList*,Expr*,char*);
+5 -1
View File
@@ -202,6 +202,7 @@ void sqlite3BeginTrigger(
}else{
assert( !db->init.busy );
sqlite3CodeVerifySchema(pParse, iDb);
VVA_ONLY( pParse->ifNotExists = 1; )
}
goto trigger_cleanup;
}
@@ -983,7 +984,7 @@ static void codeReturningTrigger(
}
sqlite3ExprListDelete(db, sSelect.pEList);
pNew = sqlite3ExpandReturning(pParse, pReturning->pReturnEL, pTab);
if( !db->mallocFailed ){
if( pParse->nErr==0 ){
NameContext sNC;
memset(&sNC, 0, sizeof(sNC));
if( pReturning->nRetCol==0 ){
@@ -1452,6 +1453,9 @@ u32 sqlite3TriggerColmask(
Trigger *p;
assert( isNew==1 || isNew==0 );
if( IsView(pTab) ){
return 0xffffffff;
}
for(p=pTrigger; p; p=p->pNext){
if( p->op==op
&& (tr_tm&p->tr_tm)
+16 -6
View File
@@ -408,7 +408,7 @@ void sqlite3Update(
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
goto update_cleanup;
}
if( sqlite3IsReadOnly(pParse, pTab, tmask) ){
if( sqlite3IsReadOnly(pParse, pTab, pTrigger) ){
goto update_cleanup;
}
@@ -727,12 +727,22 @@ void sqlite3Update(
/* Begin the database scan.
**
** Do not consider a single-pass strategy for a multi-row update if
** there are any triggers or foreign keys to process, or rows may
** be deleted as a result of REPLACE conflict handling. Any of these
** things might disturb a cursor being used to scan through the table
** or index, causing a single-pass approach to malfunction. */
** there is anything that might disrupt the cursor being used to do
** the UPDATE:
** (1) This is a nested UPDATE
** (2) There are triggers
** (3) There are FOREIGN KEY constraints
** (4) There are REPLACE conflict handlers
** (5) There are subqueries in the WHERE clause
*/
flags = WHERE_ONEPASS_DESIRED;
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){
if( !pParse->nested
&& !pTrigger
&& !hasFK
&& !chngKey
&& !bReplace
&& (sNC.ncFlags & NC_Subquery)==0
){
flags |= WHERE_ONEPASS_MULTIROW;
}
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere,0,0,0,flags,iIdxCur);
+8 -2
View File
@@ -683,8 +683,7 @@ static u64 filterHash(const Mem *aMem, const Op *pOp){
}else if( p->flags & MEM_Real ){
h += sqlite3VdbeIntValue(p);
}else if( p->flags & (MEM_Str|MEM_Blob) ){
h += p->n;
if( p->flags & MEM_Zero ) h += p->u.nZero;
/* no-op */
}
}
return h;
@@ -2619,6 +2618,12 @@ case OP_IsNull: { /* same as TK_ISNULL, jump, in1 */
** (0x01) bit. SQLITE_FLOAT is the 0x02 bit. SQLITE_TEXT is 0x04.
** SQLITE_BLOB is 0x08. SQLITE_NULL is 0x10.
**
** WARNING: This opcode does not reliably distinguish between NULL and REAL
** when P1>=0. If the database contains a NaN value, this opcode will think
** that the datatype is REAL when it should be NULL. When P1<0 and the value
** is already stored in register P3, then this opcode does reliably
** distinguish between NULL and REAL. The problem only arises then P1>=0.
**
** Take the jump to address P2 if and only if the datatype of the
** value determined by P1 and P3 corresponds to one of the bits in the
** P5 bitmask.
@@ -4966,6 +4971,7 @@ case OP_SeekScan: { /* ncycle */
break;
}
nStep--;
pC->cacheStatus = CACHE_STALE;
rc = sqlite3BtreeNext(pC->uc.pCursor, 0);
if( rc ){
if( rc==SQLITE_DONE ){
+21 -12
View File
@@ -271,7 +271,7 @@ int sqlite3_value_type(sqlite3_value* pVal){
SQLITE_NULL, /* 0x1f (not possible) */
SQLITE_FLOAT, /* 0x20 INTREAL */
SQLITE_NULL, /* 0x21 (not possible) */
SQLITE_TEXT, /* 0x22 INTREAL + TEXT */
SQLITE_FLOAT, /* 0x22 INTREAL + TEXT */
SQLITE_NULL, /* 0x23 (not possible) */
SQLITE_FLOAT, /* 0x24 (not possible) */
SQLITE_NULL, /* 0x25 (not possible) */
@@ -2138,15 +2138,24 @@ int sqlite3_stmt_scanstatus_v2(
void *pOut /* OUT: Write the answer here */
){
Vdbe *p = (Vdbe*)pStmt;
VdbeOp *aOp = p->aOp;
int nOp = p->nOp;
ScanStatus *pScan;
int idx;
if( p->pFrame ){
VdbeFrame *pFrame;
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent);
aOp = pFrame->aOp;
nOp = pFrame->nOp;
}
if( iScan<0 ){
int ii;
if( iScanStatusOp==SQLITE_SCANSTAT_NCYCLE ){
i64 res = 0;
for(ii=0; ii<p->nOp; ii++){
res += p->aOp[ii].nCycle;
for(ii=0; ii<nOp; ii++){
res += aOp[ii].nCycle;
}
*(i64*)pOut = res;
return 0;
@@ -2172,7 +2181,7 @@ int sqlite3_stmt_scanstatus_v2(
switch( iScanStatusOp ){
case SQLITE_SCANSTAT_NLOOP: {
if( pScan->addrLoop>0 ){
*(sqlite3_int64*)pOut = p->aOp[pScan->addrLoop].nExec;
*(sqlite3_int64*)pOut = aOp[pScan->addrLoop].nExec;
}else{
*(sqlite3_int64*)pOut = -1;
}
@@ -2180,7 +2189,7 @@ int sqlite3_stmt_scanstatus_v2(
}
case SQLITE_SCANSTAT_NVISIT: {
if( pScan->addrVisit>0 ){
*(sqlite3_int64*)pOut = p->aOp[pScan->addrVisit].nExec;
*(sqlite3_int64*)pOut = aOp[pScan->addrVisit].nExec;
}else{
*(sqlite3_int64*)pOut = -1;
}
@@ -2202,7 +2211,7 @@ int sqlite3_stmt_scanstatus_v2(
}
case SQLITE_SCANSTAT_EXPLAIN: {
if( pScan->addrExplain ){
*(const char**)pOut = p->aOp[ pScan->addrExplain ].p4.z;
*(const char**)pOut = aOp[ pScan->addrExplain ].p4.z;
}else{
*(const char**)pOut = 0;
}
@@ -2210,7 +2219,7 @@ int sqlite3_stmt_scanstatus_v2(
}
case SQLITE_SCANSTAT_SELECTID: {
if( pScan->addrExplain ){
*(int*)pOut = p->aOp[ pScan->addrExplain ].p1;
*(int*)pOut = aOp[ pScan->addrExplain ].p1;
}else{
*(int*)pOut = -1;
}
@@ -2218,7 +2227,7 @@ int sqlite3_stmt_scanstatus_v2(
}
case SQLITE_SCANSTAT_PARENTID: {
if( pScan->addrExplain ){
*(int*)pOut = p->aOp[ pScan->addrExplain ].p2;
*(int*)pOut = aOp[ pScan->addrExplain ].p2;
}else{
*(int*)pOut = -1;
}
@@ -2236,18 +2245,18 @@ int sqlite3_stmt_scanstatus_v2(
if( iIns==0 ) break;
if( iIns>0 ){
while( iIns<=iEnd ){
res += p->aOp[iIns].nCycle;
res += aOp[iIns].nCycle;
iIns++;
}
}else{
int iOp;
for(iOp=0; iOp<p->nOp; iOp++){
Op *pOp = &p->aOp[iOp];
for(iOp=0; iOp<nOp; iOp++){
Op *pOp = &aOp[iOp];
if( pOp->p1!=iEnd ) continue;
if( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_NCYCLE)==0 ){
continue;
}
res += p->aOp[iOp].nCycle;
res += aOp[iOp].nCycle;
}
}
}
+14 -2
View File
@@ -3320,6 +3320,8 @@ int sqlite3VdbeHalt(Vdbe *p){
db->flags &= ~(u64)SQLITE_DeferFKs;
sqlite3CommitInternalChanges(db);
}
}else if( p->rc==SQLITE_SCHEMA && db->nVdbeActive>1 ){
p->nChange = 0;
}else{
sqlite3RollbackAll(db, SQLITE_OK);
p->nChange = 0;
@@ -5329,6 +5331,16 @@ void sqlite3VdbePreUpdateHook(
PreUpdate preupdate;
const char *zTbl = pTab->zName;
static const u8 fakeSortOrder = 0;
#ifdef SQLITE_DEBUG
int nRealCol;
if( pTab->tabFlags & TF_WithoutRowid ){
nRealCol = sqlite3PrimaryKeyIndex(pTab)->nColumn;
}else if( pTab->tabFlags & TF_HasVirtual ){
nRealCol = pTab->nNVCol;
}else{
nRealCol = pTab->nCol;
}
#endif
assert( db->pPreUpdate==0 );
memset(&preupdate, 0, sizeof(PreUpdate));
@@ -5345,8 +5357,8 @@ void sqlite3VdbePreUpdateHook(
assert( pCsr!=0 );
assert( pCsr->eCurType==CURTYPE_BTREE );
assert( pCsr->nField==pTab->nCol
|| (pCsr->nField==pTab->nCol+1 && op==SQLITE_DELETE && iReg==-1)
assert( pCsr->nField==nRealCol
|| (pCsr->nField==nRealCol+1 && op==SQLITE_DELETE && iReg==-1)
);
preupdate.v = v;
+6 -7
View File
@@ -1483,8 +1483,11 @@ static int valueFromFunction(
if( pList ) nVal = pList->nExpr;
assert( !ExprHasProperty(p, EP_IntValue) );
pFunc = sqlite3FindFunction(db, p->u.zToken, nVal, enc, 0);
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
if( pFunc==0 ) return SQLITE_OK;
#endif
assert( pFunc );
if( (pFunc->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG))==0
if( (pFunc->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG))==0
|| (pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL)
){
return SQLITE_OK;
@@ -1519,16 +1522,11 @@ static int valueFromFunction(
}else{
sqlite3ValueApplyAffinity(pVal, aff, SQLITE_UTF8);
assert( rc==SQLITE_OK );
assert( enc==pVal->enc
|| (pVal->flags & MEM_Str)==0
|| db->mallocFailed );
#if 0 /* Not reachable except after a prior failure */
rc = sqlite3VdbeChangeEncoding(pVal, enc);
if( rc==SQLITE_OK && sqlite3VdbeMemTooBig(pVal) ){
if( NEVER(rc==SQLITE_OK && sqlite3VdbeMemTooBig(pVal)) ){
rc = SQLITE_TOOBIG;
pCtx->pParse->nErr++;
}
#endif
}
value_from_function_out:
@@ -1592,6 +1590,7 @@ static int valueFromExpr(
rc = valueFromExpr(db, pExpr->pLeft, enc, aff, ppVal, pCtx);
testcase( rc!=SQLITE_OK );
if( *ppVal ){
rc = ExpandBlob(*ppVal);
sqlite3VdbeMemCast(*ppVal, aff, enc);
sqlite3ValueApplyAffinity(*ppVal, affinity, enc);
}
+2
View File
@@ -610,7 +610,9 @@ static int vtabCallConstructor(
sCtx.pPrior = db->pVtabCtx;
sCtx.bDeclared = 0;
db->pVtabCtx = &sCtx;
pTab->nTabRef++;
rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr);
sqlite3DeleteTable(db, pTab);
db->pVtabCtx = sCtx.pPrior;
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
assert( sCtx.pTab==pTab );
+61 -17
View File
@@ -962,7 +962,11 @@ static SQLITE_NOINLINE void constructAutomaticIndex(
** original table changes and the index and table cannot both be used
** if they go out of sync.
*/
extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
if( IsView(pTable) ){
extraCols = ALLBITS;
}else{
extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
}
mxBitCol = MIN(BMS-1,pTable->nCol);
testcase( pTable->nCol==BMS-1 );
testcase( pTable->nCol==BMS-2 );
@@ -1123,6 +1127,10 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter(
Vdbe *v = pParse->pVdbe; /* VDBE under construction */
WhereLoop *pLoop = pLevel->pWLoop; /* The loop being coded */
int iCur; /* Cursor for table getting the filter */
IndexedExpr *saved_pIdxEpr; /* saved copy of Parse.pIdxEpr */
saved_pIdxEpr = pParse->pIdxEpr;
pParse->pIdxEpr = 0;
assert( pLoop!=0 );
assert( v!=0 );
@@ -1179,9 +1187,8 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter(
int r1 = sqlite3GetTempRange(pParse, n);
int jj;
for(jj=0; jj<n; jj++){
int iCol = pIdx->aiColumn[jj];
assert( pIdx->pTable==pItem->pTab );
sqlite3ExprCodeGetColumnOfTable(v, pIdx->pTable, iCur, iCol,r1+jj);
sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iCur, jj, r1+jj);
}
sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pLevel->regFilter, 0, r1, n);
sqlite3ReleaseTempRange(pParse, r1, n);
@@ -1212,6 +1219,7 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter(
}
}while( iLevel < pWInfo->nLevel );
sqlite3VdbeJumpHere(v, addrOnce);
pParse->pIdxEpr = saved_pIdxEpr;
}
@@ -1510,6 +1518,7 @@ static int whereKeyStats(
assert( pRec!=0 );
assert( pIdx->nSample>0 );
assert( pRec->nField>0 );
/* Do a binary search to find the first sample greater than or equal
** to pRec. If pRec contains a single field, the set of samples to search
@@ -1555,7 +1564,12 @@ static int whereKeyStats(
** it is extended to two fields. The duplicates that this creates do not
** cause any problems.
*/
nField = MIN(pRec->nField, pIdx->nSample);
if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
nField = pIdx->nKeyCol;
}else{
nField = pIdx->nColumn;
}
nField = MIN(pRec->nField, nField);
iCol = 0;
iSample = pIdx->nSample * nField;
do{
@@ -1991,7 +2005,7 @@ static int whereRangeScanEst(
UNUSED_PARAMETER(pBuilder);
assert( pLower || pUpper );
#endif
assert( pUpper==0 || (pUpper->wtFlags & TERM_VNULL)==0 );
assert( pUpper==0 || (pUpper->wtFlags & TERM_VNULL)==0 || pParse->nErr>0 );
nNew = whereRangeAdjust(pLower, nOut);
nNew = whereRangeAdjust(pUpper, nNew);
@@ -5283,6 +5297,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){
pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
}
if( pWInfo->pSelect->pOrderBy
&& pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){
pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr;
}
}else{
pWInfo->revMask = pFrom->revLoop;
if( pWInfo->nOBSat<=0 ){
@@ -5694,6 +5712,9 @@ static SQLITE_NOINLINE void whereAddIndexedExpr(
p->iIdxCur = iIdxCur;
p->iIdxCol = i;
p->bMaybeNullRow = bMaybeNullRow;
if( sqlite3IndexAffinityStr(pParse->db, pIdx) ){
p->aff = pIdx->zColAff[i];
}
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
p->zIdxName = pIdx->zName;
#endif
@@ -5951,22 +5972,45 @@ WhereInfo *sqlite3WhereBegin(
}
if( pParse->nErr ) goto whereBeginError;
/* Special case: WHERE terms that do not refer to any tables in the join
** (constant expressions). Evaluate each such term, and jump over all the
** generated code if the result is not true.
/* The False-WHERE-Term-Bypass optimization:
**
** Do not do this if the expression contains non-deterministic functions
** that are not within a sub-select. This is not strictly required, but
** preserves SQLite's legacy behaviour in the following two cases:
** If there are WHERE terms that are false, then no rows will be output,
** so skip over all of the code generated here.
**
** FROM ... WHERE random()>0; -- eval random() once per row
** FROM ... WHERE (SELECT random())>0; -- eval random() once overall
** Conditions:
**
** (1) The WHERE term must not refer to any tables in the join.
** (2) The term must not come from an ON clause on the
** right-hand side of a LEFT or FULL JOIN.
** (3) The term must not come from an ON clause, or there must be
** no RIGHT or FULL OUTER joins in pTabList.
** (4) If the expression contains non-deterministic functions
** that are not within a sub-select. This is not required
** for correctness but rather to preserves SQLite's legacy
** behaviour in the following two cases:
**
** WHERE random()>0; -- eval random() once per row
** WHERE (SELECT random())>0; -- eval random() just once overall
**
** Note that the Where term need not be a constant in order for this
** optimization to apply, though it does need to be constant relative to
** the current subquery (condition 1). The term might include variables
** from outer queries so that the value of the term changes from one
** invocation of the current subquery to the next.
*/
for(ii=0; ii<sWLB.pWC->nBase; ii++){
WhereTerm *pT = &sWLB.pWC->a[ii];
WhereTerm *pT = &sWLB.pWC->a[ii]; /* A term of the WHERE clause */
Expr *pX; /* The expression of pT */
if( pT->wtFlags & TERM_VIRTUAL ) continue;
if( pT->prereqAll==0 && (nTabList==0 || exprIsDeterministic(pT->pExpr)) ){
sqlite3ExprIfFalse(pParse, pT->pExpr, pWInfo->iBreak, SQLITE_JUMPIFNULL);
pX = pT->pExpr;
assert( pX!=0 );
assert( pT->prereqAll!=0 || !ExprHasProperty(pX, EP_OuterON) );
if( pT->prereqAll==0 /* Conditions (1) and (2) */
&& (nTabList==0 || exprIsDeterministic(pX)) /* Condition (4) */
&& !(ExprHasProperty(pX, EP_InnerON) /* Condition (3) */
&& (pTabList->a[0].fg.jointype & JT_LTORJ)!=0 )
){
sqlite3ExprIfFalse(pParse, pX, pWInfo->iBreak, SQLITE_JUMPIFNULL);
pT->wtFlags |= TERM_CODED;
}
}
@@ -6209,7 +6253,7 @@ WhereInfo *sqlite3WhereBegin(
assert( n<=pTab->nCol );
}
#ifdef SQLITE_ENABLE_CURSOR_HINTS
if( pLoop->u.btree.pIndex!=0 ){
if( pLoop->u.btree.pIndex!=0 && (pTab->tabFlags & TF_WithoutRowid)==0 ){
sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ|bFordelete);
}else
#endif
+2 -11
View File
@@ -1925,7 +1925,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
** guess. */
addrSeekScan = sqlite3VdbeAddOp1(v, OP_SeekScan,
(pIdx->aiRowLogEst[0]+9)/10);
if( pRangeStart ){
if( pRangeStart || pRangeEnd ){
sqlite3VdbeChangeP5(v, 1);
sqlite3VdbeChangeP2(v, addrSeekScan, sqlite3VdbeCurrentAddr(v)+1);
addrSeekScan = 0;
@@ -1966,16 +1966,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
assert( pLevel->p2==0 );
if( pRangeEnd ){
Expr *pRight = pRangeEnd->pExpr->pRight;
if( addrSeekScan ){
/* For a seek-scan that has a range on the lowest term of the index,
** we have to make the top of the loop be code that sets the end
** condition of the range. Otherwise, the OP_SeekScan might jump
** over that initialization, leaving the range-end value set to the
** range-start value, resulting in a wrong answer.
** See ticket 5981a8c041a3c2f3 (2021-11-02).
*/
pLevel->p2 = sqlite3VdbeCurrentAddr(v);
}
assert( addrSeekScan==0 );
codeExprOrVector(pParse, pRight, regBase+nEq, nTop);
whereLikeOptimizationStringFixup(v, pLevel, pRangeEnd);
if( (pRangeEnd->wtFlags & TERM_VNULL)==0
+1 -1
View File
@@ -1856,7 +1856,7 @@ void sqlite3WhereTabFuncArgs(
pRhs = sqlite3PExpr(pParse, TK_UPLUS,
sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0);
pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs);
if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){
if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){
joinType = EP_OuterON;
}else{
joinType = EP_InnerON;
+1
View File
@@ -785,6 +785,7 @@ static int selectWindowRewriteExprCb(Walker *pWalker, Expr *pExpr){
}
/* no break */ deliberate_fall_through
case TK_IF_NULL_ROW:
case TK_AGG_FUNCTION:
case TK_COLUMN: {
int iCol = -1;
+43
View File
@@ -0,0 +1,43 @@
# 2023 March 30
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix aggfault
do_execsql_test 1 {
CREATE TABLE t1(x);
CREATE INDEX t1x ON t1(x, x=0);
}
faultsim_save_and_close
do_faultsim_test 2 -faults oom* -prep {
faultsim_restore_and_reopen
execsql { SELECT * FROM sqlite_schema }
} -body {
execsql {
SELECT * FROM t1 AS a1 WHERE (
SELECT count(x AND 0=a1.x) FROM t1 GROUP BY abs(1)
) AND x=(
SELECT * FROM t1 AS a1
WHERE (SELECT count(x IS 1 AND a1.x=0)
FROM t1
GROUP BY abs(1)) AND x=0
);
}
} -test {
faultsim_test_result {0 {}}
}
finish_test
+18
View File
@@ -981,4 +981,22 @@ do_catchsql_test 32.0 {
ALTER TABLE t1 RENAME TO x;
} {1 {error in trigger r1: no tables specified}}
# 2023-04-13 https://sqlite.org/forum/forumpost/ff3840145a
#
reset_db
do_execsql_test 33.0 {
CREATE TABLE t1(a TEXT);
INSERT INTO t1(a) VALUES('abc'),('def'),(NULL);
CREATE TABLE t2(b TEXT);
CREATE TRIGGER r3 AFTER INSERT ON t1 BEGIN
UPDATE t2 SET (b,a)=(SELECT 1) FROM t1 JOIN t2 ON (SELECT * FROM (SELECT a));
END;
}
do_catchsql_test 33.1 {
ALTER TABLE t1 RENAME COLUMN a TO b;
} {1 {error in trigger r3 after rename: no such column: a}}
do_execsql_test 33.2 {
SELECT quote(a) FROM t1 ORDER BY +a;
} {NULL 'abc' 'def'}
finish_test
+13
View File
@@ -736,4 +736,17 @@ do_execsql_test 7.2 {
ANALYZE sqlite_master;
}
# 2023-04-22 https://sqlite.org/forum/info/6c118daad0f1f5ef
# Case differences in the sqlite_stat4.idx field should not matter.
#
reset_db
do_execsql_test 8.0 {
CREATE TABLE t1(a PRIMARY KEY, v) WITHOUT ROWID;
ANALYZE sqlite_schema;
INSERT INTO sqlite_stat1 VALUES('t1','t1','1 1');
INSERT INTO sqlite_stat4 VALUES('t1','t1','1','0','0',X'021b76657273696f6e');
INSERT INTO sqlite_stat4 VALUES('T1','T1','1','0','0',X'021b76657273696f6e');
ANALYZE sqlite_schema;
} {}
finish_test
+52
View File
@@ -239,4 +239,56 @@ do_execsql_test analyzeE-4.11 {
SELECT * FROM t1 WHERE a<1900 AND c=123
} {/SCAN t1/}
# 2023-03-23 https://sqlite.org/forum/forumpost/dc4854437b
#
reset_db
do_execsql_test analyzeE-5.0 {
PRAGMA encoding = 'UTF-16';
CREATE TABLE t0 (c1 TEXT);
INSERT INTO t0 VALUES ('');
CREATE INDEX i0 ON t0(c1);
ANALYZE;
SELECT * FROM t0 WHERE t0.c1 BETWEEN '' AND (ABS(''));
} {{}}
# 2023-03-24 https://sqlite.org/forum/forumpost/bc39e531e5
#
reset_db
do_execsql_test analyzeE-6.0 {
CREATE TABLE t1(x);
CREATE INDEX i1 ON t1(x,x,x,x,x||2);
CREATE INDEX i2 ON t1(1<2);
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<1000)
INSERT INTO t1(x) SELECT x FROM c;
ANALYZE;
} {}
do_execsql_test analyzeE-6.1 {
SELECT count(*)>1 FROM sqlite_stat4 WHERE idx='i2' AND neq='1000 1';
} 1
do_execsql_test analyzeE-6.2 {
SELECT count(*) FROM sqlite_stat4 WHERE idx='i2' AND neq<>'1000 1';
} 0
do_execsql_test analyzeE-6.3 {
SELECT count(*)>1 FROM sqlite_stat4 WHERE idx='i1' AND neq='1 1 1 1 1 1';
} 1
do_execsql_test analyzeE-6.4 {
SELECT count(*) FROM sqlite_stat4 WHERE idx='i1' AND neq<>'1 1 1 1 1 1';
} 0
# 2023-03-25 https://sqlite.org/forum/forumpost/5275207102
# Correctly expand zeroblobs while processing STAT4 information
# during query planning.
#
reset_db
do_execsql_test analyzeE-7.0 {
CREATE TABLE t1(a TEXT COLLATE binary);
CREATE INDEX t1x ON t1(a);
INSERT INTO t1(a) VALUES(0),('apple'),(NULL),(''),('banana');
ANALYZE;
SELECT format('(%s)',a) FROM t1 WHERE t1.a > CAST(zeroblob(5) AS TEXT);
} {(0) (apple) (banana)}
do_execsql_test analyzeE-7.1 {
SELECT format('(%s)',a) FROM t1 WHERE t1.a <= CAST(zeroblob(5) AS TEXT);
} {()}
finish_test
+23
View File
@@ -977,5 +977,28 @@ do_test backup-11.1 {
sqlite3_backup B db1 main db2 temp
B finish
} {SQLITE_OK}
db1 close
db2 close
#-------------------------------------------------------------------------
do_test backup-12.1 {
sqlite3 db1 :memory:
sqlite3 db2 :memory:
db1 eval {
PRAGMA page_size = 8192;
CREATE TABLE t1(x);
}
db2 eval {
PRAGMA page_size = 1024;
CREATE TABLE t2(x);
}
sqlite3_backup B db1 main db2 temp
B step 100
B finish
} {SQLITE_READONLY}
finish_test
+73 -1
View File
@@ -99,6 +99,78 @@ do_eqp_test 2.1 {
| |--SCAN transit
| `--SEARCH objs USING COVERING INDEX objs_cspo (o=? AND p=?)
`--SCAN transit
}
}
# 2023-02-28
# https://sqlite.org/forum/forumpost/0846211821
#
# Bloom filter gives an incorrect result if the collating sequence is
# anything other than binary.
#
reset_db
do_execsql_test 3.1 {
CREATE TABLE t0(x TEXT COLLATE rtrim);
INSERT INTO t0(x) VALUES ('a'), ('b'), ('c');
CREATE VIEW v0(y) AS SELECT DISTINCT x FROM t0;
SELECT count(*) FROM t0, v0 WHERE x='b ';
} 3
do_eqp_test 3.2 {
SELECT count(*) FROM t0, v0 WHERE x='b ';
} {
QUERY PLAN
|--CO-ROUTINE v0
| |--SCAN t0
| `--USE TEMP B-TREE FOR DISTINCT
|--SCAN v0
`--SEARCH t0 USING AUTOMATIC PARTIAL COVERING INDEX (x=?)
}
# ^^^^^--- The key feature in the previous result is that no Bloom filter
# is used. In the following, a Bloom filter is used because the data type
# is INT instead of TEXT.
do_execsql_test 3.3 {
CREATE TABLE t1(x INT COLLATE rtrim);
INSERT INTO t1(x) VALUES ('a'), ('b'), ('c');
CREATE VIEW v1(y) AS SELECT DISTINCT x FROM t1;
SELECT count(*) FROM t1, v1 WHERE x='b ';
} 3
# 2023-03-14
# https://sqlite.org/forum/forumpost/d47a0e8e3a
# https://sqlite.org/forum/forumpost/2e427099d5
#
# Both reports are for the same problem - using a Bloom filter on an
# expression index can cause issues.
#
reset_db
do_execsql_test 4.1 {
CREATE TABLE t1(x TEXT, y INT, z TEXT);
INSERT INTO t1(rowid,x,y,z) VALUES(12,'aa','bb','aa');
CREATE INDEX i1x ON t1(1 IS true,z);
CREATE TABLE t0(x TEXT);
INSERT INTO t0(rowid,x) VALUES(4,'aa');
ANALYZE sqlite_schema;
INSERT INTO sqlite_stat1 VALUES('t0',NULL,'20');
INSERT INTO sqlite_stat1 VALUES('t1','i1x','18 18 2');
ANALYZE sqlite_schema;
}
do_execsql_test 4.2 {
SELECT * FROM t0 NATURAL JOIN t1 WHERE z=t1.x;
} {aa bb aa}
do_execsql_test 4.3 {
DROP TABLE t0;
CREATE TABLE t0(a TEXT);
INSERT INTO t0 VALUES ('xyz');
CREATE INDEX t0x ON t0(a IS FALSE) WHERE false;
DROP TABLE t1;
CREATE TABLE t1(b INT);
INSERT INTO t1 VALUES('aaa'),('bbb'),('ccc'),('ddd'),(NULL);
CREATE TABLE t2(c REAL);
INSERT INTO t2 VALUES(7);
ANALYZE;
CREATE INDEX t2x ON t2(true IN ());
}
do_execsql_test 4.4 {
SELECT * FROM t0 LEFT JOIN t1 LEFT JOIN t2 ON (b NOTNULL)==(c IN ()) WHERE c;
} {xyz {} 7.0}
finish_test
+1 -6
View File
@@ -123,18 +123,13 @@ do_execsql_test 4.0 {
set root [db one {SELECT rootpage FROM sqlite_master}]
set offset [expr ($root-1) * 65536]
ifcapable oversize_cell_check {
set res {1 {database disk image is malformed}}
} else {
set res {0 {}}
}
do_test 4.1 {
db close
hexio_write test.db [expr $offset + 8 + 2] 0000
hexio_write test.db [expr $offset + 5] 0000
sqlite3 db test.db
catchsql { DELETE FROM t1 WHERE a=0 }
} $res
} {1 {database disk image is malformed}}
#-------------------------------------------------------------------------
+5 -2
View File
@@ -1269,11 +1269,14 @@ do_test 15.0 {
}]} {}
extra_schema_checks 0
do_execsql_test 15.1 {
do_catchsql_test 15.1 {
PRAGMA cell_size_check = 0;
UPDATE c1 SET c= NOT EXISTS(SELECT 1 FROM c1 ORDER BY (SELECT 1 FROM c1 ORDER BY a)) +10 WHERE d BETWEEN 4 AND 7;
} {}
} {1 {database disk image is malformed}}
extra_schema_checks 1
do_execsql_test 15.2 {
PRAGMA integrity_check;
} {/in database main/}
#-------------------------------------------------------------------------
reset_db
+51
View File
@@ -51,6 +51,57 @@ do_execsql_test 2.1 {
SELECT count(*) FROM v1 GROUP BY y;
} {3 3}
# 2023-03-01 dbsqlfuzz ef8623915d843b150c159166ee4548c78cc6895a
# count-of-view should not apply to CTEs.
#
ifcapable progress {
proc progress_stop args {return 1}
db progress 1000 progress_stop
do_catchsql_test 3.1 {
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c)
SELECT count(*) FROM c;
} {1 interrupted}
}
# 2023-03-07 dbsqlfuzz 23d782160b71c3f8f535ccb2da313dfc8eb8c631
#
do_execsql_test 4.1 {
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
INSERT INTO t1 VALUES(4,'four');
CREATE TABLE t2(c INTEGER PRIMARY KEY, d TEXT);
CREATE VIEW t3 AS SELECT a, b FROM t1 UNION ALL SELECT c, d FROM t2;
SELECT count(*) FROM t3 ORDER BY sum(a);
} 1
# 2023-03-31 dbsqlfuzz 6a107e3055bd22afab31cfddabc2d9d54fcbaf69
# Having clauses should disqualify count-of-view
#
reset_db
do_execsql_test 5.1 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
INSERT INTO t1 VALUES(1,'one'),(4,'four');
CREATE TABLE t2(c INTEGER PRIMARY KEY, d TEXT);
INSERT INTO t2 VALUES(2,'two'),(5,'five');
CREATE VIEW t3 AS SELECT a, b FROM t1 UNION ALL SELECT c, d FROM t2;
SELECT count(*) FROM t3 HAVING count(*)>0;
} 4
do_execsql_test 5.2 {
SELECT count(*) FROM t3 HAVING count(*)>5;
} {}
do_execsql_test 5.3 {
SELECT count(*) FROM t3 HAVING max(b)>'mmm';
} 4
do_execsql_test 5.4 {
SELECT count(*) FROM t3 HAVING min(b)>'mmm';
} {}
do_execsql_test 5.5 {
SELECT count(*) FROM (
SELECT a, max(b) FROM t1 HAVING a<100 UNION ALL SELECT c, d FROM t2
)
} 3
finish_test
+9
View File
@@ -159,4 +159,13 @@ do_test 4.6desc {
}
} {AND(AND(EQ(c0,22),GE(c1,10)),LE(c1,20))}
# 2023-03-24 https://sqlite.org/forum/forumpost/591006b1cc
#
reset_db
do_execsql_test 5.0 {
CREATE TABLE t1(x TEXT PRIMARY KEY) WITHOUT ROWID;
CREATE VIEW t2 AS SELECT 0 FROM t1 WHERE x>='a' OR x='1';
SELECT * FROM t2 RIGHT JOIN t1 ON true;
}
finish_test
+24
View File
@@ -416,4 +416,28 @@ do_execsql_test delete-11.1 {
} {6 2 12 4 18 6 19 23 20 40}
# 2023-03-15
# https://sqlite.org/forum/forumpost/e61252062c9d286d
#
# When the WHERE clause of a DELETE statement contains a subquery
# which uses the table that is being deleted from and there is a
# short-circuit operator of some kind in the WHERE clause such that
# the subquery might not run right away, then the subquery might
# run after one or more rows have been deleted, which can change
# the result of the subquery, and result in the wrong answer.
#
# Similar problem for UPDATE tested by update-21.4
# https://sqlite.org/forum/forumpost/0007d1fdb1
#
reset_db
do_execsql_test delete-12.0 {
CREATE TABLE t0(vkey INTEGER, pkey INTEGER,c1 INTEGER);
INSERT INTO t0 VALUES(2,1,-20),(2,2,NULL),(2,3,0),(8,4,95);
DELETE FROM t0 WHERE NOT (
(t0.vkey <= t0.c1) AND
(t0.vkey <> (SELECT vkey FROM t0 ORDER BY vkey LIMIT 1 OFFSET 2))
);
SELECT * FROM t0;
} {8 4 95}
finish_test
+56
View File
@@ -348,5 +348,61 @@ foreach {tn idx} {
}
}
# 2023-03-16
# https://sqlite.org/forum/forumpost/16ce2bb7a639e29b
# ticket c36cdb4afd504dc1
# ticket 4051a7f931d9ba24
# ticket d6fd512f50513ab7
#
do_execsql_test 10.1 {
SELECT DISTINCT
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
ORDER BY
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x';
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1}
do_execsql_test 10.2 {
EXPLAIN
SELECT DISTINCT
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
ORDER BY
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x','x','x','x','x','x','x',
'x','x','x','x';
} {/0 Init 0 /}
do_execsql_test 10.3 {
EXPLAIN CREATE TABLE t2 AS SELECT DISTINCT ':memory:', 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 ORDER BY '%J%j%w%s', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', '%J%j%w%s', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 42e-300, 'unixepoch', 'unixepoch', 'unixepoch' LIMIT 0xda;
} {/0 Init 0/}
do_execsql_test 10.4 {
DROP TABLE IF EXISTS t0;
CREATE TABLE t0 AS SELECT DISTINCT 0xda, 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 0xda-0xda-42e-300, 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0', 'lit0' ORDER BY '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%Y-%m-%d', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', 'lit0', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', 'auto', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', ':memory:', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '%%', '';
SELECT count(*) FROM t0;
} {1}
do_execsql_test 10.5 {
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 AS SELECT DISTINCT ':memory:', 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0.0*7/0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 ORDER BY '%J%j%w%s', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', '%J%j%w%s', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 'unixepoch', 42e-300, 'unixepoch', 'unixepoch', 'unixepoch' LIMIT 0xda;
SELECT count(*) FROM t2;
} {1}
finish_test
+12
View File
@@ -301,4 +301,16 @@ do_execsql_test 3030 {
{} 1 a
}
#-------------------------------------------------------------------------
#
reset_db
do_execsql_test 4010 {
CREATE TABLE t1(a, b COLLATE RTRIM);
INSERT INTO t1 VALUES(1, ''), (2, ' '), (3, ' ');
}
do_execsql_test 4020 {
SELECT b FROM t1 UNION SELECT 1;
} {1 { }}
finish_test
+11
View File
@@ -272,4 +272,15 @@ do_catchsql_test 8.3 {
REINDEX;
} {1 {database disk image is malformed}}
# 2023-04-13 https://bugs.chromium.org/p/chromium/issues/detail?id=1405220
# Avoid double-de-quoting of table names when processing foreign keys.
#
reset_db
do_execsql_test 9.1 {
PRAGMA foreign_keys = ON;
CREATE TABLE """1"("""2", """3" PRIMARY KEY);
CREATE TABLE """4"("""5" REFERENCES """1" ON DELETE RESTRICT);
DELETE FROM """1";
}
finish_test
+54
View File
@@ -615,4 +615,58 @@ do_execsql_test gencol1-22.1 {
AND (y.a=2 OR (x.b LIKE '2*' AND y.a=x.b));
} {2 2 2 2}
# 2023-03-02 dbsqlfuzz 65f5eb57f8859344d5f1f33e08c77ee12960ed83
#
set typelist {ANY INT REAL BLOB TEXT {}}
set cnt 0
foreach t1 $typelist {
foreach t2 $typelist {
incr cnt
db eval "
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(
x $t1,
a $t2 AS (x) VIRTUAL,
b BLOB AS (x) VIRTUAL
);
CREATE INDEX x2 ON t1(a);
INSERT INTO t1(x) VALUES(NULL),('1'),(2),(3.5),('xyz');
"
set x1 [lsort [db eval {SELECT typeof(b) FROM t1}]]
do_test gencol1-23.1.$cnt {
lsort [db eval {SELECT typeof(b) FROM t1 INDEXED BY x2}]
} $x1
}
}
do_execsql_test gencol1-23.2 {
DROP TABLE t1;
CREATE TABLE t1(
x,
a INT AS (x) VIRTUAL,
b BLOB AS (x) VIRTUAL
);
CREATE INDEX x2 ON t1(a);
INSERT INTO t1(x) VALUES(NULL),('1'),('xyz'),(2),(3.5);
SELECT quote(a) FROM t1 INDEXED BY x2;
} {NULL 1 2 3.5 'xyz'}
do_execsql_test gencol1-23.3 {
EXPLAIN SELECT a FROM t1 INDEXED BY x2;
} {~/Column 0/}
# ^^^^^^^^---- verfies that x2 acts like a covering index
do_execsql_test gencol1-23.4 {
EXPLAIN SELECT b FROM t1 INDEXED BY x2;
} {/Column 0/}
# ^^^^^^^^^^--- Must reference the original table in this case because
# of the different datatype on column b.
# 2023-03-07 https://sqlite.org/forum/forumpost/b312e075b5
#
do_execsql_test gencol1-23.5 {
CREATE TABLE v0(c1 INT, c2 AS (RAISE(IGNORE)));
}
do_catchsql_test gencol1-23.6 {
SELECT * FROM v0;
} {1 {RAISE() may only be used within a trigger-program}}
finish_test
+30 -2
View File
@@ -829,7 +829,35 @@ do_execsql_test in-22.4 {
SELECT * FROM t1 WHERE x IN ((((((SELECT a FROM t2))))));
} {2 200 4 400 6 600}
# 2023-04-04 https://sqlite.org/forum/forumpost/dc16ec63d3
# Faulty assert() statement in the IN optimization.
#
do_execsql_test in-23.0 {
DROP TABLE IF EXISTS t4;
CREATE TABLE t4(a TEXT, b INT);
INSERT INTO t4(a,b) VALUES('abc',0),('ABC',1),('def',2);
CREATE INDEX t4x ON t4(a, +a COLLATE NOCASE);
SELECT a0.a, group_concat(a1.a) AS b
FROM t4 AS a0 JOIN t4 AS a1
GROUP BY a0.a
HAVING (SELECT sum( (a1.a == +a0.a COLLATE NOCASE) IN (SELECT b FROM t4)));
} {ABC abc,ABC,def abc abc,ABC,def def abc,ABC,def}
do_execsql_test in-23.0-b {
SELECT a0.a, group_concat(a1.a) AS b
FROM t4 AS a0 JOIN t4 AS a1
GROUP BY a0.a
HAVING (SELECT sum( (a1.a GLOB +a0.a COLLATE NOCASE) IN (SELECT b FROM t4)));
} {ABC abc,ABC,def abc abc,ABC,def def abc,ABC,def}
#
# Follow-up forum/forumpost/0713a16a44
#
do_execsql_test in-23.1 {
CREATE VIEW t5 AS
SELECT 1 AS b
WHERE (SELECT count(0=NOT+a COLLATE NOCASE IN (SELECT 0))
FROM t4
GROUP BY a);
SELECT * FROM t5;
} 1
finish_test
+24 -1
View File
@@ -591,6 +591,29 @@ do_execsql_test indexexpr1-2140 {
SELECT b FROM t1;
} 400
# 2023-04-18 Forum post https://sqlite.org/forum/forumpost/f34e32d120 from
# Alexis King.
#
# This problem originates at check-in b9190d3da70c4171 (2022-11-25).
# A similar problem arose on 2023-03-04 at
# https://sqlite.org/forum/forumpost/a68313d054 and was fixed at
# check-in e06973876993926f. See the test case tkt-99378-400.
#
reset_db
do_execsql_test indexexpr1-2200 {
CREATE TABLE t1(id INTEGER PRIMARY KEY, tag INT);
INSERT INTO t1 VALUES (0, 7), (1, 8);
CREATE TABLE t2(type INT, t1_id INT, value INT);
INSERT INTO t2 VALUES (0, 0, 100), (0, 1, 101);
CREATE INDEX t1x ON t1(-tag);
SELECT u.tag, v.max_value
FROM (SELECT tag FROM t1 GROUP BY -tag) u
JOIN (SELECT t1.tag AS "tag", t2.type AS "type",
MAX(t2.value) AS "max_value"
FROM t1
JOIN t2 ON t2.t1_id = t1.id
GROUP BY t2.type, t1.tag
) v ON v.type = 0 AND v.tag = u.tag;
} {7 100 8 101}
finish_test
+53
View File
@@ -372,4 +372,57 @@ foreach {tn expr} {
" {1 1}
}
# 2023-03-24 https://sqlite.org/forum/forumpost/79cf371080
#
reset_db
do_execsql_test 9.0 {
CREATE TABLE t1(a INT, b INT);
CREATE INDEX t1x ON t1(a, abs(b));
CREATE TABLE t2(c INT, d INT);
INSERT INTO t1(a,b) VALUES(4,4),(5,-5),(5,20),(6,6);
INSERT INTO t2(c,d) VALUES(100,1),(200,1),(300,2);
SELECT *,
(SELECT max(c+abs(b)) FROM t2 GROUP BY d ORDER BY d LIMIT 1) AS subq
FROM t1 WHERE a=5;
} {5 -5 205 5 20 220}
# 2023-04-03 https://sqlite.org/forum/forumpost/44270909bb
# and https://sqlite.org/forum/forumpost/e45108732c which are the
# same problem, namely the failure to omit the EP_Collate property
# from an expression node when changing it from TK_COLLATE into
# TK_AGG_COLUMN because it resolves to an indexed expression.
#
reset_db
do_execsql_test 10.0 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
CREATE INDEX t1x ON t1 (b, +b COLLATE NOCASE);
INSERT INTO t1(a,b) VALUES(1,'abcde');
SELECT * FROM t1 AS a0
WHERE (SELECT count(a0.b=+a0.b COLLATE NOCASE IN (b)) FROM t1 GROUP BY 2.5)
ORDER BY a0.b;
} {1 abcde}
do_execsql_test 10.1 {
CREATE TABLE t2(a TEXT);
INSERT INTO t2 VALUES('alice'),('bob'),('cindy'),('david');
CREATE INDEX t2x ON t2 (+a COLLATE NOCASE);
SELECT count(+a COLLATE NOCASE IN (SELECT 1)) AS x
FROM t2
GROUP BY SUBSTR(0,0);
} 4
# 2023-04-03 https://sqlite.org/forum/forumpost/409ebc7368
# When a generated column appears in both an outer and an inner loop
# (that is to say, the same table is used in both loops) and the
# generated column is indexed and it is used inside an aggregate function,
# make sure that the terms resolve to the correct aggregate.
#
do_execsql_test 11.0 {
CREATE TABLE t3 (a INT, b AS (-a));
CREATE INDEX t3x ON t3(b, a);
INSERT INTO t3(a) VALUES(44);
SELECT * FROM t3 AS a0
WHERE (SELECT sum(-a0.a=b) FROM t3 GROUP BY b)
GROUP BY b;
} {44 -44}
finish_test
+73
View File
@@ -354,5 +354,78 @@ do_execsql_test 9.11 {
SELECT ccc, ccc IS NULL AS ddd FROM t1 LEFT JOIN v2;
} {{} 1}
# 2023-03-01 https://sqlite.org/forum/forumpost/26387ea7ef
# When flattening a VIEW which is the RHS of a LEFT JOIN, always put
# an TK_IF_NULL_ROW operator on all accesses, even TK_COLUMN nodes, since
# the TK_COLUMN might reference an outer subquery.
#
reset_db
db null NULL
do_execsql_test 10.1 {
CREATE TABLE t1 (x INTEGER);
INSERT INTO t1 VALUES(1); -- Some true value
CREATE TABLE t2 (z TEXT);
INSERT INTO t2 VALUES('some value');
CREATE TABLE t3(w TEXT);
INSERT INTO t3 VALUES('some other value');
}
do_execsql_test 10.2 {
SELECT (
SELECT 1 FROM t2 LEFT JOIN (SELECT x AS v FROM t3) ON 500=v WHERE (v OR FALSE)
) FROM t1;
} NULL
do_execsql_test 10.3 {
SELECT (
SELECT 1 FROM t2 LEFT JOIN (SELECT x AS v FROM t3) ON 500=v WHERE (v)
) FROM t1;
} NULL
optimization_control db all 0
do_execsql_test 10.4 {
SELECT (
SELECT 1 FROM t2 LEFT JOIN (SELECT x AS v FROM t3) ON 500=v WHERE (v OR FALSE)
) FROM t1;
} NULL
# 2023-03-02 https://sqlite.org/forum/forumpost/402f05296d
#
# The TK_IF_NULL_ROW expression node must ensure that it does not overwrite
# the result register of an OP_Once subroutine.
#
optimization_control db all 1
do_execsql_test 11.1 {
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
CREATE TABLE t1(x TEXT, y INTEGER);
INSERT INTO t1(x,y) VALUES(NULL,-2),(NULL,1),('0',2);
CREATE TABLE t2(z INTEGER);
INSERT INTO t2(z) VALUES(2),(-2);
CREATE VIEW t3 AS SELECT z, (SELECT count(*) FROM t1) AS w FROM t2;
SELECT * FROM t1 LEFT JOIN t3 ON y=z;
} {NULL -2 -2 3 NULL 1 NULL NULL 0 2 2 3}
# 2023-03-11 https://sqlite.org/forum/forumpost/b405033490fa56d9
# The fix that test 11.1 above checks also caused a performance regression.
# This test case verifies that the performance regression has been resolved.
#
do_execsql_test 12.1 {
DROP TABLE t1;
DROP TABLE t2;
DROP VIEW t3;
CREATE TABLE t1(a INTEGER PRIMARY KEY);
WITH RECURSIVE c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<100)
INSERT INTO t1(a) SELECT n FROM c;
CREATE VIEW t2(b) AS SELECT a FROM t1;
}
do_vmstep_test 12.2 {
SELECT * FROM t1 LEFT JOIN t2 ON a=b LIMIT 10 OFFSET 98;
} 2000 {99 99 100 100}
do_eqp_test 12.3 {
SELECT * FROM t1 LEFT JOIN t2 ON a=b LIMIT 10 OFFSET 98;
} {
QUERY PLAN
|--SCAN t1
`--SEARCH t1 USING INTEGER PRIMARY KEY (rowid=?) LEFT-JOIN
}
finish_test
+30
View File
@@ -89,5 +89,35 @@ do_execsql_test 4.4 {
SELECT (d IS NULL) FROM t1 RIGHT JOIN t2 ON (j=33);
} {1}
#-------------------------------------------------------------------------
#
reset_db
do_execsql_test 5.0 {
CREATE TABLE t0(w);
CREATE TABLE t1(x);
CREATE TABLE t2(y);
CREATE TABLE t3(z);
INSERT INTO t3 VALUES('t3val');
}
do_execsql_test 5.1 {
SELECT * FROM t1 INNER JOIN t2 ON (0) RIGHT OUTER JOIN t3;
} {{} {} t3val}
do_execsql_test 5.2 {
SELECT * FROM t1 INNER JOIN t2 ON (0) FULL OUTER JOIN t3;
} {{} {} t3val}
do_execsql_test 5.3 {
SELECT * FROM t3 LEFT JOIN t2 ON (0);
} {t3val {}}
do_execsql_test 5.4 {
SELECT * FROM t0 RIGHT JOIN t1 INNER JOIN t2 ON (0) RIGHT JOIN t3
} {{} {} {} t3val}
do_execsql_test 5.5 {
SELECT * FROM t0 RIGHT JOIN t1 INNER JOIN t2 ON (0)
} {}
finish_test
-18
View File
@@ -28,24 +28,6 @@ do_execsql_test 1.0 {
INSERT INTO t2 SELECT * FROM t1;
}
proc do_vmstep_test {tn sql nstep {res {}}} {
uplevel [list do_execsql_test $tn.0 $sql $res]
set vmstep [db status vmstep]
if {[string range $nstep 0 0]=="+"} {
set body "if {$vmstep<$nstep} {
error \"got $vmstep, expected more than [string range $nstep 1 end]\"
}"
} else {
set body "if {$vmstep>$nstep} {
error \"got $vmstep, expected less than $nstep\"
}"
}
# set name "$tn.vmstep=$vmstep,expect=$nstep"
set name "$tn.1"
uplevel [list do_test $name $body {}]
}
do_vmstep_test 1.1.1 {
SELECT * FROM t1 LEFT JOIN t2 WHERE a=c AND d IS NULL;
+13
View File
@@ -2060,4 +2060,17 @@ ifcapable !has_codec {
} {0 {{database disk image is malformed}}}
}
database_never_corrupt
# 2023-03-27. Register allocation issue in integrity_check discovered
# by new assert() statements added in [6f8b97f31a4c8552].
# dbsqlfuzz dc9ab26037cf5ef797d28cd1ae0855ade584216d
# tag-20230327-1
#
reset_db
do_execsql_test 25.0 {
CREATE TABLE t1(a INT, b AS (a*2) NOT NULL);
CREATE TEMP TABLE t2(a PRIMARY KEY, b, c UNIQUE) WITHOUT ROWID;
CREATE UNIQUE INDEX t2x ON t2(c,b);
PRAGMA integrity_check;
} ok
finish_test
+35 -4
View File
@@ -212,13 +212,13 @@ do_execsql_test 10.2 {
END;
}
do_catchsql_test 10.3 {
do_catchsql_test 10.3a {
INSERT INTO t1(a, b) VALUES(1234, 5678) RETURNING rowid;
} {1 {no such column: rowid}}
} {1 {no such column: new.rowid}}
do_catchsql_test 10.3 {
do_catchsql_test 10.3b {
UPDATE t1 SET a='z' WHERE b='y' RETURNING rowid;
} {1 {no such column: rowid}}
} {1 {no such column: new.rowid}}
do_execsql_test 10.4 {
SELECT * FROM log;
@@ -408,4 +408,35 @@ do_execsql_test 17.0 {
UPDATE bug SET x=NULL WHERE id = 20 RETURNING quote(x), x IS NULL;
} {NULL 1}
# 2023-03-08 https://sqlite.org/forum/forumpost/f5a2b1db87
# NULL pointer dereference following an error.
#
do_execsql_test 18.0 {
CREATE TABLE v0(c1 INT);
CREATE VIEW view_2(c1) AS SELECT CASE WHEN c1 COLLATE TRUE THEN TRUE ELSE TRUE END FROM v0;
CREATE TRIGGER x1 INSTEAD OF INSERT ON view_2 BEGIN SELECT true; END;
}
do_catchsql_test 18.1 {
INSERT INTO view_2 DEFAULT VALUES RETURNING *;
} {1 {no such collation sequence: TRUE}}
# 2023-03-16
# https://sqlite.org/forum/forumpost/c99d6e0329
# ticket d15b3a4ea901ef0d
# ticket 89d259d45b855a0d
#
# A RETURNING clause on an IF NOT EXISTS trigger does not generate
# an error if the trigger already exists.
#
do_execsql_test 19.0 {
DROP TABLE IF EXISTS t1;CREATE TABLE t1(a);
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN VALUES(0); END;
} {}
do_catchsql_test 19.1 {
CREATE TRIGGER IF NOT EXISTS r1 AFTER DELETE ON t1 BEGIN
INSERT INTO t1(a) VALUES (1) RETURNING FALSE;
INSERT INTO t1(a) VALUES (2) RETURNING TRUE;
END;
} {0 {}}
finish_test
+28
View File
@@ -232,6 +232,34 @@ QUERY (nCycle=nnn)
--SEARCH v1 USING AUTOMATIC COVERING INDEX (x1=?) (nCycle=nnn)
}
#-------------------------------------------------------------------------
reset_db
ifcapable trace {
do_execsql_test 5.0 {
CREATE TABLE t1(x, y);
CREATE TRIGGER tr1 AFTER DELETE ON t1 BEGIN
SELECT 1;
END;
INSERT INTO t1 VALUES(1, 2);
}
proc trace {stmt sql} {
array set A [sqlite3_stmt_scanstatus -flags complex [format %x $stmt] 0]
lappend ::trace_explain $A(zExplain)
}
db trace_v2 trace
set ::trace_explain [list]
do_execsql_test 5.1 {
DELETE FROM t1 WHERE x=1;
}
do_test 5.2 {
set ::trace_explain
} {{SCAN t1} {SCAN t1} {SCAN t1}}
}
finish_test
+5
View File
@@ -24,6 +24,7 @@ do_execsql_test 1.0 {
ANALYZE;
}
do_execsql_test 1.1 {
SELECT a,b,c FROM t1
WHERE b IN (234, 345) AND c BETWEEN 6 AND 6.5 AND a='abc'
@@ -59,5 +60,9 @@ do_execsql_test 1.4 {
abc 345 7
}
do_execsql_test 1.5 {
SELECT a,b,c FROM t1 WHERE b IN (235, 345) AND c<=3 AND a='abc' ORDER BY a, b;
}
finish_test
+10
View File
@@ -419,4 +419,14 @@ do_execsql_test skipscan1-4.10 {
AND a <= 10;
} {3}
# 2023-03-24 https://sqlite.org/forum/forumpost/8cc1dc0fe9
#
reset_db
do_execsql_test skipscan1-5.0 {
CREATE TABLE t1(a TEXT, UNIQUE(a,a,a));
INSERT INTO t1 VALUES (hex(zeroblob(241))),(1),(2),(3);
ANALYZE;
SELECT max(a) FROM t1 WHERE a IN t1;
} {3}
finish_test
+19 -1
View File
@@ -53,7 +53,25 @@ do_execsql_test subtype1-231 {
WITH t4(a) AS NOT MATERIALIZED (SELECT json(1)) SELECT subtype(a) FROM t4;
} {0}
# 2023-03-01
# https://sqlite.org/forum/forumpost/37dd14a538
#
# Additional tests to show that subtypes do not traverse subquery boundaries.
#
do_execsql_test subtype1-300 {
CREATE TABLE t0(c0);
INSERT INTO t0 VALUES ('1');
CREATE VIEW v0(c0) AS SELECT CASE WHEN 1 THEN json_patch('1', '1') END
FROM t0 GROUP BY t0.c0;
SELECT * FROM v0 WHERE json_quote(v0.c0) != '1';
} {1}
do_execsql_test subtype1-310 {
SELECT *, json_quote(y) FROM (SELECT +json('1') AS y);
} {1 {"1"}}
do_execsql_test subtype1-320 {
SELECT *, json_quote(y) FROM (SELECT +json('1') AS y)
WHERE json_quote(y)='"1"';
} {1 {"1"}}
finish_test
+23
View File
@@ -949,6 +949,29 @@ proc normalize_list {L} {
set L2
}
# Run SQL and verify that the number of "vmsteps" required is greater
# than or less than some constant.
#
proc do_vmstep_test {tn sql nstep {res {}}} {
uplevel [list do_execsql_test $tn.0 $sql $res]
set vmstep [db status vmstep]
if {[string range $nstep 0 0]=="+"} {
set body "if {$vmstep<$nstep} {
error \"got $vmstep, expected more than [string range $nstep 1 end]\"
}"
} else {
set body "if {$vmstep>$nstep} {
error \"got $vmstep, expected less than $nstep\"
}"
}
# set name "$tn.vmstep=$vmstep,expect=$nstep"
set name "$tn.1"
uplevel [list do_test $name $body {}]
}
# Either:
#
# do_execsql_test TESTNAME SQL ?RES?
+17
View File
@@ -176,4 +176,21 @@ do_execsql_test tkt-99378-310 {
);
} {1 2}
# 2023-03-04 https://sqlite.org/forum/forumpost/a68313d054
#
# See also indexexpr1-2200 added on 2023-03-18.
#
do_execsql_test tkt-99378-400 {
DROP TABLE t1;
CREATE TABLE t0(w);
INSERT INTO t0(w) VALUES(1);
CREATE TABLE t1(x);
INSERT INTO t1(x) VALUES(1);
CREATE INDEX t1x ON t1(x > 0);
CREATE VIEW t2(y) AS SELECT avg(w) FROM t0 GROUP BY w>1;
CREATE VIEW t3(z) AS SELECT count(*) FROM t2 WHERE y BETWEEN 0 and 0;
SELECT count(*) FROM t1 NOT INDEXED WHERE (SELECT z FROM t3);
SELECT count(*) FROM t1 INDEXED BY t1x WHERE (SELECT z FROM t3);
} {0 0}
finish_test
+33
View File
@@ -732,4 +732,37 @@ do_execsql_test update-20.30 {
PRAGMA integrity_check;
} {ok}
# 2023-03-16 https://sqlite.org/forum/forumpost/0007d1fdb1
# A subquery in the WHERE clause of an UPDATE and behind a
# short-circuit evaluation caused problems because multi-row
# single-pass was selected.
#
# Similar problem for DELETE tested by delete-12.0.
# https://sqlite.org/src/info/73f0036f045bf371
#
reset_db
do_execsql_test update-21.1 {
CREATE TABLE t1 (vkey INTEGER, c5 INTEGER);
INSERT INTO t1 VALUES(3,NULL),(6,-54);
}
db null NULL
do_execsql_test update-21.2 {
BEGIN;
UPDATE t1 SET vkey = 100 WHERE c5 is null;
SELECT * FROM t1 ORDER BY vkey, c5;
ROLLBACK;
} {6 -54 100 NULL}
do_execsql_test update-21.3 {
BEGIN;
UPDATE t1 SET vkey = 100 WHERE NOT (-10*(select min(vkey) from t1) >= c5);
SELECT * FROM t1 ORDER BY vkey, c5;
ROLLBACK;
} {3 NULL 6 -54}
do_execsql_test update-21.4 {
BEGIN;
UPDATE t1 SET vkey = 100 WHERE c5 is null OR NOT (-10*(select min(vkey) from t1) >= c5);
SELECT * FROM t1 ORDER BY vkey, c5;
ROLLBACK;
} {6 -54 100 NULL}
finish_test
+151
View File
@@ -2210,4 +2210,155 @@ do_execsql_test 72.1 {
SELECT * FROM v1 WHERE true;
} {1 0}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 72.0 {
CREATE TABLE t0(c0);
INSERT INTO t0(c0) VALUES (0);
CREATE VIEW v0(c0) AS SELECT TOTAL(0) OVER (PARTITION BY t0.c0) FROM t0;
}
do_execsql_test 72.1 {
SELECT COUNT(*) FROM (
SELECT TOTAL(0) OVER (PARTITION BY t0.c0) FROM t0
)
WHERE ('1' IS NOT ('abcde' NOTNULL));
} {1}
# 2023-03-28 https://sqlite.org/forum/forumpost/dc3b92cfa0 (Song Liu)
#
reset_db
do_execsql_test 73.0 {
CREATE TABLE t1(a INT);
INSERT INTO t1(a) VALUES(1),(2),(4);
CREATE VIEW t2(b,c) AS SELECT * FROM t1 JOIN t1 A ORDER BY sum(0) OVER(PARTITION BY 0);
CREATE TRIGGER x1 INSTEAD OF UPDATE ON t2 BEGIN SELECT true; END;
}
do_execsql_test 73.1 {
SELECT * FROM t2;
} {1 1 1 2 1 4 2 1 2 2 2 4 4 1 4 2 4 4}
do_execsql_test 73.2 {
UPDATE t2 SET c=99 WHERE b=4 RETURNING *;
} {4 99 4 99 4 99}
do_execsql_test 73.3 {
SELECT *, nth_value(15,2) OVER() FROM t2, t1 WHERE b=4;
} {
4 1 1 15
4 2 1 15
4 4 1 15
4 1 2 15
4 2 2 15
4 4 2 15
4 1 4 15
4 2 4 15
4 4 4 15
}
do_execsql_test 73.4 {
UPDATE t2 SET c=nth_value(15,2) OVER() FROM (SELECT * FROM t1) WHERE b=4 RETURNING *;
} {
4 15
4 15
4 15
4 15
4 15
4 15
4 15
4 15
4 15
}
do_execsql_test 73.5 {
DROP TRIGGER x1;
}
do_catchsql_test 73.6 {
UPDATE t2 SET c=99 WHERE b=4 RETURNING *;
} {1 {cannot modify t2 because it is a view}}
do_catchsql_test 73.7 {
UPDATE t2 SET c=nth_value(15,2) OVER() FROM (SELECT * FROM t1) WHERE b=4 RETURNING *;
} {1 {cannot modify t2 because it is a view}}
# 2023-03-28 https://sqlite.org/forum/forumpost/bad532820c
#
reset_db
do_execsql_test 74.0 {
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (c INT, d INT);
CREATE INDEX idx ON t1(abs(a));
INSERT INTO t1 VALUES(1,2),(3,4);
INSERT INTO t2 VALUES(5,6),(7,8);
}
do_execsql_test 74.1 {
SELECT (
SELECT count( a ) FROM t2 LIMIT 1
)
FROM t1;
} {2} ;# Verified using PG 14.2
do_execsql_test 74.2 {
SELECT (
SELECT count( a+c ) FROM t2 LIMIT 1
)
FROM t1;
} {2 2} ;# verified on PG 14.2. Crashes PG 9.6!
do_execsql_test 74.3 {
SELECT (
SELECT count( ( SELECT(sum(0) OVER(ORDER BY c, abs(a))) ) )
FROM t2 GROUP BY c LIMIT 1
)
FROM t1;
} {1 1} ;# verified on PG 14.2
do_execsql_test 74.4 {
/* Original test case reported in https://sqlite.org/forum/forumpost/bad532820c
CREATE TABLE v0 (c1);
CREATE INDEX i ON v0 (c1, c1=1);
SELECT 0 FROM v0 AS a1
WHERE (SELECT count((SELECT(sum(0) OVER(PARTITION BY(c1), (a1.c1=1) ))))
FROM v0
GROUP BY hex(0))
AND a1.c1=0;
} {}
# 2023-04-11 https://sqlite.org/forum/forumpost/6c5678e3da
# An ALWAYS() turns out to be sometimes false.
#
do_execsql_test 75.0 {
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT);
CREATE INDEX t1x ON t1(a+b);
}
do_catchsql_test 75.1 {
SELECT count((SELECT count(a0.a+a0.b) ORDER BY sum(0) OVER (PARTITION BY 0)))
FROM t1 AS a0 JOIN t1 AS a1
GROUP BY a1.a;
} {1 {misuse of aggregate: count()}}
# 2023-04-11 https://sqlite.org/forum/forumpost/6c5678e3da
# An ALWAYS() turns out to be sometimes false.
#
do_execsql_test 75.0 {
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT);
CREATE INDEX t1x ON t1(a+b);
}
do_catchsql_test 75.1 {
SELECT count((SELECT count(a0.a+a0.b) ORDER BY sum(0) OVER (PARTITION BY 0)))
FROM t1 AS a0 JOIN t1 AS a1
GROUP BY a1.a;
} {1 {misuse of aggregate: count()}}
# 2023-04-13 https://sqlite.org/forum/forumpost/0d48347967
reset_db
do_execsql_test 76.0 {
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES (111,222),(111,223),(118,229);
CREATE INDEX t1a ON t1(a);
CREATE TABLE t2(x INT);
INSERT INTO t2 VALUES (333),(444),(555);
}
do_execsql_test 76.1 {
SELECT c, (SELECT c + sum(1) OVER ()) AS "res"
FROM t2 LEFT JOIN (SELECT +a AS c FROM t1) AS v1 ON true
GROUP BY c
ORDER by c;
} {111 112 118 119}
# ^^^^^^^^^^^^^^^^^-- results verified against PG 14.2
finish_test