Commit Graph

6607 Commits

Author SHA1 Message Date
drh 472e41ea16 Correctly invalidate a column cache line when it is overwritten with NULL.
Fix for ticket [123c9ba32130a6c9d432].

FossilOrigin-Name: 65754dc3b830ef9482655d2e93c2cd4acaa7a8715a58d8309955d04378541f89
2017-12-13 18:01:52 +00:00
dan 21540ae479 Add compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
collations without also enabling the tokenizer, the LIKE operator, the
REGEXP operator, or the unicode aware upper()/lower() scalar functions.

FossilOrigin-Name: a079f914522d7bc4b3d27d70114eb09adedfac936a64883e6ed8d382c428dd0e
2017-12-08 16:23:38 +00:00
dan f9679318f2 Fix the ".lint fkey-indexes" shell command so that it works with WITHOUT ROWID
tables.

FossilOrigin-Name: 5771b1d611b3562ea6c040f3f893073c4d0ee58c35b37ae211520d9aee8ed547
2017-12-01 18:40:18 +00:00
dan 92b67025d4 Fix some minor problems in test scripts.
FossilOrigin-Name: 4c551fdebc7feda3dcfeec719387d879cd5e2cbe213c0c1aac0a965b3f9e882d
2017-11-30 11:21:59 +00:00
dan 6302590677 Update test file walprotocol.test to account for the changes in the wal
locking protocol.

FossilOrigin-Name: 64e567009dd56ef595850fe460925bc15fa875163541527638b654aa2b2cf785
2017-11-30 07:55:15 +00:00
dan 0895117512 Fix an assertion fault found by OSSFuzz.
FossilOrigin-Name: 75d699877fa7d06d30285ecf008fbedfdf68cc7965bb328c96f5a931d1f13f04
2017-11-28 20:43:40 +00:00
dan 05573e41a8 Lock the wal file for all snapshot transactions, even if they would not
otherwise require this, preventing checkpointers and writers from wrapping the
wal file. This means that if one connection has an open snapshot transaction
it is guaranteed that a second connection can open a transaction on the same
snapshot.

FossilOrigin-Name: b81a31495bd27c1d96f7df653da3502054240cb5acf66b860da7f0f9b422a524
2017-11-28 13:39:41 +00:00
drh cb45eef4d1 Update tests to deal with SQLITE_FAST_SECURE_DELETE.
FossilOrigin-Name: e6b89304695be371978e65dddd710c8bd563c66b9c94d23165142b6c235c82e1
2017-11-28 00:52:14 +00:00
dan 7ac2d48eba Fix a faulty NEVER assert() that could fail for SQLITE_ENABLE_STAT4 builds
that use foreign keys.

FossilOrigin-Name: 465350e55ddaf30cfba7874653301de7238a9dc2bc5e1f800fc95de9360679f6
2017-11-27 17:56:14 +00:00
drh 53bf7175af Fix a problem in the omit-table-from-left-join optimization
from check-in [0cd82ee9a8413cf] that was discovered by OSSFuzz.

FossilOrigin-Name: b016c28fa5617a20ad34c005372e738d28f7fc4388d19ee0cb7add4ed19d74aa
2017-11-23 04:45:35 +00:00
drh fa337cc115 Completely disable the skip-ahead-distinct optimization for all but the
inner-most loop of a DISTINCT join.  Fix for ticket [ef9318757b152e3a26e9592]

FossilOrigin-Name: b7595cf2cadcba486e60b3c230ccc412a7cf449c1d56cbe65869e6d5d9f1374d
2017-11-23 00:45:21 +00:00
drh 065b34f6e5 Fix the skip-ahead-distinct optimization on joins for cases there the table
in the inner loop of the join does not contribute any columns to the
result set.  Proposed fix for ticket [ef9318757b152e3a2]

FossilOrigin-Name: 2dcef5a9ae7f347da65207bf6bf612fb12e18e1a6704799322f0cf2a86154cfd
2017-11-21 23:38:48 +00:00
dan 41203c6cf1 Update the omit-table-from-left-join optimization so that it can omit tables
from the middle of the join as well as the end.

FossilOrigin-Name: 618ca9fe53d8d2d7b4f368e6ee404d5fceeecac0d689f32ab62af8a6cbb37401
2017-11-21 19:22:45 +00:00
dan 17f188e3cf Fix a typo in a test script on this branch.
FossilOrigin-Name: bff5dcfd2b29ee4834258914410a5dee69ec2727dd254053e3ebaf5090937694
2017-11-20 15:45:03 +00:00
dan 75dbf68b5b Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.

FossilOrigin-Name: 299d7ca52fec32f04ffd2b8561dd4b839e891792162f8b00259368683436b02d
2017-11-20 14:40:03 +00:00
dan 6bcabfe1a3 Add some missing "finish_test" lines to the end of test scripts.
FossilOrigin-Name: c21406ab3281480d3eddca0cdf5aea3abc224425ee52c10eed3ff702a0ae5c26
2017-11-17 20:07:19 +00:00
dan 6cbc5074e8 Avoid creating a master journal if all or all but one of the databases in the
transaction is a temp file.

FossilOrigin-Name: 355d1232fd7314723afaa8d6b8b73506b09cbba1113a88b10204ba89be993508
2017-11-17 08:20:10 +00:00
drh 3dbb4acf07 Add a missing "finish_test" to the end of the stmtvtab1.test script.
FossilOrigin-Name: e0b5c0585e8530bd516b340093a46d8e358a731facb78da22d3208633c852804
2017-11-16 19:04:33 +00:00
drh 65efeaca83 Add the ability to read from read-only WAL-mode database files as long as
the -wal and -shm files are present on disk.

FossilOrigin-Name: 00ec95fcd02bb415dabd7f25fee24856d45d6916c18b2728e97e9bb9b8322ba3
2017-11-14 19:34:22 +00:00
dan dc32b448d3 Add further tests for the code on this branch.
FossilOrigin-Name: f8c4e33f4813e0c909064406b5cc17e2d465d8a48a50ede1d356b39479d3d669
2017-11-10 17:47:54 +00:00
dan ca3e3c3f1a Fix a problem involving "DELETE/UPDATE...LIMIT" statements that use an INDEXED
BY clause.

FossilOrigin-Name: 09f94c2c8199b0d23a45cc062ca9561f9e5ddfcba117100e41889ce199d21bdb
2017-11-10 16:14:26 +00:00
dan 26caf5bef1 Fix a problem with (DELETE...LIMIT) statements against WITHOUT ROWID tables
with a single column PK.

FossilOrigin-Name: 35477a3dcceadf5dade8e036d5a2ce91b9ca83c4b85d309db233bdbcf538b1cc
2017-11-10 15:42:21 +00:00
dan e941877806 Enhance walro2.test to better ensure that readonly_shm clients are not using
invalid *-shm files.

FossilOrigin-Name: ff630b66714b20c09888ead0a45f344d63e0d9a5208867d6266e74f79187076c
2017-11-09 20:34:35 +00:00
mistachkin bcb416a9ff Get read-only SHM file tests passing on Win32.
FossilOrigin-Name: abef05353554e72f4d08aff562b87ff8530e8537a79e58d831205ea8c46eed07
2017-11-09 20:02:44 +00:00
dan b3c16b899b Add SQLITE_ENABLE_UPDATE_DELETE_LIMIT for views and WITHOUT ROWID tables.
FossilOrigin-Name: 584b88aaf89ab30cb51185396b7b50c6ecba286add023a26ab41d865b9c605ce
2017-11-09 19:53:06 +00:00
mistachkin 4ff8431fd1 Initial work on porting the changes on this branch to Win32.
FossilOrigin-Name: 3738bfd0c0eadb10eea58954af5052cb6ce164059f3aacfe65d7da6a400c63c7
2017-11-09 16:30:55 +00:00
drh 2fba394c97 Disallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID
tables.  This is a temporary fix for ticket [d4beea1633f1b88f] until a better
solution can be found.

FossilOrigin-Name: 62fe56b59270d9d7372b1bb8a53788a40d20d0f111fe38c61dd6269848592c70
2017-11-09 03:55:09 +00:00
dan 08ecefc5b1 Handle the race condition that may occur if another process connects and then
checkpoints and truncates the wal file while a readonly-shm client is building
its heap-memory wal-index.

FossilOrigin-Name: 5a6703fc3f2174b3e9a624c7272ae013b73c42d6c97ffa62b58553efdb54e3bc
2017-11-07 21:15:07 +00:00
dan 85e1f46eb9 Fix a problem causing an INDEXED BY specifying an unusable partial index to be
mishandled.

FossilOrigin-Name: 292a04086a902634fc514b379a2b245eb2681c1b84d9bb950b6ecb9aab28b468
2017-11-07 18:20:15 +00:00
dan f12ba66cf8 On unix, if the *-shm file cannot be opened for read/write access, open it
read-only and proceed as if the readonly_shm=1 URI option were specified.

FossilOrigin-Name: ba718754fa5ab8596cb84b751051de98afa2706fe6c5df39ad6d925d790719ee
2017-11-07 15:43:52 +00:00
dan d24c5b1c98 Add fault-injection tests for the code on this branch.
FossilOrigin-Name: a7d949fb735f60c19e7257a1a7a12568a9c15be9cd980c018f3a0d6bf112c339
2017-11-07 09:08:43 +00:00
dan ab54838452 Add further test cases for the new code on this branch. And a couple of fixes.
FossilOrigin-Name: 71af9acb227a91d9ad8798c9d0b12d6967e863d050f5cb1fddb45f25ee1f47db
2017-11-06 19:49:34 +00:00
dan cbd3321978 Add further tests for the code added on this branch.
FossilOrigin-Name: a6716fcde38b28b8a03b40f9d16f78a57ec20f60cf391ff553692641cb7f0d3f
2017-11-04 21:06:35 +00:00
dan 11caf4f4b7 In cases where a readonly_shm client cannot take the DMS lock on the *-shm
file, have it parse the wal file and create a wal-index to access it in heap
memory.

FossilOrigin-Name: 18b268433d739486eac1b04947bd418655e4bc56e8dc63ffa558aa4552a32e30
2017-11-04 18:10:03 +00:00
dan 44c8a97e01 Fix test cases in wal2.test broken by the locking change in the previous
commit.

FossilOrigin-Name: f569c3517234881f9425075aab65a32ffd0deb8e793f421a241d8cca881da33f
2017-11-02 18:57:46 +00:00
dan dea5ce36f5 Avoid locking shm-lock WAL_READ_LOCK(0) during recovery. Doing this allows
recovery to proceed while a readonly_shm connection in unlocked mode has an
ongoing read transaction.

FossilOrigin-Name: 5190d84a296b7cf716ef43bf7b6d4d351ef1a4d650de37dc01a5ab333da7c05d
2017-11-02 11:12:03 +00:00
dan 92c02da33e If a readonly_shm connection cannot map the *-shm file because no other
process is holding the DMS lock, have it read from the database file only,
ignoring any content in the wal file.

FossilOrigin-Name: ce5d13c2de69b73378637d4f7e109714f7cd17bf1d1ad995e0be442d517ed1b3
2017-11-01 20:59:28 +00:00
drh 37ab9523fa Move the test scripts for checkfreelist and checkindex over into the
ext/repair/test directory.  Run them now using the sqlite3_checker utility
with the --test option.  Some tests are currently failing due to an
incomplete port.  This is an incremental check-in.

FossilOrigin-Name: 17f8d5e111a9fe5b074f946e23936ae5a2a7a8d8018bad4212660d8eb81c04b7
2017-11-01 18:05:32 +00:00
dan 514c4b7e5d Merge latest trunk changes into this branch.
FossilOrigin-Name: 985bfc992950625a45a7521bf4c8438cd0170de974dff976968be158ac5922a9
2017-11-01 07:06:41 +00:00
drh 1884d00dd0 Merge all recent enhancements from trunk.
FossilOrigin-Name: 24adf90ffb3ce9ff3c26efef0357f3a47312e8d11dc391ef2cc7e6873ef25895
2017-10-31 18:15:36 +00:00
dan 7eded5925b Fix a couple of issues in incremental_index_check to do with CREATE INDEX
statements that contain embedded SQL comments.

FossilOrigin-Name: 2aef41815a9f1786ebdf09d8f6cfa59a8e7d733253eafeae24fa6e2a093bb1d8
2017-10-31 12:01:01 +00:00
dan e7a579d27d Add support for indexes on expressions to incremental_index_check.
FossilOrigin-Name: 8c1c701fdbe0d56ee7f6f7d7b583aafde9fa14acc93ee8ecaddc8bb311e2bf52
2017-10-30 19:38:41 +00:00
dan 75650d4f94 In checkindex.c, use C code instead of SQL/group_concat() to compose various
SQL clauses. This is to make it easier to support indexes on expressions.

FossilOrigin-Name: 940606b3af059eb3f79d71fec871ea88df8bce0349f5b33b79c147a85610e269
2017-10-30 17:05:18 +00:00
dan 6fc6617909 Fix an issue in incremental_index_check with indexes that use non-default
collation sequences.

FossilOrigin-Name: 3ebb2351e2650d263029d2c0042683cba3529c9d3f76b5f994f2e737b84d3f67
2017-10-30 08:04:38 +00:00
dan 19465e7380 Fix "after" parameter handling in the incremental_index_check code.
FossilOrigin-Name: c40c3c62e996044f31ca49ffc2edb2cc0320e69956f7ee6fe3e9012200e0d9a0
2017-10-28 20:31:25 +00:00
drh 6d6e76f75f Add test cases from OSSFuzz to prevent a regression in co-routine
processing.

FossilOrigin-Name: 689743d8e3fa81e65dcb067bbf61bab09210b3b39586c865c00d9f1d6692daf2
2017-10-28 12:20:09 +00:00
dan bde13e2694 Add the start of the "incremental_index_check" virtual table in
ext/repair/checkindex.c. For incremental verification of index contents.

FossilOrigin-Name: d5b9dada471358a2864727759648b763bf6890fc2521fac53c0d8216017d39b7
2017-10-27 20:53:16 +00:00
drh 0503f2acfa Fix a Pager ref-count leak in the sqlite_dbpage virtual table.
FossilOrigin-Name: c063bb04da77d6847e4e254b6bb939c860e781382e34ddff8e0454d9db7552e2
2017-10-27 18:24:11 +00:00
drh 6e61c5f895 Additional test case demonstrating the ability to access structure elements
using quoted names in the JSON1 extension.

FossilOrigin-Name: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f
2017-10-27 12:27:25 +00:00
drh 47d9f83982 Enhance the min/max optimization so that it works with indexes on
expressions.

FossilOrigin-Name: 6caec9082b3ad6d3f89f6291084a8f5c80f296630e2e94bc764389ac1a47a833
2017-10-26 20:04:28 +00:00