Commit Graph

5478 Commits

Author SHA1 Message Date
drh
e4d38707ea Improved detection of database corruption in freeSpace().
FossilOrigin-Name: 29bcb56887f862a1f06677a7b4bfae6475d29732
2015-06-15 12:58:15 +00:00
drh
aca55cfec3 Remove stray outputs from the test suite.
FossilOrigin-Name: afc6db9b105f32110112b877f06091757888a5f2
2015-06-11 14:19:05 +00:00
drh
72bc8208f0 When generating code for partial indexes, be sure not to modify the
index condition expression in the schema.

FossilOrigin-Name: e63d01c69c3e50f49ee3022a519c4f3e91f00520
2015-06-11 13:58:35 +00:00
mistachkin
eeb31ff59b More test output refinements.
FossilOrigin-Name: e64a5681793238fa04fe3636f48d34b2dd36cdfa
2015-06-10 23:02:38 +00:00
mistachkin
7b96f2fa7e Remove possibly stray output from various tests.
FossilOrigin-Name: f38e0be56fc086a3ce08134ade83ab61c9fca106
2015-06-10 22:51:02 +00:00
drh
905da63a82 "test" targets on all makefiles use --verbose=file --output=test-out.txt.
Add the new "quicktest" target to all makefiles - designed to run in under
three minutes.  The --quick option on releasetest.tcl now uses quicktest.

FossilOrigin-Name: 6ddef2ad35ceb5822fc14c65bc7c6a2662edb63c
2015-06-10 18:53:09 +00:00
dan
84dff7a20e Avoid passing constraints that are unusable due to LEFT or CROSS joins to virtual table xBestIndex() methods.
FossilOrigin-Name: 7b446771cadedafbe8924ad0658adc2597816dc7
2015-06-10 14:27:40 +00:00
dan
17c0823bda Add the --output=$file and --verbose=(0|1|file) options to tester.tcl.
FossilOrigin-Name: f7b2c70362f10ee0347c1d2318918ffefa53243d
2015-06-09 15:58:28 +00:00
dan
35175bf7ab If a query contains "FROM t1 LEFT JOIN t2, t3, t4", ensure that tables t3 and t4 are not scanned before t2. The trunk already does this.
FossilOrigin-Name: 0d9edfab9fb61322620f188b48ae2a1798a07581
2015-06-08 18:48:29 +00:00
drh
24dee9d214 Always check for cell overflow before returning a slot from the
pageFindSlot routine in btree.c.

FossilOrigin-Name: 9f035c45a4b84203e67b6e1b23cf11691dc43f1e
2015-06-02 19:36:29 +00:00
dan
167fd757f0 Merge latest trunk changes with this branch.
FossilOrigin-Name: c9ffda4abb4390bbc5719e269196e2807b254f97
2015-06-02 18:07:58 +00:00
drh
467c1c70fb Add test cases for type affinity rules.
FossilOrigin-Name: 9678646d9a14ba283a83839be329599a676a537a
2015-06-02 17:25:05 +00:00
drh
cd8fb7cfd5 Fix a faulty assert() in btree.c. Update the database fuzz test file with
new test cases.

FossilOrigin-Name: 4e621af1345a001360938de76e3b0a14deb5e991
2015-06-02 14:02:18 +00:00
drh
b5a2d55ee6 Omit the rowallock.test script (Read-Only WAL lock) from the
inmemory_journal permutation.

FossilOrigin-Name: d21db3308996510ffc3c869c2ac093de70d03412
2015-05-29 15:15:40 +00:00
drh
d092ed4355 Add some extra source-code comments and a test case.
FossilOrigin-Name: 6d410442fb532e2cf0ad1859bc9e843651f8ff4d
2015-05-29 14:36:30 +00:00
drh
73d340adff Earlier detection of incompatible sibling pages in balance_nonroot.
FossilOrigin-Name: 60a09f17d8b70dbc4b020586a1b81bce76882729
2015-05-28 11:23:11 +00:00
drh
24cf1e546c Add new test cases to the fuzzdata3.db set of database fuzz tests.
FossilOrigin-Name: 467b13a40171dd8462dc11d05bb1e9cb588e6a23
2015-05-28 03:45:03 +00:00
drh
275fe3adf1 Do not attempt to take any write lock on a read-only database on Windows.
FossilOrigin-Name: a47ff0cdab0f82398c68ea770053f193f4812a51
2015-05-28 00:54:35 +00:00
drh
3da29a112a The fuzzoomtest makefile target is no longer supported, so update
releasetest.tcl accordingly.

FossilOrigin-Name: 06959d4ada53b765cae4b192a691fced4b8aebbb
2015-05-27 19:35:08 +00:00
drh
f74d35be8c Fix a minor and harmless memory leak in fuzzcheck. Adjust the makefiles
to run fuzzcheck with --quiet on valgrind tests.

FossilOrigin-Name: 8bfe834432b37f94779da6c71fc369651f024590
2015-05-27 18:19:50 +00:00
drh
a7298ac191 Disallow the use of "rowid" in CTEs - it has never worked correctly and it
makes no sense, so we might as well make it an explicit error.
Also: add the PRAGMA cell_size_check=ON command.

FossilOrigin-Name: 19e2cebc12aaa4e72d3bad74af73575a0457e5d4
2015-05-27 15:10:20 +00:00
drh
fccda8a162 CTEs have never add working rowids. So disallow the use of the "rowid" column
within CTEs.

FossilOrigin-Name: 0055df0445932a43e42b318ef88672dcbe312c3a
2015-05-27 13:06:55 +00:00
drh
1421d980c5 Add the "PRAGMA cell_size_check=ON" command.
FossilOrigin-Name: 2ead43f074d01312c7642e1df9abccc95547f019
2015-05-27 03:46:18 +00:00
dan
82faa2c88d Merge accidental fork.
FossilOrigin-Name: e85628e34ac684b8a23f49eee71e4d6546e0ef64
2015-05-26 19:01:36 +00:00
dan
584390e8dd Fix a one-byte buffer overread that may follow a syntax error while preparing an SQL statement.
FossilOrigin-Name: 075003930da98419f671b7833a5850693529fb62
2015-05-26 18:58:57 +00:00
drh
4d6fda73b4 Fix fuzzcheck so that it responds correctly to the TEST_FAILURE environment
variable.

FossilOrigin-Name: 76770c9e061e2eb106d7ea402eef888b98ba9d0e
2015-05-26 18:58:32 +00:00
drh
ea93c7005d The "make fuzztest" target now uses fuzzcheck instead of fuzzershell.
FossilOrigin-Name: 4a5f6f1f0128657fd8d4d99d0682edd5bac2a19e
2015-05-26 18:15:08 +00:00
drh
d9972ef752 Enhance fuzzcheck with the ability to store descriptions in each source
database and to run multiple source databases in a single invocation.

FossilOrigin-Name: 193364c81c301a41c16835108d23ad2ab84d9dd7
2015-05-26 17:57:56 +00:00
drh
908aced558 Fix another bug in the in-memory VFS for fuzzcheck.
FossilOrigin-Name: 16878a314baceb14632a3ec43187fcc020089a76
2015-05-26 16:12:45 +00:00
dan
6c1944f659 Update test cases in corruptI.test so that they work with both SQLITE_ENABLE_OVERSIZE_CELL_CHECK and SQLITE_DEFAULT_AUTOVACUUM builds.
FossilOrigin-Name: 22a14663782312fa7f4f18545509ef4b27e9b8c1
2015-05-26 14:57:45 +00:00
dan
fb0246ba8a Return SQLITE_CORRUPT to the user if an attempt is made to add database page 1 to the free page list.
FossilOrigin-Name: 68876003f922635737349f55bc73a78891ea7028
2015-05-26 12:18:17 +00:00
dan
c5b7358513 Fix a problem with ignoring UNIQUE constraints on WITHOUT ROWID tables rendered redundant by the PRIMARY KEY.
FossilOrigin-Name: 3b936913f3dc2cae4c94f983f28d85b136a44c9f
2015-05-26 11:53:14 +00:00
drh
e5c5f2cf77 Add the --result-trace option to fuzzcheck, and other interface enhancements.
FossilOrigin-Name: c415bb7bbfd531b138462589cdd58fa0204804e8
2015-05-26 00:28:08 +00:00
drh
aca7ea1e4d Fix an important bug in the xRead method of the in-memory VFS for fuzzcheck.
FossilOrigin-Name: 58cd40e89f3060c63abb9a3fca385a1e72ce7bb4
2015-05-25 23:14:37 +00:00
drh
1573dc3bb1 Add fuzzcheck to all makefiles and fix compiler warnings.
FossilOrigin-Name: 7b3d21906a9650377cda56b94facdff75b2cb858
2015-05-25 22:29:26 +00:00
drh
4ab31475dc Improved tracing capabilities in fuzzcheck.
FossilOrigin-Name: 864bfdbfe7b196cc9df2136b15a28e2a0f2713cb
2015-05-25 22:17:06 +00:00
drh
15b3128656 Add the --native-vfs option on fuzzcheck.
FossilOrigin-Name: 12e95e3f178b89d649bc7e30db731df439ae1653
2015-05-25 21:59:05 +00:00
drh
b335d12df7 Merge the btree fixes out of trunk.
FossilOrigin-Name: f3cd8cecf4f7aa3429e3ebc90ed31c4e8fff7bc2
2015-05-25 19:37:17 +00:00
drh
a9542b1bc4 Add the --dbid and --sqlid parameters to fuzzcheck. Other fuzzcheck fixes.
FossilOrigin-Name: 75ec9299faca8ce3d49d825ba6ea60588a91d113
2015-05-25 19:35:42 +00:00
dan
08f901b008 Have the b-tree layer return SQLITE_CORRUPT to any attempt to open a cursor with a root page number less than 1.
FossilOrigin-Name: aa18c8e9d1676b1caa53bc5f5c1dc5f201089b88
2015-05-25 19:24:36 +00:00
drh
3b74d0327f First code for a new utility program to rerun checks on a large number of
fuzzer-generated test cases.

FossilOrigin-Name: c5b4e363528aa1d2d5f41451f16de0aa91152b38
2015-05-25 18:48:19 +00:00
dan
0f8076dd69 Fix a couple of btree asserts that would fail when encountering 32-bit rollover in cell payload size fields (cell payloads this large always indicate corruption).
FossilOrigin-Name: 8fa0937a2f3476dd280259e252d6f422c33d38ee
2015-05-25 18:47:26 +00:00
dan
2fc3a6cd98 Fix a case where database corruption may cause SQLite to write past the end of a buffer.
FossilOrigin-Name: 97806a78142b15f89878e25ee70dc5b0524d6793
2015-05-25 17:07:29 +00:00
dan
cf3d17c604 Fix an assert() in btree routine freeSpace() that may be false if the database is corrupt.
FossilOrigin-Name: 00a473c56188cd60a74559effb114140e3fe8a8d
2015-05-25 15:03:49 +00:00
dan
3fb37f097c Fix an fts4 matchinf() problem triggered by deferred tokens that are part of phrases that are part of AND expressions.
FossilOrigin-Name: f1e942a1dda496a509741e9cc2a17e8b4dac63a3
2015-05-25 10:57:13 +00:00
drh
f058b9c472 Add a test case to verify that CREATE TABLE AS does not store INT values
in TEXT columns.  Ticket [f2ad7de056ab1dc92].

FossilOrigin-Name: 0e45e8f1574ef19a43dbd118440ddbc5cec80ce7
2015-05-20 17:25:44 +00:00
drh
00d5ab7405 Fix handling of queries with VALUES on the left and UNION ALL SELECT on the
right and a LIMIT clause.

FossilOrigin-Name: c403502cdce8b82e570e6fc49ab7f5144800c189
2015-05-20 00:15:27 +00:00
dan
dde548cb16 Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value.
FossilOrigin-Name: f5d0ce80792d58ef424300f973f8876d835ed4ad
2015-05-19 19:44:25 +00:00
dan
b387e63707 Merge latest trunk changes with this branch.
FossilOrigin-Name: 6055a6725cb24469c10de9a04f3614dcc79193c6
2015-05-19 14:14:57 +00:00
drh
a48bae8819 Transitive constraints should only work if operands have compatible
affinities and collating sequences.

FossilOrigin-Name: 5df4056448fee1c766f8f79c735ed12abdce5101
2015-05-18 12:28:09 +00:00
drh
69c15fee98 Refinements to the determination of when an A==B term is an equivalence.
Add test cases.

FossilOrigin-Name: 6bfaf525cac2e0c0a4a3bd3a1fc7bf5bd3234303
2015-05-18 11:34:52 +00:00
drh
df553659ad Make a hard copy of the results of a subquery lest the result of the
subquery be referenced after a change to the table that generated the subquery
result.

FossilOrigin-Name: 9c0d80907b4dee8ee8f205c2ebdb759f5ba1d771
2015-05-18 04:24:27 +00:00
dan
e0569a4aae Further test coverage improvements for fts5.
FossilOrigin-Name: 927d9a64e13c6b768f0a15475713192fcfaaf9e7
2015-05-16 20:04:43 +00:00
dan
3072b537f5 Do not assume that "col IS ?" matches at most a single row of a UNIQUE column unless the column is also NOT NULL.
FossilOrigin-Name: e038ce8955e785afcc07bb22499955bbd22a7af4
2015-05-15 19:59:23 +00:00
drh
22c17b8bf5 Simplifications to error message processing. Fix a possible problem in error
message formatting when vacuuming a database with a corrupt schema.

FossilOrigin-Name: 56ef98a04765c34c1c2f3ed7a6f03a732f3b886e
2015-05-15 04:13:15 +00:00
drh
5d8806e07c A few more test cases for the IS operator.
FossilOrigin-Name: f397c8622ae5a36a71f81d9f2549ca314005ece5
2015-05-14 14:03:21 +00:00
drh
4a00b33c02 More test cases. Remove some invalid testcase() macros. Rearrange some code
for improved testability.

FossilOrigin-Name: b3676377b257bd8bb7fefe9c365d76cdc9e44856
2015-05-14 13:41:22 +00:00
dan
2bbb62ce0b Merge changes from the index-is-operator branch into this one. Drop the partial support added for IS on this branch by [52e73eec].
FossilOrigin-Name: 16ab9cafd00ea5df7e6f75d6a6740237828b888d
2015-05-14 09:53:17 +00:00
dan
8255079611 Merge latest trunk changes with this branch.
FossilOrigin-Name: 299ed55c909d327826ef47e204ef1e9afd54852b
2015-05-14 08:58:52 +00:00
drh
e8d0c61f0a A new implementation of indexing with the IS operator that works correctly
when the IS operator is in the WHERE clause and the operands are from 
opposite sides of a LEFT JOIN.

FossilOrigin-Name: 4541688b3f56f5cd3d5b299594b58c577ad633bb
2015-05-14 01:05:25 +00:00
drh
9be1870994 Simplified implementation of indexing with the IS operator.
FossilOrigin-Name: 95b1f9bf14e490c6c6bba9ea78aeab712a44aab5
2015-05-13 19:33:41 +00:00
dan
5d03b9d365 Merge latest trunk changes with this branch.
FossilOrigin-Name: b5f0e8c5b4bc018d672617ffd342d12b228548b9
2015-05-13 18:12:58 +00:00
drh
e0cc3c296c Add testcase() macros and comments and a few test-cases.
FossilOrigin-Name: 24263d08b11c88416d270013bdaf5ff45125cb4d
2015-05-13 17:54:08 +00:00
dan
23d538885e Change fts5 doclist-index structures to be trees instead of flat lists. This only makes a difference for databases that contain millions of instances of the same token.
FossilOrigin-Name: aa34bf666c384cf32a8d8166ab6d9afbca26a256
2015-05-13 17:15:32 +00:00
drh
6582ae520f Try to get recent sqlite3_analyzer and sqldiff tests working for all
tested combinations of compile-time options, especially
SQLITE_OMIT_VIRTUALTABLE and SQLITE_OMIT_LOAD_EXTENSION.

FossilOrigin-Name: 07c7d3925cbcf44c2f606c7f016ec56304e0ca24
2015-05-12 12:24:50 +00:00
dan
6ebf1eb2c4 Add new fts3 matchinfo option 'b'. Also optimize existing option 'y'.
FossilOrigin-Name: 2e7679a1df4020dc0166f5de8ffd664df18a3002
2015-05-11 19:01:18 +00:00
drh
8906b7dbde Add missing "finish_test" commands to the end of the two new test scripts
for sqlite3_analyzer and sqldiff.

FossilOrigin-Name: 1d5e72b1c4e0350c492e12f102acc41e1777ef98
2015-05-11 18:48:52 +00:00
dan
1c1cea8bae Merge latest trunk changes into this branch.
FossilOrigin-Name: 82e5a6e088c58815140ad36715ac11c96527cb25
2015-05-11 18:46:42 +00:00
drh
d13b231923 Test cases for sqlite3_analyzer and sqldiff. Fix a problem with
sqlite3_analyzer related to the renaming of the initialization routine.

FossilOrigin-Name: 85a4a46c3bb9fd8124969c9e975086c795113b7e
2015-05-11 17:46:14 +00:00
mistachkin
6a12854024 Remove a couple stray test breakpoint calls.
FossilOrigin-Name: 2860cebeeaebd346de60c762aa3e51dbab008578
2015-05-08 00:58:39 +00:00
drh
857df26b85 Enhance the dbstat virtual table with the ability to analyze ATTACHed
databases.

FossilOrigin-Name: 25ec09400b753fcb10a2aae57eb43dbf0548b7ca
2015-05-07 14:41:56 +00:00
drh
9b40e474ef Remove a faulty assert() statement.
FossilOrigin-Name: 5f2539da8cb9df99029ab4ab7023804722697673
2015-05-07 00:09:29 +00:00
dan
99eaf39784 Add the fts3 matchinfo 'b' flag.
FossilOrigin-Name: b9b77972d88171e4239b8194f308eb5d60b5d172
2015-05-05 20:39:53 +00:00
dan
dd14ecbca5 Fix a faulty assert() in the btree part of the "PRAGMA page_size = ?" code.
FossilOrigin-Name: 90b197489a37e01dcb2f3a8182848c1301e1757b
2015-05-05 10:03:08 +00:00
drh
d1055b1bd5 In the command-line shell, and the ".binary" command and additional
C-style backslash escapes.

FossilOrigin-Name: 850c11866686a7b39d7b163fb60898c11283688e
2015-05-04 19:13:25 +00:00
drh
9af8646dce Fix a faulty assert() in the SELECT code generator and add a test case
to prevent regression.

FossilOrigin-Name: 1421c8ffba179d6aafa2643012f80a2738779117
2015-05-04 16:09:34 +00:00
dan
28f98455f4 Add the experimental matchinfo 'y' flag to fts3/4.
FossilOrigin-Name: 92941609af74044b3078e020324a37b04a0638b0
2015-05-02 09:44:15 +00:00
drh
b3df0c675c Enhance fuzzershell to accept multiple input files. Add the test/fuzzdata2.txt
fuzz test content.

FossilOrigin-Name: ab5523aafe4817232388d28ea99be0953e7dccf3
2015-05-01 19:21:12 +00:00
dan
929b923388 Fix an assert() failure caused by setting "PRAGMA journal_mode=off" on an database in exclusive-mode that has already opened the journal file.
FossilOrigin-Name: 40db3e40126db1035fcc12989026915744dc5651
2015-05-01 16:57:24 +00:00
drh
6c98415a1c Modify the mkfuzzdata1.tcl script so that it retains the culled test vectors
in the tmp2 subdirectory.

FossilOrigin-Name: 431a958f3b605ef059119eaedd69796e14bec291
2015-04-30 13:06:15 +00:00
drh
0bdef92dc2 Update the test/fuzzdata1.txt file with the latest cases discovered by AFL.
FossilOrigin-Name: f2063f5320f5a5d884f9c931eb91b7cc94945b92
2015-04-28 14:49:41 +00:00
dan
d68d1f4863 Fix an assert() failure that could occur if the internal sqlite3_rename_parent() SQL scalar function was invoked directly.
FossilOrigin-Name: 36e515261825be60ffdc73d13340d77cf377e8e1
2015-04-28 14:07:02 +00:00
drh
4d35c41f48 Add a TCL script that can be run to generate the fuzzdata1.txt file.
FossilOrigin-Name: fdc79fd14af8e05d1d5b4665303715b391f2e402
2015-04-28 00:53:26 +00:00
dan
995f8b9d73 Add fault-injection tests for the code in test_stat.c.
FossilOrigin-Name: ea5e0b74c997492025225cd86e65e8a8c86ca4a0
2015-04-27 19:53:55 +00:00
drh
a30c158c38 Update the fuzzer test data after having run it through afl-cmin to remove
redundant test cases.

FossilOrigin-Name: 8134d41b964428b3af022735bce9d07c6ad28b21
2015-04-27 15:08:53 +00:00
drh
375d9b1f1c Update the AFL fuzzer data with newly discovered paths.
FossilOrigin-Name: d98219805d4596360ac6ae9647687f8dc709828a
2015-04-25 17:45:36 +00:00
drh
f332071b7f Add the fuzzoomtest target to the makefiles. Invoke fuzzoomtest from
releasetest.tcl.

FossilOrigin-Name: f60657c2ae8a11f1e546c953bca07d9396142f73
2015-04-25 13:39:29 +00:00
dan
f89aa47f80 Fix an obscure memory leak that could follow an OOM in where.c.
FossilOrigin-Name: 08ec9f2f5a446774bb8e9b9b0ef463dd5458d28e
2015-04-25 12:20:24 +00:00
dan
ef8b74324d Merge latest trunk changes with this branch.
FossilOrigin-Name: 1c78d8920fb59da3cb97dd2eb09b3e08dfd14259
2015-04-24 20:18:21 +00:00
drh
0ef84d0e5e Add the --with-tcl=DIR option to the test/releasetest.tcl script.
FossilOrigin-Name: 4dda916a572bcb54c8cf3b81d965328632a722eb
2015-04-24 17:50:37 +00:00
drh
8ea5eca183 Run fuzzershell as part of the valgrindtest makefile target.
FossilOrigin-Name: 0bb96a037bd7179cb3a6137bb29827fc7d72ec3f
2015-04-24 16:53:03 +00:00
drh
e1a71a582f Add AFL-generated test cases in the test/fuzzdata1.txt file. Automatically
run fuzzershell against those cases on a "make test".

FossilOrigin-Name: 627ea83c26b420088f101801eb8765127f47d2d0
2015-04-24 16:09:12 +00:00
dan
e11afed562 Merge latest trunk changes into this branch.
FossilOrigin-Name: 1506e99eca19f72fb59b55ec9e2534505dfa7a6e
2015-04-23 19:32:19 +00:00
drh
41148f83c4 Fix a faulty assert() in the "AS" alias resolution logic of the parser.
FossilOrigin-Name: b5e43602833249aa4b73337bf85b7f308450dab6
2015-04-23 13:37:05 +00:00
dan
38f2024062 Fix a problem causing the fts3 integrity-check to fail if run inside a transaction.
FossilOrigin-Name: 3b925189a75eae875da256b6e54999cad3cef1eb
2015-04-23 11:52:04 +00:00
dan
062c267dff Update this branch with latest trunk changes.
FossilOrigin-Name: 9797482ded7de985e3b20aedec5e4d81f55065c8
2015-04-22 09:40:35 +00:00
drh
dfb5e1cbc6 Make sure the datatype and collating sequence of transients tables are
not initialized more than once.  Otherwise a memory leak results.

FossilOrigin-Name: 9e6beda2c8d879e438ee933e658f860d6eb42a20
2015-04-21 17:07:01 +00:00
dan
464083544e Ensure that tables names are dequoted exactly once by the trigger logic.
FossilOrigin-Name: 9d887b92f8086961e045f8acb9ee7a443796d411
2015-04-21 16:38:49 +00:00
dan
4b79bde7a2 Fix an obscure problem with "INSERT INTO tbl(cols) SELECT" statements where the SELECT is a compound with an ORDER BY and "cols" is a strict subset of tbl's columns.
FossilOrigin-Name: 718d5d0eab045a874107e078a857226a80ab912d
2015-04-21 15:49:04 +00:00
drh
7c052da54d Change an assert() in the aggregate query code generator into a testcase().
FossilOrigin-Name: d1e6bc918b0c8e0701f5e15afb91b84a9004231b
2015-04-21 15:16:48 +00:00
dan
3c9a073723 Fix an fts4 problem to do with the handling of phrases that contain zero tokens.
FossilOrigin-Name: caba5be0b2bdaf4eb4af9af267c0c22dfbd3dba5
2015-04-21 12:06:53 +00:00
drh
b6b676ea7c Fix some identifier name de-quoting issues in the foreign key and trigger logic.
FossilOrigin-Name: 59e92bd9521f1e8315a9a7e7fd3d63b0c75eaf0e
2015-04-21 03:13:47 +00:00
drh
60f4e0918d Test case for the previous check-in.
FossilOrigin-Name: a526f58bc96c0fdead51b6bd9aafea7b48bf398e
2015-04-21 02:17:30 +00:00
dan
4eed05347c Fix a memory leak caused by duplicate entries in the sqlite_stat1 table.
FossilOrigin-Name: 2f58c8c9722fffc486610f9e6b08178d53a56b64
2015-04-20 15:13:08 +00:00
drh
cef2584335 Fix an obscure memory leak in sqlite3Stat4ProbeFree()
FossilOrigin-Name: c72abbe2c1735f3d563c6672616b2918b6209922
2015-04-20 13:59:18 +00:00
drh
992590be1c Fix a broken assert() and comparison for INSERT INTO ... SELECT when the
SELECT uses an unknown collating sequence.

FossilOrigin-Name: e73ac0cbac257d2d2b28e51423e30d7449b6c7b5
2015-04-19 22:41:22 +00:00
drh
7520996965 Silently ignore parser stack overflow when parsing a malformed schema in
PRAGMA writable_schema mode.

FossilOrigin-Name: 2cb37b959c66b5ae3535ab81ba14a4ebf9732df7
2015-04-19 22:31:45 +00:00
drh
5f1d2fa4d2 Fix another assert() that is not true if the database schema is corrupt.
FossilOrigin-Name: bc97cec6338b16a4e9b1a9457d01bb7fe462934d
2015-04-19 21:59:19 +00:00
drh
33c59ecafb Fix a faulty assert in the schema parsing logic.
FossilOrigin-Name: b1ed949584a2526c04952b98c3aa283427f45e10
2015-04-19 20:39:17 +00:00
drh
d0c7305313 Fix a potential NULL pointer deference on a corrupt database schema.
FossilOrigin-Name: dc61b292d8eaf422ca8a2b18f1caccef1a5389fd
2015-04-19 19:21:19 +00:00
drh
a21f78b93f Bring comments on the INSERT code generator up-to-date. Fix the INSERT code
generator so that it correctly handles inserts from a SELECT into a virtual
table with non-terminal hidden columns.

FossilOrigin-Name: 4ac81fac6c6302c042be3df493a41630b733fff0
2015-04-19 18:32:43 +00:00
drh
7088d50109 Fix an incorrect assert() statement in the CREATE INDEX code generator.
FossilOrigin-Name: 2eed41fda068f2cbac55e63d7c1875ddaa331508
2015-04-18 17:43:29 +00:00
dan
ea8562edce Ensure that if a "ROLLBACK TO" statement is used to rollback (but not close) theoutermost transaction, the xRollbackTo() method of any virtual tables involved in the transaction is invoked.
FossilOrigin-Name: e98d481d84ef31b6ed154f14deae9b261f722616
2015-04-18 16:25:54 +00:00
dan
1586699cfc Fix a problem affecting some fts3 UPDATE and DELETE statements on order=DESC tables.
FossilOrigin-Name: 284c1623f81704ef80edb9324954525cb2b72172
2015-04-17 20:51:55 +00:00
drh
7693c42f1a In the expression-tree comparison routine, do not compiler Expr.iColumn
and Expr.iTable for TK_STRING expressions.

FossilOrigin-Name: b67bb16c72c3e015ea82665ada9b5d3289ef6fb2
2015-04-17 19:41:37 +00:00
drh
7b4da150da Always resolve symbols in all ORDER BY clauses of a compound-SELECT, even
illegal ORDER BY clauses.

FossilOrigin-Name: 6c39ef73d5899eabdb46db50c2b00c2d8381a41a
2015-04-17 18:52:37 +00:00
drh
97ab32bcd3 Remove unnecessary parser error count increments. Let the sqlite3ErrorMsg()
take care of doing that.

FossilOrigin-Name: 3f3b0f683af2fbee83811536f6bef770ff919385
2015-04-17 18:22:53 +00:00
drh
d99d28361e Ensure that semantic SQL errors are always reported back up to the syntax
parser.  Also:  Improve the defense against invalid PRAGMA synchronous settings.

FossilOrigin-Name: 7aeade9a07f29bf26e50394042ea18d0121fe7a3
2015-04-17 15:58:33 +00:00
drh
b8289a8b00 Fix a faulty assert() in sqlite3SelectNew().
FossilOrigin-Name: 620d19c3b462f5c4763ebd26513321431f21dd72
2015-04-17 15:16:58 +00:00
dan
ec16d98489 Have OTA always specify SQLITE_CONFIG_URI when opening databases. Fix a test issue causing otacrash.test to fail.
FossilOrigin-Name: 0d0e5ec064eaecb200b9b601b7a54a1700cd176e
2015-04-17 08:36:05 +00:00
drh
ab4e7f3337 Make sure all cursors are closed when returning from a VDBE subprogram that
implements a foreign-key construct.

FossilOrigin-Name: d04d354d8e423961c3091b6ebcfbbbf10d3ecb04
2015-04-16 18:11:50 +00:00
drh
a276e3fd4d Fix a faulty assert() in the compound-SELECT code generator.
FossilOrigin-Name: 10715b05f2201a63dca317f99ce39d3ce182e182
2015-04-16 16:22:27 +00:00
drh
59ac655d02 Silently ignore requests to change the PRAGMA synchronous setting to an
illegal integer value, rather than raising an assertion.

FossilOrigin-Name: e0a88176fcfbed7b554a036948261a332c920053
2015-04-16 16:04:39 +00:00
drh
e06874eaa1 Make sure errors in coding triggers are propagated back up to the parser.
FossilOrigin-Name: 928f973ca9adc7933015b2fb6b6fcb8e3154cb9c
2015-04-16 15:47:06 +00:00
drh
772460fd4c Improvements to the way VALUES clauses are parsed.
FossilOrigin-Name: ec5a493ad27593ca78899b3001630c1898b940ff
2015-04-16 14:13:12 +00:00
drh
b073771cdf Fix the corruptC.test module due to a change in error message text.
FossilOrigin-Name: 7c0deed25762a954c78d98412d8f4a265a437d06
2015-04-16 12:12:07 +00:00
dan
0d2e2f2b10 Fix a problem in test file e_reindex.test.
FossilOrigin-Name: 5b3de9390f2ffc4c530fd47c71c70e87972cf74b
2015-04-16 08:54:01 +00:00
dan
5b1c07e7fb Ensure the sqlite3Select() routine always returns non-zero if an error has occurred.
FossilOrigin-Name: b51028ed2f57f4245a7ebd9bdb99d1bcfaf1a01b
2015-04-16 07:19:23 +00:00
mistachkin
3693a094b2 Merge updates from trunk.
FossilOrigin-Name: 22827542a5c7aeac4385ba647f45bd500e787fe6
2015-04-16 04:20:10 +00:00
drh
22ecef5c20 When parsing the schema, ignore any SQL that does not begin with "CREATE".
FossilOrigin-Name: d3c00d61581c8ba6dce5618391432d3af8d324d4
2015-04-16 00:26:03 +00:00
drh
a9de561b21 Add the --msvc command-line option to the releasetest.tcl script. This is
only a partial merge from the winTest branch as the OS_TRACE changes are
omitted.

FossilOrigin-Name: b8768f124ef7d79e500b60a3ede288d46a0f529d
2015-04-15 14:52:05 +00:00
drh
fdb031891c Merge all recent trunk enhancements and fixes into the ota-update branch.
FossilOrigin-Name: 9bd3e4453d4ad416f7e3f08f0bd283d34f1c319c
2015-04-15 14:26:04 +00:00
dan
0d01ec8de8 Remove an incorrect assert() statement from sqlite3Fts3Dequote().
FossilOrigin-Name: bd06eeb8d06237dc2d54d8a03e8bf525cb811c9e
2015-04-15 09:16:39 +00:00
dan
2deb12be2b Fix a problem causing an assert() to fail if a snippet containing 0 tokens was requested from fts3.
FossilOrigin-Name: eafd0a1e3f25f38d551603f177ff4634cf79de77
2015-04-15 08:20:50 +00:00
drh
29031837c1 Remove an incorrect ALWAYS() from the automatic index generator.
FossilOrigin-Name: eeb4bd06bf69e411736cc6077d1d64af6bd8fb09
2015-04-15 07:34:25 +00:00
drh
1b6789697d Remove an incorrect ALWAYS() from the table_info pragma.
FossilOrigin-Name: 0e087c0183bc7a758cf2a1d39158bc24fde833a2
2015-04-15 07:19:27 +00:00
drh
3dc4cc66b3 Change the multiSelectOrderBy() routine to return non-zero if there has
been any prior error.

FossilOrigin-Name: 14784c317bff05dd0a74e2596432dfd12c139391
2015-04-15 07:10:25 +00:00
drh
a43f02efc6 Fix a faulty assert() statement in the name resolver associated with the
optimization that converts compound selects with ORDER BY COLLATE into
subqueries.

FossilOrigin-Name: c72324ef9243946550ae3d974826502b1cc5eb10
2015-04-15 06:45:13 +00:00
drh
6456b7710c Correctly handle COLLATE operators applied to COLLATE operators in an
ORDER BY clause.

FossilOrigin-Name: 9e1f837b08facbc7a2b6196770599a58233e725c
2015-04-15 05:57:50 +00:00
drh
3457338ced Fix a faulty assert() in the sqlite3StrAccumAppend() routine.
FossilOrigin-Name: 998cfdb8dcda2cac94b83326751e16dcef8b267f
2015-04-15 05:38:35 +00:00
drh
65df68e8c5 Correctly deal with an unknown collating sequence on an indexed DISTINCT query.
FossilOrigin-Name: a0b6e2fed3e95cf78ed0515c6e4da7510af4e86a
2015-04-15 05:31:02 +00:00
drh
1978d171cb When adding the implied "LIMIT 1" to the end of a scalar subquery, make sure
that subquery is not a VALUES-only query as such queries cannot deal with
LIMIT clauses.

FossilOrigin-Name: 7c27310bdf6b4af44a0811a2787ed64966d720d2
2015-04-15 05:20:44 +00:00
drh
0ec68f845c When doing the (dubious) conversion of double-quoted identifier into string
literal for MySQL compatibility, be sure to also clear the iTable value from
the Expr entry to avoid an assert.

FossilOrigin-Name: d7211b68107ea669de39e0aa81a1be40901e1487
2015-04-15 04:51:28 +00:00
drh
311efc70a7 Add a test case for what was formerly thought to be an unreachable condition:
when the LHS of an OR operator contains an error and the RHS contains an IN
operator.

FossilOrigin-Name: 3872742591add4e94033484c2844e7d7ab69674b
2015-04-15 04:20:58 +00:00
drh
126a6e260c An oversize hex literal can cause a parsing error while generating code for
constants that are factored out of the main body of the VDBE program.  So
allow for that case.

FossilOrigin-Name: a084690b4fcabba20d9770ebf3a014dda84e2954
2015-04-15 04:10:50 +00:00
dan
481ecd95d0 Test that if the definition of a collation sequence is changed and VACUUM run, the new database contains records sorted in the (new) correct order.
FossilOrigin-Name: ce6eaac10a190b26b87bfe75918e2ef58fd7a3f9
2015-04-13 14:08:27 +00:00
drh
f932f7145e Fix a problem with a stale Select.pWith pointer when a CTE is used together
with a compound query and an ORDER BY clause.

FossilOrigin-Name: 9a453f52a2b30595891604ede7d4acf61c2736a1
2015-04-12 17:35:27 +00:00
drh
11b0481778 Avoid problems when a query has a GROUP BY and an ORDER BY but no FROM clause.
FossilOrigin-Name: e527d96a1e098ade4e9d124b630a8c2ea2ac9b36
2015-04-12 01:22:04 +00:00
dan
96974bd393 Fix a problem with sorting large amounts of partially ordered data.
FossilOrigin-Name: acca97efda86a0c020854d2dd9da16f5879986b1
2015-04-11 20:20:29 +00:00
dan
8aad8c482c Update tests in whereD.test to account for the change in the previous commit.
FossilOrigin-Name: da49700ca148d91e1b8863c2eb6ee79144e83ac9
2015-04-11 11:53:39 +00:00
dan
2813bde028 Do not assume an index contains unique entries unless it is declared UNIQUE and NOT NULL is specified for all columns. Fix for [7b4fee9f6c].
FossilOrigin-Name: e3b1f625518edc0e925116668dca5d25c3232b59
2015-04-11 11:44:27 +00:00
drh
4a33507f60 Detect and report oversized records constructed from multiple zeroblobs.
FossilOrigin-Name: 9e139afd92116ebc593114ed63b57c8f469653f6
2015-04-11 02:08:48 +00:00
drh
e918aaba98 Fix foreign key CASCADE for cases where the parent key is an INTEGER PRIMARY
KEY and the parent table contains other columns named "rowid", "_rowid_",
and "oid".

FossilOrigin-Name: ed3cbaab6ad49b0cb5b17e44def26c866919387a
2015-04-10 12:04:57 +00:00
dan
75395ccd17 Do not allow virtual table constructors to be called recursively.
FossilOrigin-Name: 0a72726da21581ab16cb3e964bd825b8f2e931e4
2015-04-10 07:55:07 +00:00
drh
57d0d9f33c Merge all changes for version 3.8.9 into the ota-update branch.
FossilOrigin-Name: ec9d907a57fcea72c8a64e521e8a1b5777d67568
2015-04-08 14:01:07 +00:00
mistachkin
d4411941e2 Merge updates from trunk.
FossilOrigin-Name: c458db41bbb6bd13d47531685e25a09f512c7f5f
2015-04-07 21:18:17 +00:00
mistachkin
cc445402c9 Correct typo in new test numbering.
FossilOrigin-Name: d176c9fa4c65ff2f3952dd3dee46da149dfa442f
2015-04-07 21:17:53 +00:00
mistachkin
151c75ad89 Enhance the shell export to support emitting column names in 'insert' mode when headers are enabled.
FossilOrigin-Name: 6e504cd00b148b5acca73f039a20b8acc85dc2f0
2015-04-07 21:16:40 +00:00
drh
b6f47deb0c Avoid signed integer overflow when converting oversized in-line integer
widths and precisions in printf().

FossilOrigin-Name: 8e4ac2ce24415926247961b00a62425ae85d6ffb
2015-04-07 15:39:29 +00:00
dan
8c069147ce Another change to avoid a problem caused by integer overflow in the printf() code.
FossilOrigin-Name: 95625ef3adc3c408d67e70f877f390445fbb8292
2015-04-07 14:38:57 +00:00
drh
a30d22a7a6 Further changes to guard against integer overflow in the width and precision
of printf() arguments.

FossilOrigin-Name: 5ce4e7d7651e5c72a59f03f7aeb366291e62ab57
2015-04-07 13:28:41 +00:00
drh
74b42275ec Guard against excessive width and precision in floating-point conversions
in the printf routines.

FossilOrigin-Name: c494171f77dc2e5e04cb6d865e688448f04e5920
2015-04-07 12:41:17 +00:00
dan
e3cdbad274 Fix a problem with fts3 prefix terms within phrase queries on "order=DESC" tables with a mix of negative and positive rowids.
FossilOrigin-Name: 3ad829e50faca538db3abb2afb898b5521550c5c
2015-04-06 11:04:51 +00:00
dan
4b0000c9a8 Fix a problem with fts3 prefix terms within phrase queries on "order=DESC" tables with a mix of negative and positive rowids.
FossilOrigin-Name: 0cdf502885ea7e5805d7ba3719f055f5d48fc78d
2015-04-06 09:05:29 +00:00
dan
b33c50f215 Fix a problem with resolving ORDER BY clauses that feature COLLATE clauses attached to compound SELECT statements.
FossilOrigin-Name: 427b50fba7362e5b447e79d39050f25ed2ef10af
2015-04-04 16:43:16 +00:00
mistachkin
00eb70d89c Enhance the 'releasetest.tcl' tool to support MSVC.
FossilOrigin-Name: f664bfdc82597a4530d4f4938bb96557b43b171b
2015-04-04 00:02:07 +00:00
drh
62ca61ee61 Disable the SQLITE_FCNTL_WAL_BLOCK feature for now. It needs more work and
is not yet ready for release.

FossilOrigin-Name: 4ae9a3acc4eeeb7998769eb856c97c2233476f72
2015-04-03 20:33:33 +00:00
dan
5f1731f670 Disable e_walauto.test on OpenBSD, as it requires a coherent cache.
FossilOrigin-Name: 90701227085b8b8eb10a8eebe8d55f38b4778574
2015-04-02 15:24:53 +00:00
drh
6b5f0ebe97 Handle very large URI pathnames for in-memory shared-cache databases.
FossilOrigin-Name: 586a94e85bc13700a2093734711c1367fa814b8c
2015-03-31 16:33:08 +00:00
drh
96e285692a Fix the corruptJ.test case so that it works with and without
SQLITE_SECURE_DELETE.

FossilOrigin-Name: 0c0ecfd68573957553b966229a67bfcd10ce4b99
2015-03-31 14:31:41 +00:00
drh
116f0be024 Prevent a possible infinite loop when trying to DROP a table from
a corrupt database.

FossilOrigin-Name: 395bb3e677a6551b06ba96fc58c393132b93d1e8
2015-03-30 23:43:56 +00:00
mistachkin
56d89cbee3 Revise Win32 locking test to account for recent log message changes.
FossilOrigin-Name: 1bc76339e8542770bff7829a3dd346680950c0a5
2015-03-26 18:24:26 +00:00
drh
d2f83139f3 Fix the saveCursorPosition() routine in btree.c so that it works
correctly for a eState=CURSOR_SKIPNEXT cursor.

FossilOrigin-Name: 37866b4d483296ab9b7fcb9f5486695d4c2b8ddd
2015-03-25 17:35:01 +00:00
dan
32c9068adb Extend [52e73eec] so that the IS optimization may be used on primary keys with more than 3 columns.
FossilOrigin-Name: 4e8796af7d40d6ca423e07c68877035e4aa2485c
2015-03-25 15:23:00 +00:00
dan
6da7a0a93d Merge the latest trunk changes into this branch.
FossilOrigin-Name: 9d9b6c883b4f7d69c615cedfb59a2385aac47b74
2015-03-24 18:21:41 +00:00
dan
428630cfcf Add tests to check that attempting to DROP a virtual table while it is use does not cause problems.
FossilOrigin-Name: 5ee625b1980f9fab6294d308349dfd9ba960b60b
2015-03-24 14:57:21 +00:00
drh
74893a4cdb Fix a potential NULL pointer dereference following a syntax error.
FossilOrigin-Name: 8d27e3e16a9be79fe227e833f4770ebe09a9d90b
2015-03-22 10:23:17 +00:00
dan
e10d87f65a Avoid a segfault if NULL is passed as the first argument to SQL scalar function fts3_tokenizer().
FossilOrigin-Name: 6d0989695b486275824c14d5f88357267c1e8104
2015-03-21 19:35:09 +00:00
dan
d2f99333cf Change walblock.test to block an external process for 10 seconds, not 5. 5 seconds is not long enough to tell the difference between a blocking lock and a series of retries.
FossilOrigin-Name: 717335fcdb15430ed977cbc98d30345b71728b66
2015-03-21 16:40:24 +00:00
dan
71138b0f0f Merge trunk changes with this branch.
FossilOrigin-Name: 142743918fd5a6d79fa10c44398360c3684a255a
2015-03-21 15:45:24 +00:00
dan
998aaa03ea Avoid an integer overflow in fts3 causing gcc 4.7.1 with -O2 to behave counter-intuitively (perhaps because the behaviour is undefined). Add an "ifcapable trace" to a test in shell4.test.
FossilOrigin-Name: e3e234649616f20610abce9ae9da1c572d3a4377
2015-03-21 12:22:51 +00:00
dan
e56f53ef7c Add a missing "ifcapable fts3" to a test case in vtab2.test.
FossilOrigin-Name: d845b0f69093178517d66e1fc5060e8f62c681c7
2015-03-21 10:53:01 +00:00
drh
8f9d0b2b25 Correctly detect the error of having a "*" wildcard on a SELECT without
a FROM clause on the left-hand side of a recursive CTE.

FossilOrigin-Name: b11d1793a06a44931edcbf12a615b49794d53a62
2015-03-21 03:18:22 +00:00
drh
f063685079 If a column is both UNIQUE and a PRIMARY KEY, make sure the PRIMARY KEY
designation takes precedence.

FossilOrigin-Name: d871a7921722bb0fef6d51e1110a9703ddff78c8
2015-03-21 02:58:20 +00:00
mistachkin
48cc29a9ac Merge updates from trunk.
FossilOrigin-Name: 441a00e70d8c0a3d09b7f283a65a2918791ad1bb
2015-03-21 02:34:17 +00:00
dan
80103fc614 Fix a problem causing collation sequence names to be dequoted multiple times under some circumstances.
FossilOrigin-Name: eddc05e7bb31fae74daa86e0504a3478b99fa0f2
2015-03-20 08:43:59 +00:00
dan
7377945a7b Fix a problem with creating virtual table with names specified using malformed utf-8 within utf-16 databases.
FossilOrigin-Name: 9969cff2d0553c9bfa88a437e1bb0cc4200d49d7
2015-03-19 18:56:17 +00:00
dan
b7134d0863 Fix an FTS3/4 problem with handling empty tokenizer declarations (e.g. "CREATE VIRTUAL TABLE t(tokenize=);").
FossilOrigin-Name: 26d2def8a53094356008861636d66f9ae8f2448a
2015-03-19 16:25:42 +00:00
dan
e0417626ea Silently ignore any attempt to add a prefix index for prefixes zero bytes in size to an fts3/4 table. Or any prefix index size so large that it overflows a 32-bit signed integer.
FossilOrigin-Name: ad4b19d2ac0889a23fe3b0fd844286efc10cdd82
2015-03-19 15:52:07 +00:00
mistachkin
398f109dfb Merge updates from trunk.
FossilOrigin-Name: 3e363f405655e2e39588029d797496a952cca11d
2015-03-19 14:46:52 +00:00
drh
657b4a87e5 Fix a bug in error handling in the ".trace" command of the command-line shell.
FossilOrigin-Name: 6a48b5d794e891fdd167547c76835d677eb5e31d
2015-03-19 13:30:41 +00:00
dan
c3b328da6e Allow whereShortCut() to use the PRIMARY KEY index of a WITHOUT ROWID table to optimize a vector of "IS" operators in a WHERE clause.
FossilOrigin-Name: 52e73eeca063bb30092ce600068bf487641399a0
2015-03-18 20:03:27 +00:00
drh
5572f7e42e Also merge the WAL blocking lock tests that were somehow missed on the
previous check-in.

FossilOrigin-Name: 7214dab7443d35c105904dd69635c1f8b45b2fc8
2015-03-17 17:08:35 +00:00
dan
363fc9e724 Add a test for the change on this branch.
FossilOrigin-Name: e22dde187eb0b389d6d93e2e39a26fd0f4e6196e
2015-03-17 16:01:29 +00:00
mistachkin
05b6048dbd Fix typo of test prefix in the new WHERE test file.
FossilOrigin-Name: 34779c528f1817d6ec34216b58fb4277956b5167
2015-03-16 18:08:56 +00:00
drh
29894b6d2b When the WHERE clause contains two OR-connected terms with identical
operands but different operators, try to combine them into a single term.
Example:  (X=A OR X>A) becomes (X>=A).

FossilOrigin-Name: 8bdda827a3d268009297a0216e3d94bf0eceeb2e
2015-03-16 17:48:12 +00:00
drh
07b38959a4 Modify the fts3query.test script so that it works even when testfixture is
built using a version of TCL that is unable to sort the
integer -9223372036854775808

FossilOrigin-Name: f61fd24b4d3b686911ea578f77612309099f0cc6
2015-03-16 17:07:09 +00:00
drh
8426636cdc When a WHERE clause contains disjuncts with the same operands, try to
combine them into a single operator.  Example:  (x=A OR x>A) becomes
(x>=A).

FossilOrigin-Name: 7a3097689d17625fb0dfc4372712f375f3bdb9a1
2015-03-16 12:13:31 +00:00
dan
a0d56aef18 Another test case for the planner change on this branch.
FossilOrigin-Name: f2207a0691ed361061719f4dacf021a677a9d892
2015-03-16 09:21:30 +00:00
dan
a3d0c13654 When estimating the number of rows visited by a range scan for which the keys consist of more than one field, consider prefixes of stat4 samples as well as the full samples.
FossilOrigin-Name: e1caf93c9ad0ee15d42030af95619f212d3fcf9d
2015-03-14 18:59:58 +00:00