drh
40e9c8328e
Load new dbsqlfuzz test cases into test/fuzzdata8.db.
...
FossilOrigin-Name: 01aeeb5c4c70a0f19651448e94ad5c6810cab3d6957b5bc7a9b4b8e0b887f3de
2019-12-20 14:24:26 +00:00
dan
394aa710f2
Fix a potential problem with ALTER TABLE commands on schemas that contains a triggers or view featuring a sub-query that uses an ON clause with a join that is not a LEFT JOIN.
...
FossilOrigin-Name: 365dd8b663d5a28af33556b2b3820c6b5482114ef741a1d82b55c6e154f3043a
2019-12-20 14:18:29 +00:00
drh
1548d5276f
Do not continue an ALTER TABLE tree walk of a subquery if a prior error
...
is seen in the tree. Report the problem immediately, without continuing.
FossilOrigin-Name: 01ca865f31c0c817ede7f357401ef76cf311ae662397908464f53e1c147f5b6b
2019-12-20 12:55:21 +00:00
drh
0e5ce8029d
Fix an assert() in btree.c that can fail if an INSERT is attempted on
...
a corrupted database while in PRAGMA writable_schema=ON.
FossilOrigin-Name: 07beb3629e648e7feae4e786191514339ac1d8f6ba5bb6e7cc8a04bc1f1cd6ab
2019-12-20 12:33:17 +00:00
drh
34ab941e5b
Detect the invalid use of NULLS LAST on an INTEGER PRIMARY KEY definition
...
of a WITHOUT ROWID table.
FossilOrigin-Name: 4417c5bf0aabb34ed174f01afd981c924ae965a42128719d8d6735536631d12f
2019-12-19 17:42:27 +00:00
drh
54d501092d
Fix the zipfile extension so that INSERT works even if the pathname of
...
the file being inserted is a NULL. Bug discovered by the
Yongheng and Rui fuzzer.
FossilOrigin-Name: a80f84b511231204658304226de3e075a55afc2e3f39ac063716f7a57f585c06
2019-12-19 15:15:40 +00:00
drh
396afe6f6a
Continue to back away from the LEFT JOIN optimization of check-in [41c27bc0ff1d3135]
...
by disallowing query flattening if the outer query is DISTINCT. Without this fix,
if an index scan is run on the table within the view on the right-hand side of the
LEFT JOIN, stale result registers might be accessed yielding incorrect results,
and/or an OP_IfNullRow opcode might be invoked on the un-opened table, resulting
in a NULL-pointer dereference. This problem was found by the Yongheng and Rui fuzzer.
FossilOrigin-Name: 862974312edf00e9d1068115d1a39b7235b7db68b6d86b81d38a12f025a4748e
2019-12-18 20:51:58 +00:00
drh
6e1c45ef2e
Add the --vdbe-debug option to fuzzcheck.
...
FossilOrigin-Name: 289158aa24b066c453d2bce4bc2dead1c56fb0b23c3f7c4810b34b13627cef34
2019-12-18 13:42:04 +00:00
drh
a7648f02e0
Enhancements to fuzzcheck on unix so that it captures signals and prints
...
the current test file and test number prior to terminating.
FossilOrigin-Name: ae7cbb246bff3717c283869ccf27ce83611422f3801176819465a8d96f6481bf
2019-12-18 13:02:18 +00:00
drh
8c72afaf33
Add a test case for fix in check-in [1ca0bd982ab1183b]
...
FossilOrigin-Name: 519864da8bb671941a64bf333c2086ad9a068b5f85759e7abd368f0706d3aefd
2019-12-18 09:17:55 +00:00
drh
50efa58600
Remove an assert() in the code generator that can fail due to an invalid
...
INSERT statement. The same assert() appears again in the VDBE and will fire
there if the problem persists in an SQL statement that does not contain
errors. Gramfuzz find.
FossilOrigin-Name: 9bdd57cb9ad8ac1f4a0f1a3942d94ca5193109eeb1975343c4f0c7abf7135946
2019-12-18 01:31:21 +00:00
drh
4dad7ed532
When a table is part of a LEFT JOIN and should be a completely NULL row due to
...
the semantics of a LEFT JOIN, make sure any generated columns on that row
evaluate to NULL. Ticket [3b84b42943644d6f]
FossilOrigin-Name: 0271491438ad2a985aeff355173a8d0f1e5813954c82147bc68cb26cca5804c8
2019-12-16 16:52:22 +00:00
drh
d35bdd6c09
Ensure that all ON CONFLICT REPLACE indexes are sorted to the end of the list
...
of indexes for a table, even for weird cases where the same UNIQUE constraint
occurs twice with the ON CONFLICT REPLACE clause only on the second one. This
avoids an out-of-order contraint processing problem that can arise due
to the optimization of check-in [469a62ca33081854].
FossilOrigin-Name: 1e3918ca2f2c1cfcfa44249b1d7b847d52cbb8d302a8d4a335c090cfdf22d7a1
2019-12-15 02:49:32 +00:00
drh
7e3f135c62
When a generated column expression is initially parsed, if it contains errors
...
convert the expression to a simple NULL. This prevents additional pieces of
the expression tree that are allocated from lookaside from leaking into the
schema, where lookaside allocations are not allowed.
FossilOrigin-Name: a89b38605661e36d192df1d074383b704b34a959fcbc169837c0d4f6848f3208
2019-12-14 19:55:31 +00:00
drh
99670abb82
Do not set OP_Column flags on the instructions generated by
...
sqlite3ExprCodeGetColumn() if the opcode generated is not really an
OP_Column, which might happen if the column is virtual.
Fix for ticket [b439bfcfb7deedc6]
FossilOrigin-Name: 2401e04730a156aa48787b91af4e516406cb7635145e430be62fd16481816237
2019-12-14 17:43:37 +00:00
dan
5be1b20aec
Fix problems in fts3 with processing corrupt records and undefined integer overflows.
...
FossilOrigin-Name: 3b873029ef1903f76442445343af3786cd59ee66b0e5e0e6b76a0b6b1b5eb88a
2019-12-14 14:15:21 +00:00
drh
2bc5cf9ae9
Add a NEVER() to the ALTER TABLE fix in check-in [1d2e53a39b87e364]
...
FossilOrigin-Name: c7309ed3c7588c7e51e09418bf5cfd4611539b44c39cef9ed4ae0e385bae7625
2019-12-09 19:29:10 +00:00
drh
0824d5b9a5
The previous check-in was not quite correct, and introduced a new problem
...
with the USING clause. Use this version instead.
FossilOrigin-Name: ed28aaa4851202111a502f883ca06359d89b25bba4055c29d7bce2b501cfcc68
2019-12-09 18:22:17 +00:00
drh
926f796e8f
Ensure that the SrcList_item.colUsed field is set correctly (set to have a
...
1 for all columns of the table) when a generated column appears in the USING
clause of a join.
FossilOrigin-Name: 1923efb283e8840fa7436eb20b9d2174ef7cace1690d3b97b572a0db2048b8e3
2019-12-09 17:14:48 +00:00
drh
ebd70eedd5
Fix the NOT NULL verification logic in PRAGMA integrity_check so that it
...
works for generated columns whose value is the result of a comparison operator.
Ticket [bd8c280671ba44a7]
FossilOrigin-Name: f3b39c71b88cb6721f443de56cdce4c08252453a5e340b00a2bd88dc10c42400
2019-12-09 15:52:07 +00:00
drh
7a9698456d
Fix a gramfuzz find. If a partial index that does not reference any column
...
of its table is used by an UPDATE statement in one-pass mode, then avoid the
use of OP_DeferredSeek since the seek might not be resolved prior to the
OP_Delete and OP_Insert that implement the UPDATE.
FossilOrigin-Name: e3398c5ffb060b2b26334b8598e2c63953741e2d6f5124dbd6bdfc8e94742539
2019-12-09 14:34:37 +00:00
dan
38096961c7
Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself.
...
FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5
2019-12-09 08:13:43 +00:00
drh
29cdbadf8a
Correctly deal with multi-row VALUES clauses that contain window functions.
...
FossilOrigin-Name: 26d991f214db143976e2593d3564b5003eb3539a2728d1a0ccae2a2accece76f
2019-12-07 13:42:47 +00:00
drh
7fe2fc0dcb
Fix a problem with foreign keys and generated columns discovered by
...
Manuel Rigger.
FossilOrigin-Name: 27c0fdab1ba4d4993b164eb4b777c63e82aa247c3fa406121dc8ed94970a0b35
2019-12-07 00:22:18 +00:00
drh
c6b24ab1b1
Do not allow UPSERT of a view.
...
FossilOrigin-Name: ebf897e861c19e214c57f1e73841b505182202cc8d7d39e24d5a1e5625e26b4a
2019-12-06 01:23:38 +00:00
dan
e6dc1e5b70
Fix a problem in ALTER TABLE that could occur if an index, view or trigger in the schema features an expression of the form ((SELECT ...) IN ()) where the SELECT statement uses a CTE.
...
FossilOrigin-Name: 7e5ad8e0ab7ee91a5ccb19a9654d6a036233f74d2fdc45f7315feb3d9d035fd4
2019-12-05 14:31:43 +00:00
drh
d63b69b8a2
Ensure that an ALWAYS() in the rename logic really is always true, even
...
for faulty inputs.
FossilOrigin-Name: 54410f0e7710542d5159d0449898598d2b7f7676bfd993644ca47da1bf1fcdac
2019-12-04 15:08:58 +00:00
dan
8f4076223d
Fix an assert() failure that could occur in ALTER TABLE code when the schema contains a view that uses a CTE.
...
FossilOrigin-Name: 75b04a4b0d2e65bfcd02cf4e0b6d8f1954957c590814a9b8f9a9ee2adc2ec022
2019-12-04 14:26:38 +00:00
dan
8aa706e748
Fix a buffer overread that could occur in fts3 with corrupt %_stat records.
...
FossilOrigin-Name: e01fdbf9f700e1bd9dd5283c65547d10d26ce4f4506d3cfef9e1087aecdc2305
2019-12-04 03:46:50 +00:00
drh
f68bf5fbe6
Fix an incorrect NEVER() macro.
...
FossilOrigin-Name: 96b6a76da09a94182414ec1a56da91728c37329d2b55f889e433054ca21605ce
2019-12-04 03:31:29 +00:00
dan
fcc057db25
Fix a double-free that could occur when a component of a compound SELECT with an ORDER BY clause uses named window definitions.
...
FossilOrigin-Name: 92893b7980cbb0c6e26bc0b21390a717193205c9897fea5f26476462928897f9
2019-12-04 01:42:07 +00:00
dan
0232dade79
Avoid a crash that could occur when a database containing a table with a temp trigger that has the same name as a temp table is detached.
...
FossilOrigin-Name: c4cb9708d48ead10ee9543f86878be8382cd6e850950d5384c95254bac4a8d6e
2019-12-03 03:34:06 +00:00
drh
ca7a26b5a1
Do not allow a term in the WHERE clause of the query to qualify a partial
...
index on the right table of a LEFT JOIN. Ticket [7f39060a24b47353]
FossilOrigin-Name: 4066a34da7bcdcece6c438c27f3a11bc49b8c8373b7e1603f30f6225e2bc800a
2019-11-30 19:29:19 +00:00
dan
597f1eb195
Fix an assert() in fts3 that could fail due to corrupt database records.
...
FossilOrigin-Name: 5d9a369301a65f320a0696fcf1f062ca5976ef34350590c07aecf5335c66d872
2019-11-26 02:03:16 +00:00
dan
baa3458920
Modify journal3.test so that it can handle Tcl command "file attr <file> -perm" returning octal values in either "00755" or "0o755" format.
...
FossilOrigin-Name: b0b655625cf491c832a259d29a67660b8d5943c201617900a83d0660b2673377
2019-11-25 04:15:33 +00:00
dan
62be2dc753
Avoid evaluating PARTITION BY or ORDER BY expressions multiple times for window function queries that use multiple window functions with the same window-definition.
...
FossilOrigin-Name: 57070c68bbe15fc1d19a765182432e844c082909bdbc63b58fd86b96e2c521dd
2019-11-23 15:10:28 +00:00
drh
5281864f0c
Extend the json-path mechanism with array indexes of the form "#" or "#-n" for
...
some positive number "n", to reference the end of an array.
FossilOrigin-Name: 35ed68a651f4cf8740597433b0f1c3b345841868022e0904e9f342840ba0e502
2019-11-22 17:37:56 +00:00
drh
73bacb7f93
Add more test cases from Yongheng Chen and Rui Zhong.
...
FossilOrigin-Name: f24e6ca4f23008212ec05cace9202dbeb37ee34530ead91fac2f5e3eac7f6347
2019-11-22 11:38:40 +00:00
dan
e59c562b3f
Fix a crash that could occur if a sub-select that uses both DISTINCT and window functions also used an ORDER BY that is the same as its select list.
...
FossilOrigin-Name: bcdd66c1691955c697f3d756c2b035acfe98f6aad72e90b0021bab6e9023b3ba
2019-11-22 10:14:01 +00:00
drh
cd30064bd5
Add all fuzz-test cases received from Yongheng Chen and Rui Zhong. Also
...
fix a minor problem in gencol1.test cases.
FossilOrigin-Name: ac080432b480062507452d3cdbe6c0f759e6f95b65d9862e0462017405ab2b8e
2019-11-21 20:24:04 +00:00
drh
522ebfa7ce
Whenever a generated column is used, assume that all columns are used.
...
FossilOrigin-Name: 6601da58032d18ae00b466c0f2077fb2b1ecd84225b56e1787724bea478eedc9
2019-11-21 19:37:00 +00:00
drh
57f7ece784
Fix a problem that comes up when using generated columns that evaluate to a
...
constant in an index and then making use of that index in a join.
FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af
2019-11-21 18:28:44 +00:00
dan
6637332988
Prevent direct and indirect recursive content= options in fts3/4 and fts5.
...
FossilOrigin-Name: 2eb997327c2c369c10b7835be80112d77cb2a7cfa9fe4d564042984c21d94698
2019-11-21 14:20:59 +00:00
dan
83420823af
Fix a use-after-free problem in the test suite. No changes to production code.
...
FossilOrigin-Name: 0d1055a5da8274a59f35170b1f9469597ce4c5a4c5e851a1b81d3be2ccd32871
2019-11-20 16:10:40 +00:00
drh
012b15e2d7
Get the aggregate=TRUE feature working on the DBSTAT virtual table.
...
FossilOrigin-Name: 16fef3db063830884de46d53a289f637a7204fe84fcdee7ea81dbb8bca578952
2019-11-19 18:48:11 +00:00
drh
ad84bd849e
Begin an enhancement effort for the built-in DBSTAT virtual table.
...
FossilOrigin-Name: 9b5722f0fe666b99677e5f333dd8413aefb9ace7a461d74f6558f0ac53768719
2019-11-19 14:01:51 +00:00
mistachkin
3c161e07af
Add support for the SQLITE_ACCESS_SYMLINK flag in the Win32 VFS.
...
FossilOrigin-Name: 175c15008e9f19b8f6762c2fe4a545735128765081980eed01d5e46ca4acb500
2019-11-18 23:48:03 +00:00
drh
0933aad72c
Add support for SQLITE_OPEN_NOFOLLOW.
...
FossilOrigin-Name: cb79c828496a703f1410f61458ebc1e15a92a63412b36f51945b2b5a32ec6e88
2019-11-18 17:46:38 +00:00
drh
804725a6b9
Improvements to detection of corruption in the %_stat shadow table of FTS4.
...
FossilOrigin-Name: 6b67eba54e7b4887a8cdab7537b12a95e9f17bcdaa0b423af5ed5bd91f69f2c6
2019-11-18 14:04:21 +00:00
drh
13a8f203d9
Further improvements to shadow table corruption detection in FTS3.
...
FossilOrigin-Name: e35d8c76aae59f57cc5193f79b21b4298029bea78e1aab7af67432162ce63e00
2019-11-18 12:04:17 +00:00
drh
3e72bdb5fe
Detect and prevent infinite recursion in fts3SelectLeaf() due to a
...
malformed FTS3 btree.
FossilOrigin-Name: dfcf081d842629a0b177be7eb2eb8ce719324068991040a581e33ea1d5db3d27
2019-11-18 11:14:59 +00:00
drh
19d4175d65
Improved detection of corruption in the %_stat table of FTS4.
...
Chromium ticket 1025467.
FossilOrigin-Name: 10f8a3b718e0f47be528fba086c318e1dfe18ead383d01cfa24dedabad41e0a2
2019-11-18 10:37:57 +00:00
drh
feb5dcf1a6
Better detection of corruption in the %_stat and %_docsize shadow tables
...
of FTS3.
FossilOrigin-Name: 1e449687881f4d388e54a0e51bcabba41ab10cf7e596ff65e31e88a23c70d497
2019-11-17 02:41:06 +00:00
drh
fd6bf04bba
Remove a reachable NEVER() in FTS3.
...
FossilOrigin-Name: 8bd75bf636f72f32d66c6c38e1918f27daf2f13290f00a001f41d50838bbda47
2019-11-17 00:08:24 +00:00
drh
c72f2fb7fe
More improvements to shadow table corruption detection in FTS3.
...
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d
2019-11-16 23:47:40 +00:00
drh
94febb3a77
Improved detection of corrupt shadow tables in FTS3. Enable the debugging
...
special-inserts for FTS3 for both SQLITE_DEBUG and SQLITE_TEST.
FossilOrigin-Name: 04b2873be5aedeb1c4325cf36c4b5d180f929a641caf1e3829c03778adb29c8e
2019-11-16 21:40:49 +00:00
drh
527cbd4a10
Do not allow CREATE TABLE or CREATE VIEW of an object with a name that looks
...
like a shadow table name.
FossilOrigin-Name: 6aef58b629d89955f85f65191ba2be67b2adfac4f0327fe9a7141cb2705dbc00
2019-11-16 14:15:19 +00:00
drh
d0c51d1a04
Do not allow shadow tables to be dropped in defensive mode.
...
FossilOrigin-Name: 70390bbca49e706649ca5b7c031f0baf416fc38798c17e5f3b73746b3e66e3b5
2019-11-16 12:04:38 +00:00
drh
47bcc34271
Fix a potential NULL pointer dereference on a RENAME TABLE that references
...
a VIEW with a logic error in a window function in the ORDER BY clause.
FossilOrigin-Name: 0adb273f7e7671efb0e0a1619887e369500dfd2db7ef1b1e125c2414ea96e96f
2019-11-16 11:33:39 +00:00
drh
5710f1ad48
Modify three test cases so that they work even with unusual versions of the
...
library printf().
FossilOrigin-Name: 8f4a3750b7d272daf96831655ffee80d457875ee121fc4537008046b9a00d0e7
2019-11-15 21:16:34 +00:00
drh
8103a03607
Fix table-valued functions so that they will work as the right table
...
in a LEFT JOIN. Ticket [2ae0c599b735d59e]
FossilOrigin-Name: 2c35d3f67b67a53ead08b1c395e7ca8e5bf65f94a5a962a0562994a3c66c95d9
2019-11-15 00:52:13 +00:00
drh
31999c5cac
Fix a bug in the hard_heap_limit pragma so that it returns the new value of
...
the hard_heap_limit, not the soft_heap_limit. Change SQLITE_MAX_MEMORY so
that it works by setting the default hard_heap_limit value.
FossilOrigin-Name: 33fd0c3abcad5555a150990a22d9c1bab99e79be01143fccb9fafc9b52cf92c8
2019-11-14 17:46:32 +00:00
drh
01d1801cab
New test cases added to fuzzdata8.db.
...
FossilOrigin-Name: 5baffcda7d5a42a99fa905faa834f14b94b1e2a26b5221f15d8ae8f1f5e3236a
2019-11-14 13:57:15 +00:00
drh
48eb03bd0e
Proper surrogate pair decoding added to JSON functions. See the mailing list
...
bug report and [https://bugs.python.org/issue38749 ]. More test cases
needed here, but it seems to work so far.
FossilOrigin-Name: 51027f08c0478f1bf9d7545d9e268c772c0a5cd5dda4b03d78f16c7d94f2f50d
2019-11-10 11:09:06 +00:00
drh
675f73bcab
New dbsqlfuzz test cases added.
...
FossilOrigin-Name: 18c3a17dc8c07b12427e372ff86668d5bcb6b34d653c46c48561ed576acefa5b
2019-11-09 14:44:18 +00:00
drh
46a31cdf6b
Make sure the WITH stack in the Parse object is disabled following an error.
...
FossilOrigin-Name: de6e6d6846d6a41c4821454dfdc042096234df753be08c5567b79fe535d9b6ea
2019-11-09 14:38:58 +00:00
drh
1e7c00e695
Fix the xferCompatibleIndex() function so that it recognizes that a PRIMARY KEY
...
index for a WITHOUT ROWID table is different from a UNIQUE constraint index
on the primary key. Ticket [302027baf1374498]
FossilOrigin-Name: 34f64f11ca481996b1ff1686bdc5e278946635b6856cd1fe2355fce8e298e0f8
2019-11-07 14:51:24 +00:00
drh
4e8e533bf7
Restore generated column loop detection logic that was incorrectly removed
...
from the previous check-in [9e07b48934e9a972]. This fixes ticket
[299b50ba812d8e54]
FossilOrigin-Name: 104a2beb57037f9353ffa77096aae0eb64e4682e667f31623bfd3d064dd8d881
2019-11-07 02:32:54 +00:00
drh
dfa15270c4
Change the way generated columns are computed so that no column is computed
...
inside branch code that might not be taken. Ticket [4fc08501f4e56692]
FossilOrigin-Name: 9e07b48934e9a972dcf62e3538b3b21ffa044c553feba0441675ac0bbe13bcb2
2019-11-06 22:19:07 +00:00
drh
4fb24c82cd
Fix the OP_DeferredSeek index-to-table column map in P4 so that it works
...
with generated columns. Ticket [ce22a07731530118]
FossilOrigin-Name: 36c11ad51fe9ab1bde0b98d0ea9b8588e07d168cd8027486749372894941ad93
2019-11-06 17:31:18 +00:00
drh
b1129c423f
Fix the handling of NOT NULL constraint violations for generated columns in
...
a REPLACE statement. Ticket [2399f5986134f79c]
FossilOrigin-Name: 77b1c90add514050fe62f22751362fecacd99f9775346cffc60e09c326e64e10
2019-11-06 14:49:43 +00:00
drh
6c68d7592f
Fix a false-postive in the sqlite3ExprImpliesNonNullRow() decision routine,
...
that resulted in an incorrect LEFT JOIN strength reduction when the
WHERE clause contained a row-value comparison.
Ticket [02aa2bd02f97d0f2]
FossilOrigin-Name: ea20068e6d97c9349ebcc7d0a01e99ebf08c6f44363f71a0218a1abea209adc5
2019-11-04 02:05:52 +00:00
drh
db535390db
The optimization of check-in [9b2879629c34fc0a] is incorrectly reasoned.
...
The WHERE clause of the partial index might not be true if the table of
the partial index is the right table of a left join. So disable the
optimization in that case. Ticket [623eff57e76d45f6]
FossilOrigin-Name: 3be19e1151af1850b65991edb82420f9412a7798dd756c86eaa9ffdde573263a
2019-11-03 00:07:41 +00:00
drh
0383661414
Fix a problem in VIEW creation that was introduced by the generated columns
...
feature.
FossilOrigin-Name: 9c795c4d2b042d2932774bd1274fa0167ca2dc9838e127e0cf31eb9273a32f2c
2019-11-02 17:59:10 +00:00
drh
39b30a7d6b
In sqlite3GenerateIndexKey(), do not attempt to reuse column values from
...
the previous index if the current index is a partial index as the partial
index test may have corrupted those values. Ticket [a9efb42811fa41ee]
FossilOrigin-Name: 17e9f65814264de9c35bc5ba94e0a66fbbf1200c00d33ab9a19a0b6f92bc685a
2019-11-02 13:32:50 +00:00
drh
1a9082f6d7
Omit the optimization that reduces the column-count on rowid-table cursors
...
when the table has generated columns, because we do not know what columns the
generator expressions might try to access.
FossilOrigin-Name: e6c96ed91e7a96d2bd30ea9df132644ac02d5a321a62f81f8f3984a8e49ed94b
2019-11-01 15:19:24 +00:00
dan
b1c479b61d
Fix an fts3 assert() that could fail when operating on a database containing corrupt records.
...
FossilOrigin-Name: 7c52f5478f9ecf5c078208759143ae9de43c1bf191dfcd74acb8bd169d4dc883
2019-11-01 13:37:26 +00:00
drh
f09a14fbc3
Add missing column translations to foreign key logic.
...
Ticket [c28a01da72f8957c]
FossilOrigin-Name: bc6a43e7ee6353b9ef3dea4309c77e170a1c798eefcfaa7636bf5a93e51c47ee
2019-11-01 12:14:30 +00:00
drh
ff37c40787
Correctly generate pre-UPDATE content for virtual columns that are used
...
by foreign key constraints. Ticket [b9befa4b83a660cc]
FossilOrigin-Name: 40d3282ec285d9f724f6548283f48b601510cf5284da17485723fd650a68f436
2019-10-31 20:54:20 +00:00
drh
29974f7b91
Add a few simple TCL test cases for generated columns. (Full test coverage
...
of the generated column logic is provided separately by TH3.)
FossilOrigin-Name: acedb5c7f7dc1d68bef62098d42ca59e1be7a5083bb03dc07c03b9f9d817158b
2019-10-31 17:13:17 +00:00
drh
04307c8a3f
Ignore differences in Expr.op2 in sqlite3ExprCompare() in cases where it
...
does matter. Ticket [1d2a8efc6c3a595a].
FossilOrigin-Name: 329820673a12ff6a6c8759f40989d4ccf272441064b0366a5f491695b55ad0e9
2019-10-31 13:16:26 +00:00
drh
20cee7d0bb
Always disallow the use of non-deterministic functions in CHECK constraints,
...
even date/time functions that use the 'now' or similar keywords. Provide
improved error messages when this requirement is not met.
Ticket [830277d9db6c3ba1]
FossilOrigin-Name: 2978b65ebe25eeabe543b67cb266308cceb20082a4ae71565d6d083d7c08bc9f
2019-10-30 18:50:08 +00:00
drh
66c48907a2
Remove the legacy_file_format PRAGMA. In its place, provide the
...
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option to sqlite3_db_config().
Fix for ticket [6484e6ce678fffab]
FossilOrigin-Name: 4d424f3047b48fc441475137f30a719d2f079390c86fe2617710ddfb05c5e240
2019-10-29 16:18:45 +00:00
dan
9930cfe878
Fix a problem in fts3 causing it to report corruption if a doclist contains consectutive rowid entries that differ by more than 2^63.
...
FossilOrigin-Name: 0b0a3048f9df88bbc8979f2ac5247bee7d7bc1e585faca252610d2fcbe36d51d
2019-10-28 13:54:59 +00:00
drh
0660884ea0
Add missing VdbeCoverage() macro. Fix an off-by-one error in partial index
...
handling. New test cases. Ticket [c1e19e12046d23fe]
FossilOrigin-Name: 41cc8e3dab998f7efc898d18837ca7fdac94ea3f89954990c5231456bf725fee
2019-10-26 01:43:14 +00:00
drh
a407eccb61
If replace triggers are run during uniqueness checking, then rerun all
...
uniqueness checks a second time using the ABORT algorithm.
Fix for ticket [c1e19e12046d23fe]
FossilOrigin-Name: fbac0c65d8464b126d385262d176864add55452ec9e3d5eb76ffee06e820cb9c
2019-10-26 00:04:21 +00:00
drh
06baba54b4
Correction to check-in [bec5b6d4d083556d] so that it detects *all*
...
triggers that might perturb the insertion cursor.
Ticket [50c09fc2cf0d91ce].
FossilOrigin-Name: 521f1d36282549488a47a434484a24924ee970d29f05a8ae499b7d536bcd692b
2019-10-24 19:35:26 +00:00
drh
269d322de2
When a vector comparison appears in the WHERE clause and the constraint side
...
has a COLLATE clause on the first term of the vector, be sure to honor that
COLLATE clause. Ticket [135c9da7513e5a97].
FossilOrigin-Name: 978b2d20cf95d0b7143e3104ce1e9d5c85002867b554dc6b21deb528b730bbc7
2019-10-23 18:09:39 +00:00
drh
db36e255d5
Disqualify row-value comparisons for use by an index if the right-hand side
...
has an affinity that does not match the index.
Fix for ticket [6ef984af8972c2eb]
FossilOrigin-Name: 5c118617cf08e17a6edfdfba86e3fc49132a780990b68b52724c2aaeac85f506
2019-10-22 19:51:29 +00:00
drh
98c94e60d0
Previous check-in to fix [b47e3627ecaadbde] was incomplete. This check-in
...
completes the fix and adds a test cases.
FossilOrigin-Name: c7da1c01f1f239e68c2173ac5748b8c5798271e43bdcee68f51f97cd0ca92bd5
2019-10-22 11:29:22 +00:00
dan
b2075011a7
Avoid an infinite loop in fts3/4 incremental-merge in the case where the lowest level in the database contains segments but no data (because there is a delete-marker for each valid entry). Fix for [bf1aab89].
...
FossilOrigin-Name: 35beaee059a6cccead4311886ca928d936f23584cf435e35e265e98feea723dc
2019-10-17 15:41:36 +00:00
mistachkin
16fd04cdbe
Enhancements to SQL query normalization for UPDATE statements.
...
FossilOrigin-Name: bba975c7af3de9aeb5c62fb8b05d61b96e4ecd0b030008442bbdd345e1e5f134
2019-10-16 17:46:22 +00:00
drh
2da8d6fe74
If an AFTER DELETE trigger fires when a conflict row is deleted by REPLACE
...
conflict resolution, make sure the conflict really has been resolved and that
the trigger did not recreate the row before continuing.
Ticket [a8a4847a2d96f5de]
FossilOrigin-Name: eea1e7aa57e74c4329003f4550168e2aed9e33d2301a3ba84b10781a9cebbc1b
2019-10-16 14:56:03 +00:00
drh
68748ec509
Futher improvements to the IN operator for row-values on virtual tables.
...
FossilOrigin-Name: bc751fb64d5b08e5ca4c85cd1c6fbf09590fa9dad7e176ba373082ea373655b5
2019-10-14 20:32:31 +00:00
drh
4a9f379c9c
New test cases in test/fuzzdata8.db.
...
FossilOrigin-Name: 344d9cb0c726078af6deb4a26bed3aded5b26914bb286d3446d3a4e9150840b7
2019-10-14 15:24:20 +00:00
dan
2d82269ca8
Fix a problem with row-value IN(...) operators and virtual tables.
...
FossilOrigin-Name: aa57d7abac0bb92d4d5fd4e093a11cf8efc04e4eed748b2a400d01f137250649
2019-10-14 15:15:50 +00:00
dan
8b4d0e2cba
Ensure fts3/4 prefix indexes are flushed to disk before an 'optimize' command. Fix for [745f1abc].
...
FossilOrigin-Name: 4ed905b18847d4dbf5a2570052abced338065f824137b90300f62d77b3159d80
2019-10-11 15:33:13 +00:00
dan
9613c9f4a6
Fix the fts3/4 integrity-check command so that it works with "ORDER=DESC" tables. Fix for [8a6fa2bb].
...
FossilOrigin-Name: 5863546df99abd1ad4ebcaba18dec647be4368e2c13ce0b28e48c8608d3e87ef
2019-10-11 14:27:17 +00:00
dan
0287c95165
Prevent SQLite from assuming that if ((? IS NOT NULL) IS NOT NULL) is true, ? may not be NULL. Fix for [d51a8696].
...
FossilOrigin-Name: 7833feecfe745e237f239ee4c38a9e4bf7ad66a32919150208da87c00a826473
2019-10-10 17:09:44 +00:00
dan
cd79010964
Fix a problem in the fts3 integrity-check routine causing it to report as corrupt tables that contain values with embedded 0x00 bytes.
...
FossilOrigin-Name: 629e20c9880acc2cb9e2fa6da39a15a90483e9a8f433df29d285c23bdfb03b0b
2019-10-10 16:41:44 +00:00
dan
3703edf110
Be sure to rewrite column references inside FILTER clauses and window frame definitions when flattening queries. Fix for [1079ad19].
...
FossilOrigin-Name: ccba7202b69d239724c3b589439c9c3b0e1bba237accfeb11c39d492522b8719
2019-10-10 15:17:09 +00:00
dan
da03c1e65e
Avoid assuming that an expression that contains the sub-expression (? IS FALSE) or (? IS TRUE) may only be true if ? is non-null. Fix for [a976c487].
...
FossilOrigin-Name: eb7ed90b8a65748f0721aaf7bdddd2207f552be5015603fbfb7044d815ae2f36
2019-10-09 21:14:00 +00:00
drh
92a2824cc6
An improved fix for the dbsqlfuzz-discovered ALWAYS() failure following OOM in
...
sqlite3ExprCollSeq(). This time with a test case (engineered by Dan).
FossilOrigin-Name: 907f7965b335d8d5441f2e386bb190d1f93ffcd45ca98d2d1c621dede491fc5e
2019-10-09 15:37:58 +00:00
drh
9fd04bfd29
New test cases added to test/fuzzdata8.db.
...
FossilOrigin-Name: b68d21e93a0839b42f49845918df7738ee7fa2a05c7f4ae2f89fdbb5e47ad8eb
2019-10-09 15:03:45 +00:00
dan
8451e1fa27
Add a test case for the assert() fix in the previous commit.
...
FossilOrigin-Name: 32fba11ab72f6300391267eaad64e92fa767c289029e668e4bd6c9165acf1487
2019-10-07 13:46:43 +00:00
dan
6117a17323
Avoid running a couple of tests in affinity2.test as part of the valgrind permutations, as the way floating point computations are simulated by valgrind causes them to fail.
...
FossilOrigin-Name: 7f9a4b6015ac332a04d3e394a6b3210fc95253d8786a261178a5639cb8d9d987
2019-10-03 16:02:22 +00:00
dan
b008e4d744
Fix some test script issues that come up with SQLITE_OMIT_VIRTUALTABLE builds.
...
FossilOrigin-Name: 3934d2d08ee14d644dc01f967c10f219b76b172c963c90a7a8141f2b08a7d5bf
2019-10-03 14:36:36 +00:00
dan
367b8d7aa7
Fix issues with command line invocation of wapptest.tcl.
...
FossilOrigin-Name: 9e0d5d2640a92070967bc9fdf5c5b1653e41b9c04e04dcb70f18ead10f053aef
2019-10-03 13:44:08 +00:00
drh
9a50f4c72a
Update error detection logic in releasetest.tcl to account for new
...
output formats in USAN.
FossilOrigin-Name: 3f36b988360204628d5ad1df2db34818b9a2d6ba989018d4c17757229f4b0f65
2019-10-02 19:44:42 +00:00
dan
f0578823dd
Update corruptM.test to account for the fact that the database schema may be loaded from within the "sqlite3" command for some test permutations.
...
FossilOrigin-Name: cb9470fc064aad72a4e42c6a021410401b3b1a32446ae8b9cd9c759f0a2a01ef
2019-10-02 19:43:38 +00:00
dan
23d3f5d661
Fix a long-standing problem in fts4 incrmental merge.
...
FossilOrigin-Name: 67da31e24ebb49c4cac81c9e7cfca37ca422555fd0fdb01d8f180890783c84ff
2019-10-02 19:33:34 +00:00
drh
cfee884e73
Remove references to test scripts analyzeA.test and analyzeB.test from
...
permutations.test, since those test modules no longer exist.
FossilOrigin-Name: 2394879698107479270c9d899c704de3756ceae177a338b3c37844e2a31aa6dd
2019-10-01 21:31:57 +00:00
drh
5c0666d9e3
In FTS3/4, the poslist end marker must be larger than any other possible
...
poslist value, even on a corrupt poslist.
FossilOrigin-Name: 752679aea5a6bbde24cbf39e2fa018f7dd1c226d463ca4bd74125303b2255170
2019-09-28 11:19:56 +00:00
drh
5f419b3bba
Update requirement marks due to changes in documentation wording.
...
FossilOrigin-Name: 326cdc16f4db23c1d17596e4ef8d9d7abc672d48665950029ba53fd40c1b2d99
2019-09-27 17:36:37 +00:00
dan
7971b7fe92
More minor test file fixes.
...
FossilOrigin-Name: 352878fe1cbcf7b6803624544bba5a95565d1638d4dd09e91764ddad17889301
2019-09-26 20:57:53 +00:00
dan
9d30c8ff8f
Minor fix for test file indexexpr1.test.
...
FossilOrigin-Name: 0ceab26f15c4c7039647cbccf8939dd5c36a60b70ffeefcd3b415c8d4d8351cd
2019-09-26 19:53:26 +00:00
drh
ec39707fe6
New dbsqlfuzz cases added to test/fuzzdata8.db.
...
FossilOrigin-Name: 49073b7003330027303c4c776e9f85112f8b99b89f848fec3f953eba501d7505
2019-09-26 16:57:42 +00:00
dan
a51ddb1ed7
Fix a window-functions problem that could occur if an ORDER BY clause contains an alias for a window-function that is not a top-level expression.
...
FossilOrigin-Name: 1cc6cf6407c6e25aeafeca379a93d0ad2614839c07fb3644e46926fce5f1cfab
2019-09-26 15:53:37 +00:00
dan
e7579a53fb
Further simplifications to window-function code.
...
FossilOrigin-Name: 5fe15c1d8383989257e11d1806e6b035acacd1b504ae385ba58d20db10f26eee
2019-09-25 16:41:44 +00:00
dan
37d296a717
Bug fixes for window frames of the form (... RANGE BETWEEN b PRECEDING AND a PRECEDING) or (... RANGE a FOLLOWING AND b FOLLOWING) where (a > b).
...
FossilOrigin-Name: 040e196a8be3ca41b9365310ab88c2a3cc84b918a6511c77a6d95d4b4e0da3ed
2019-09-24 20:20:05 +00:00
dan
8c9bcb2328
Allow SQLite to omit redundant ORDER BY sorts in the case where a SELECT statement has GROUP BY and ORDER BY clauses that use the same expressions, even when the ORDER BY expressions are marked "DESC".
...
FossilOrigin-Name: 20f7951bb238ddc0b8932a55145df426b6fdf7b8631e069345902c853c90f191
2019-09-21 15:44:12 +00:00
dan
ed09dddece
Fix a problem with queries containing a min() or max() function for which the FILTER clause excludes all rows.
...
FossilOrigin-Name: b1d7e104e034655fe41bc55c562d91e8074a2973d538b8b29301458db45afc57
2019-09-20 20:52:16 +00:00
dan
14e3e22773
Fix an assert() in fts3 that could fail when accessing a corrupt database.
...
FossilOrigin-Name: 601ce9532d34f97a5faa170b6d8a272e5c54f2eabff84660201a1840e0fd9929
2019-09-19 13:51:52 +00:00
drh
6d2566dfc2
Always clear the temporary register cache after coding a subroutine.
...
FossilOrigin-Name: b6f2a7f9cdb547c925f08306df82519e41a7a0dd2cabd9861a48917bb6eef845
2019-09-18 20:34:54 +00:00
dan
572b0dddee
Add extra tests for the handling of corrupt records in fts3.
...
FossilOrigin-Name: 40e29a47d1266c16a4992e43579a51addcc632503099c4cd128f77dd4e67da3c
2019-09-18 17:22:00 +00:00
drh
e691dcb506
Test cases for ticket [587791f92620090e]
...
FossilOrigin-Name: ca0e3a83a1c015b346a791e6de03904d17a769c52dad0e3d71316c6e2e3f43c7
2019-09-17 13:30:30 +00:00
drh
91f473b5cc
Do not attempt the LIKE optimization for non-text columns and a pattern
...
prefix of "-". Ticket [0f0428096f17252a]
FossilOrigin-Name: 6fe0367f9a337b7c62886b7771f3ce0642faa13f4e4f3d9a0c848abbab514cd0
2019-09-16 18:19:41 +00:00
drh
130dbc3d96
Add recent interesting cases from dbsqlfuzz.
...
FossilOrigin-Name: f06ef3d75d85545dd58c6dda10f7ad04fafbb7ae8706b3821be21f86a94795f1
2019-09-16 15:15:38 +00:00
dan
b42eb3571c
Fix a problem with processing CTEs that use a WINDOW clause.
...
FossilOrigin-Name: ca564d4b5b19fe56842a04f31bb61352e6ae9d72a7e7634eb27ebcf5f670545a
2019-09-16 05:34:08 +00:00
drh
fab5b07395
Fix the windows inverse function on the JSON aggregates.
...
FossilOrigin-Name: f464d847af490dd3ec45565dcc4c2e6ff4ed1ebb65036f30ca0b3ce2e73080e6
2019-09-14 00:21:34 +00:00
dan
51a75aaa76
Fix a problem with using json1 window functions with an EXCLUDE clause.
...
FossilOrigin-Name: 4a1978814da41608a16f6953bd575c97d587a34bd80b7ac0e619d62bfdc903d2
2019-09-13 20:42:46 +00:00
drh
e087a7c35b
Fix the windowB test module so that it works even if SQLite is built without
...
JSON support.
FossilOrigin-Name: 807975c76b36347f02aa0ce9661d608adbffe1f7e77c15f8da677e47e1187153
2019-09-13 18:59:04 +00:00
dan
945a3527d5
Merge latest trunk changes with this branch.
...
FossilOrigin-Name: 14ef7543465dd14d8fa141fcceb1950b5c2d265a3e862323969d747b39c0cd8c
2019-09-13 16:19:53 +00:00
dan
fa50834914
Ensure the columns of views and sub-queries maintain their implicit collation sequences when the "push-down" optimization is applied. Fix for [18458b1a].
...
FossilOrigin-Name: 36997c4ade2ef3a274cd1ac52b44118fb3a05325adb650b7b338ecb43d060575
2019-09-10 15:33:52 +00:00
dan
d5deb6b3c4
Ensure the columns of views and sub-selects in the FROM clause of a select are always assigned implicit collation sequences, just as table columns are. Fix for [a7debbe0].
...
FossilOrigin-Name: b9ec72203c19c2b95e648ac1dfad74eec98d4ff82581cdc10dc4221ba551728f
2019-09-09 20:17:24 +00:00
dan
e08663946e
Ensure the columns of views and sub-selects in the FROM clause of a select are always assigned implicit collation sequences, just as table columns are. Possible fix for [a7debbe0].
...
FossilOrigin-Name: 1863b7bf12521bdd2b51c5b8d3a4634bff3e15d3713e0b5343952df7da02f794
2019-09-09 19:49:42 +00:00
dan
e2ba6df9f0
Add the SQLITE_SUBTYPE flag, which can be passed to sqlite3_create_function() and similar to indicate to the core that a user function is likely to use sqlite3_result_subtype().
...
FossilOrigin-Name: 6aa438ce41d460a6782ae63503128b9140c28ff59c2b2eed48b004acf83e0560
2019-09-07 18:20:43 +00:00
dan
1a97c413f8
Fix handling of NULL, text and blob values in window queries that use "RANGE BETWEEN A FOLLOWING AND B FOLLOWING", or "B PRECEDING AND A PRECEDING", where A>B.
...
FossilOrigin-Name: cb3e2be674316e1d39968eb6567f1fe1b72f9d89af49640a9e83f944979c4cf0
2019-09-04 06:56:43 +00:00
drh
c7d12f4ad4
When we play games with COLLATE in order to commute an operator in the
...
WHERE clause processing, be sure not to use the commuted operator to qualify
a partial index, as insufficient COLLATE information is preserved to verify
that the expression will correctly qualify the index.
Ticket [767a8cbc6d20bd68]
FossilOrigin-Name: 5351e920f489562f959ab8a376ff720f845ea165e0cdc7c3a271aac53c2aa64a
2019-09-03 14:27:25 +00:00
drh
4fc836546e
Fix a bug introduced earlier today by check-in [88833a9c2849c959].
...
Ticket [29f635e0af71234b]
FossilOrigin-Name: 6e7b4527d32cc1be0294614b9d7363d4b59cf654a954b86515b3f6888975ce73
2019-09-02 22:13:06 +00:00
drh
dd668c26b5
When applying the IN_INDEX_NOOP optimization and the LHS has REAL affinity,
...
also apply REAL affinity to each element of the RHS.
Ticket [2841e99d104c6436].
FossilOrigin-Name: 88833a9c2849c959a37a80e0e4d2b211ce3c83a48319724c89b172b060c876b4
2019-09-02 02:21:58 +00:00
drh
bffdd63633
When computing an expression value for an index-on-expression or a CHECK
...
constraint and the expressions uses a REAL table column, but the value of
that column is an integer (in other words, when it is using the
store-real-as-integer optimization) be sure to promote the value to real
before evaluating the expression. Ticket [57af00b6642ecd68].
FossilOrigin-Name: 0658c16e311393c8a347b1bd41fa5dbfd2e184aa75d84c011aa8dbac79b632e9
2019-09-02 00:58:44 +00:00
drh
80f6bfc064
Improvements to the algorithm that determines which SELECT in a sequence
...
of nested SELECT statements that an aggregate function belongs to. This
resolves an issue identified by dbsqlfuzz.
FossilOrigin-Name: d768007473f4ed40abbdf2c7e501b580b1cc37c1620c7cb90af1f208a8c35145
2019-08-31 20:13:30 +00:00
dan
f66bfcb740
If a DELETE trigger fired by an UPDATE OR REPLACE statement deletes the row being updated, do not attempt to proceed with the original UPDATE operation. Fix for [d6a0fbc1].
...
FossilOrigin-Name: 4145b3e05051ba6729105157a876793ad14a05d895fc10fe704f437eab16ea93
2019-08-31 17:14:35 +00:00
drh
7314495ff8
When the affinity of a table column is INT or REAL, make the affinity of
...
corresponding index columns NUMERIC. This increases the precision of
index lookups for large numbers so that it matches the precision of
ordinary comparison operators. Ticket [40812aea1fde9594]
FossilOrigin-Name: e0d909c740b774d8a46731696e33342be83206cc4a95d07f42fdb3d8cc2d7a8e
2019-08-30 23:56:34 +00:00
drh
a7ce167e5b
Make sure OP_RealAffinity has been applied to all columns of type REAL
...
in the excluded.* pseudo-table of an UPSERT.
Ticket [5a3dba8104421320]
FossilOrigin-Name: 67381dadede98a55d8d9e085d021e6fa6473071978967b6302e03b28cf2245e1
2019-08-30 23:15:00 +00:00
dan
9889ede28d
Add test case to window8.test. Also fix an error in a comment in window.c.
...
FossilOrigin-Name: 2925bfa5971c8557ecaa6ac18df0825ebbbd1622017509e83451d90640146fa8
2019-08-30 19:45:03 +00:00
drh
db3a32ed1c
Back out the change at [47cd634c98b502d4] which was incorrect. Add a test
...
case so that we don't accidently back out that change again.
FossilOrigin-Name: 596ac2a4eab28b74f4050fb4eb71883f2a1421fdbccf302413e4653391bb52c9
2019-08-30 18:02:49 +00:00
drh
ac6627327c
New test cases for window functions with RANGE BETWEEN and DESC NULLS FIRST.
...
FossilOrigin-Name: f7002f86c780e279c9f8a6268f317586519c059c9de2115ff6f1cad272570c29
2019-08-30 16:46:12 +00:00
dan
8b47f52082
Fix a bug in RANGE window functions that use "ORDER BY <expr> DESC NULLS FIRST" as the window-frame ORDER BY clause.
...
FossilOrigin-Name: 39b4cad4a51bb5116d62ffb16ac36d96a9280321b049eb2d008605392f52a459
2019-08-30 16:14:58 +00:00