ec8e689a20
Avoid an undefined integer overflow in fts3 by detecting data structure corruption earlier.
...
FossilOrigin-Name: 86e98ddc19470410ccc6d2cf4ad56ef0bc5a23b7fbe6331b8cae374689f54529
2020-03-20 20:18:49 +00:00
589c787620
Chagnes the ESCAPE clause on the LIKE operator to overwrite wildcard
...
characters, in order ot match the behavior of PosgreSQL.
FossilOrigin-Name: 11e0844f71e8f2d27ce9363fb505e02fd7795c61dae0b3886cf0d8df4484dd97
2020-03-19 18:13:28 +00:00
f0a2172d1d
Fix an integer overflow problem with the dbstat virtual table that comes up
...
when trying to analyze a corrupt database.
FossilOrigin-Name: 1d64f4a8af81fe1235fffa54884d8f842a48ff6a33d6172f0cd65bf42fe8b2a1
2020-03-19 17:27:52 +00:00
553948e514
Fix handling of window functions in aggregate queries that have no GROUP BY clause. Also remove a faulty assert causing the error reported in [618156e3].
...
FossilOrigin-Name: 38e3dd389d142e520c71139ec84aa3c7722992af28a5f93a7f16e0ea176b74bb
2020-03-16 18:52:53 +00:00
14c98a4f40
At the end of the right-hand table loop of a LEFT JOIN that uses an IN
...
operator in the ON clause, put the OP_IfNoHope operator after the
OP_IfNotOpen operator, not before, to avoid a (harmless) uninitialized
register reference. Ticket [82b588d342d515d1]
FossilOrigin-Name: 8b437b47266ec2d80d85eafcfdd6949556d6c28d9d67d5f43d89799f0f5b7bd0
2020-03-16 03:07:53 +00:00
9b258c54e4
Rename sqlite3ExprCodeAtInit() to sqlite3ExprCodeRunJustOnce().
...
Other changes to make the new code cleaner. Test cases added.
FossilOrigin-Name: d7f18489978fdbbe3ab317485518cac91a75416ccef55898301afdd76d3b415b
2020-03-11 19:41:49 +00:00
38dfbdae8a
Do not factor out constant functions into the initialization section at the
...
end of the prepared statement, be cause if they throw an exception, it will
abort the statement even if the function is never called. Better to put
constant functions in an OP_Once block.
FossilOrigin-Name: 97a18a5cd701848a9660385e31bffe2c397e3cfe57ccdb876f44d08c00d1d39a
2020-03-11 17:58:27 +00:00
0c76e892d9
Apply the correct affinity transformations when pulling values off of the
...
sorter index used for GROUP BY. Ticket [e0c2ad1aa8a9c691]
FossilOrigin-Name: 101f7dea75a203f1f3aa422a607ef701eb0901ba4d5e8d1075cd350454a61956
2020-03-10 11:50:43 +00:00
088489e8d9
The sqlite3ExprCodeFactorable() routine should make a copy of non-factorable
...
expressions, as they might be coming from a DEFAULT or generated column
in a table constraint.
FossilOrigin-Name: a2d6f108c5d07559b125823a04c9cb072c80be80d7913097891a6192c7e1e225
2020-03-10 02:57:37 +00:00
ccb3781673
Enhancements to the ".import" command of the CLI.
...
FossilOrigin-Name: cab1834cfc71f71bfed3c5170a0ba40a39385c3b2c50b7c6b6f09cc830dd1b1e
2020-03-09 15:39:39 +00:00
0ea2d42ac3
Report an error if the main, or any other, database encoding is modified by an external process (perhaps using the backup API) after the db has been opened.
...
FossilOrigin-Name: 895bd20b29e223496e1585483c6ce3335ae9050f2e5de4d6b69d0e40df396862
2020-03-05 18:04:09 +00:00
b3f0d92b91
Improved detection of corruption in the interior nodes of a segment btree
...
in FTS3/4.
FossilOrigin-Name: cc99447ac923166104e8a7c75088ed95279f4491b30cfa37dc3ee5e005dd9fac
2020-03-03 01:16:04 +00:00
39b3bcf8ef
Enhance the fuzzcheck test program so that it is able to simulate OOM errors
...
in the same way that dbsqlfuzz does.
FossilOrigin-Name: a65c8d4e26b2428ecb8232a4a6a44443aa1701319223397e61a823a5aa1827de
2020-03-02 16:31:21 +00:00
7f05d52c4c
Ensure that the NULL-scan pass counter is initialized when a ORDER BY NULLS LAST
...
is used on the right table of a LEFT JOIN. Ticket [e12a0ae526bb51c7].
FossilOrigin-Name: 704bb9a39acbee420c1d6ac9eb1466a02dd77d3334b938bfddf235973129b5fe
2020-03-02 01:16:33 +00:00
0a21ea997d
Fix a problem with window functions occuring within sub-selects that are part of an OR term in a WHERE clause of the outer SELECT.
...
FossilOrigin-Name: 1e174ed0d29366eb56ad1a0cc8defcb440b426bfd9525aed2f93468248606efc
2020-02-29 17:19:42 +00:00
67e2bb92df
Optimization for "SELECT min(x) FROM tbl" where "x" is indexed and NOT NULL. This also allows similar queries on NOT NULL virtual table columns to be optimized.
...
FossilOrigin-Name: 59726777934e201d94e99ca693f0fda4ebfb1c7883d0258ce542f63f9924c28c
2020-02-27 15:07:16 +00:00
a8781d9d93
Update the fuzzcheck test module so that it avoids inserting text values
...
that contain embedded NULs in the XSQL table. Fix some legacy entries in
the test/fuzzdata8.db that had embedded NULs. Add in new dbsqlfuzz cases
that have accumulated over on the dbsqlfuzz project for a while.
FossilOrigin-Name: 47d4240c4a837e829f593bb2aad7563010838f55345e7a0d8e2ea79462aeeb3c
2020-02-25 20:05:58 +00:00
35d3cb80c4
Disable the new analyzeG.test module if not building with STAT4.
...
FossilOrigin-Name: 4a9d3005769e0398183b03a3e132e3946b9d1c48073af2e0559d7beeac3245c0
2020-02-24 13:35:34 +00:00
2ed1b0e753
Merge bugfix from trunk.
...
FossilOrigin-Name: b542dee9de843c19664c19df7435c6034d23d0d213804d588ec0ff599082d576
2020-02-24 13:26:29 +00:00
0990c415f6
Fix a problem with ALTER TABLE for views that have a nested FROM clause.
...
Ticket [f50af3e8a565776b].
FossilOrigin-Name: c431b3fd8fd0f6a6974bba3e9366b0430ec003d570e7ce70ceefbcff5fe4b6fa
2020-02-23 17:34:45 +00:00
5c19346451
Add new test file analyzeG.test, containing a test for the change on this branch.
...
FossilOrigin-Name: 243ab1852a2291595527ea1f26e78ad83eda285ae28f876bc1c703677f495cfa
2020-02-22 17:32:00 +00:00
e8c4f03266
In the OP_Column opcode, if the cursor is marked NullRow (due to being the
...
right table of a LEFT JOIN that does not match) and the cursor is the table
cursor for an OR-optimization with a covering index, then do not substitute
the covering index cursor, since the covering index cursor does not have
the NullRow flag set. Ticket [aa4378693018aa99]
FossilOrigin-Name: f02030b3403d67734bba471a91ad5bfdb03ddf6fdc3ef14808a04495e43b0470
2020-02-22 13:01:19 +00:00
8a64d62d31
Add test case for previous commit.
...
FossilOrigin-Name: 14d14eb537075c6ac77513b1e7305bed8bc01a9034dfb763fd96f76400f2b705
2020-02-20 14:11:08 +00:00
4b9e736898
Remove a NEVER() macro and add a test case to cause its argument to be true.
...
FossilOrigin-Name: ee034fe916448e953ee7824e5c0db99a36a0ad138ebfb25f751bf84cb80a8fa7
2020-02-18 23:58:58 +00:00
0184a256e3
Convert invalid surrogates to 0xfffd when translating UTF.
...
FossilOrigin-Name: 7fab1393c2b22b1f3b159b631e06e7e0d3900850ee249c38e4d3cdd0aacf637e
2020-02-17 23:08:16 +00:00
fdfd45aef3
Fix problems in the constant propagation optimization that were introduced
...
by check-in [1c3e5c20a9e6f501]. Fix for ticket [1dcb4d44964846ad]
FossilOrigin-Name: c9a8defcef35a1fee6bcbb88252a2d0076dabe8381b0128b2257b5b5cc494e0f
2020-02-13 22:12:35 +00:00
77c9b3ccb3
Fix an incorrect assert() statement that was added yesterday.
...
Tickets [41c1456a6e61c0e7] and [fb8c538a8f57ae2a].
FossilOrigin-Name: abfb043ebb0c55fdc2be58255bc852b13865d81fa4c2e0dbe8c375810557aafe
2020-02-13 11:46:47 +00:00
41aa442cf4
When determining whether an == or IS constraint in a WHERE clause makes an ORDER BY term redundant, consider the collation sequence used by the == or IS comparison, not the collation sequence of the comparison expression itself. Possible fix for [fb8c538a8f].
...
FossilOrigin-Name: 16aed5d0c63dcdc2054dbb8a4b6b992476640433bf81e19301e6db5a3fc82633
2020-02-12 11:57:35 +00:00
fcbc673752
Fix some fts3 problems found by usan.
...
FossilOrigin-Name: fb7ccf61bed8d862986eda7096bec3df5947f1d1c88f27e7d9c8acf420f40c50
2020-02-06 10:55:10 +00:00
9dce0ef4ca
On an INSERT or UPDATE, perform affinity conversions on new data prior to
...
running CHECK constraints. Ticket [86ba67afafded936].
FossilOrigin-Name: 1d4f86201dab9a22df9ef8175a7ebf3640e97cdb23a06fb454b4c69bfda3a9af
2020-02-01 21:03:27 +00:00
d03f77ae46
Fix a problem with the processing of IN(...) constraints handled by virtual table implementations that do not set the "omit" flag when the virtual table column contains at least one NULL value.
...
FossilOrigin-Name: dcb4838757ca49cf149a6e883b3eb0ac8a075147387a078280dfabe39b1a3e8d
2020-01-29 15:03:01 +00:00
759e9cc064
Add a test case for commit [ffd8bb93].
...
FossilOrigin-Name: bcd5b37b8ebd67537f60c0061fcbc70b2aebebb88d6fb842ccf321a3e20c122c
2020-01-29 13:56:35 +00:00
ffd3fd0c30
Add new memory barriers during initialization.
...
FossilOrigin-Name: a9b2adc5d61790abd86839d12e7ecb98a85d7e4cde5f94558530e32449d9e483
2020-01-29 13:10:50 +00:00
9ca9a53a42
Modify a couple of FTS test cases so that they work on big-endian platforms.
...
FossilOrigin-Name: b20503aaf5b6595afafee6aa2bc6276354a62b0f583f6d94e31fedfdfc130347
2020-01-29 12:37:59 +00:00
fbfd113365
Reinstate the optimization of converting "a IN (C)" into "a=C" but only
...
if C is a constant. If the RHS is a table column, the complications of
managing affinity and collations become too involved to mess with.
FossilOrigin-Name: 8ac26a23d7f0ef29c5eb007c7467181f8b96102c8600ea8a5b15cc7584af27bd
2020-01-28 18:09:53 +00:00
d0add948ea
Update test file exclusive.test so that it works with the "journaltest" permutation.
...
FossilOrigin-Name: 4daf94d83319231e42243625c804d5db2d14f10fa5ea1a1f358c3603c47b955b
2020-01-21 16:31:26 +00:00
8c812f98a3
Fix a problem with using views in SQLITE_OMIT_VIRTUAL_TABLE builds. Also some test case fixes required for the same builds.
...
FossilOrigin-Name: 934ee8bdb481a5cbd3d9c5f53028073129d3bca4fee14fe4a49bbf9c0c9d74f7
2020-01-21 16:23:17 +00:00
7d2a1be84b
Fix a case in fts3auto.test that fails for SQLITE_DISABLE_FTS4_DEFERRED builds.
...
FossilOrigin-Name: d241055ead935f0e461a67f483788bcd59f7e8d65ade54b9c7c7c4fec9414102
2020-01-21 15:01:14 +00:00
70a32703ac
Fix an assert() that could fail in SQLITE_MUTATION_TEST builds following an error in a query that uses CTEs.
...
FossilOrigin-Name: c7e29458a73bbe73a1429477d0c01d5a7b870ab75d3cb08a703be21714e439b7
2020-01-21 14:42:48 +00:00
be03cc9fcf
In the fuzzcheck test program, reduce the default expression depth limit
...
from 1000 to 500 to avoid stack-overflow problems when running stress tests
using clang ASAN.
FossilOrigin-Name: 63d886f4ce3c770498b8bdad45b04143a3f63197d81793bde107450aba4a9c87
2020-01-20 14:42:09 +00:00
a01fda7113
Disable a redundant test case that uses a very large stack, and hence
...
is unable to run with -fsanitize=undefined,address.
FossilOrigin-Name: 3c63f68e12af36e9fd9a3dd4daec9402e75e80bcd819d39c0215a427fd0d7803
2020-01-18 19:07:00 +00:00
1ee02a1ce5
Fix the VDBE so that it correctly handles the sequence of operations
...
OP_OpenEphemeral, OP_OpenDup, OP_OpenEphemeral, and OP_OpenDup in that
order on the same cursor.
FossilOrigin-Name: a1be6ee0188911448c064e2c25fb0ca1daad50f3d50fb49a34430bd09736b4a9
2020-01-18 13:53:46 +00:00
a369d98b9a
Update test script instrfault.test to account for the fact that bound blob values cast to text values are now intepreted using the text encoding of the database, instead of always as utf-8.
...
FossilOrigin-Name: 4d6cb28811c01599e34c0394fe5ed17d47f14893c860590c9b4660bef68eb294
2020-01-17 15:45:59 +00:00
d1eb23cd26
Fix a case in "fuzz.test" that could fail, as non-deterministic functions may no longer appear in CHECK constraints.
...
FossilOrigin-Name: a370871e21bd1028ac968ca4f48e6b5f75e647ac40d4342aeb0504a848452908
2020-01-17 11:18:54 +00:00
b5f0e40578
Do not allow the "PRAGMA encoding" statement to change the database
...
encoding if TEMP content exists, or content in any other attached
database. Formerly, encoding changes were allowed if just the main
database file was empty. Ticket [a08879a4a476eea9].
FossilOrigin-Name: 03b003c988d27f3aa1b1e44972ee5a3c7e44ad667ec7f2b8a31d0411c66583d3
2020-01-15 16:20:16 +00:00
05e8c5407f
Remove an ALWAYS on a branch for improved database corruption detection
...
in btree.c:freeSpace(). Test case found by dbsqlfuzz.
FossilOrigin-Name: 54bf04811951db6c894f272f870e3e41f8f5e05a25c1115efbbdbd0d8bba54be
2020-01-14 16:39:54 +00:00
b2fe5a7c35
Fix to the register validity tracking logic in debug builds. No impact
...
on release builds.
FossilOrigin-Name: 0a500da6aa659a8e73206e6d22ddbf2da5e4f1d1d551eeb66433163a3e13109d
2020-01-10 01:05:49 +00:00
bebce86cde
Merge in the untrusted-schema enhancements.
...
See [/doc/87aea3ab1cdda453/doc/trusted-schema.md|doc/trusted-schema.md]
for details.
FossilOrigin-Name: 5720924cb07766cd54fb042da58f4b4acf12b60029fba86a23a606ad0d0f7c68
2020-01-09 20:44:37 +00:00
fbb6e9ff48
Fix an assert() in window.c that could fail with some obscure SELECT statements that use window functions.
...
FossilOrigin-Name: 83dc55679a91bf5d1d13706088ce58eed02b9aad1ad0ae237966e78e0d769663
2020-01-09 20:11:29 +00:00
05b32ee3c0
Fix a problem that restricted edgy functions in TEMP tables.
...
New test cases added.
FossilOrigin-Name: 8878c40753566a8c4ccd1d413019cabde7569b947f730527d13bfc3db384e97d
2020-01-09 01:20:03 +00:00