Commit Graph

7685 Commits

Author SHA1 Message Date
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