Commit Graph

4990 Commits

Author SHA1 Message Date
drh
bb53ecb1db Enhancements to the code generator for the IN operator that result in much
faster queries in some cases, for example when the RHS of the IN operator
changes for each row of a large table scan.

FossilOrigin-Name: 436e884215e2b33ca3fbb555362237b12827c07a
2014-08-02 21:03:33 +00:00
drh
cefc87fca5 Enhance the PRAGMA integrity_check command to detect UNIQUE and NOT NULL
constraint violations.

FossilOrigin-Name: 9abcf2698c09f4f6a44a68e74f9f6b538f3253d6
2014-08-01 01:40:33 +00:00
dan
f6296cafc5 Add a missing call to "test_sqlite3_log" to multiplex.test.
FossilOrigin-Name: 0708f9df23a325349f658741358c5994b5c4c873
2014-07-31 18:14:37 +00:00
dan
e8559837e6 Fix a leaked statement handle in pager2.test.
FossilOrigin-Name: 47457b0488abcbec2137abf706c1d677563b9ea5
2014-07-31 17:35:40 +00:00
drh
a1a8298c2e Add the "eForce" parameter to the sqlite3_multiplex_shutdown() entry point
in test_multiplex.c.  Shutdown is forced if true.  Shutdown is not done if
there are pending database connections and eForce is false, but an error log
entry is made instead.

FossilOrigin-Name: c7303d0139f7e7f4fa7060b52942e6c6c6d4b622
2014-07-30 15:43:05 +00:00
drh
bd1c881a91 Merge recent trunk changes, and especially the fix for the CREATE UNIQUE INDEX
problem of ticket [9a6daf340df99ba9].

FossilOrigin-Name: 5b50a8380b2b678c1646ff303e3696efc1d7d92c
2014-07-30 14:44:24 +00:00
drh
ac50232d0f Ensure that the correct number of columns in a UNIQUE index are checked for
uniqueness, regardless of whether or not the original table has a ROWID or
if the columns are NOT NULL, etc.  Ticket [9a6daf340df99ba93c].

FossilOrigin-Name: 6b785e92f279cb65746834d5cd25594fd3333342
2014-07-30 13:56:48 +00:00
drh
2bd2c29a95 Merge all recent trunk changes into the threads branch.
FossilOrigin-Name: 770685892c8f09b9cddb2fbb2877cfb291e19425
2014-07-24 16:54:28 +00:00
drh
c4747f2314 Add support for hexadecimal integer literals in the parser.
FossilOrigin-Name: f8f79f28785db716b10c3bc9d6652b98253fd125
2014-07-24 12:19:41 +00:00
drh
6976c2123b In the command-line shell, in CSV output mode, terminate rows with CRNL but
do not expand NL characters in data into CRNL.  Provide the extra -newline
command-line option and the extra argument to .separator to designate an
alternative newline character sequence for CSV output.

FossilOrigin-Name: 16c8ce10e1530731441e6c4538691b71564684ed
2014-07-24 12:09:47 +00:00
mistachkin
3b9fab1cb9 Enhancements to the hex literal tests.
FossilOrigin-Name: a3cc027fa7ca41da23ecd0770a075a48416af020
2014-07-23 19:04:25 +00:00
drh
9296c18a50 Change the hex literal processing so that only the SQL parser understands
hex literals.  Casting and coercing string literals into numeric values does
not understand hexadecimal integers.  This preserves backwards compatibility.
Also:  Throw an error on any hex literal that is too big to fit into 64 bits.

FossilOrigin-Name: 6c6f0de59bf96b79c8ace8c9bfe48c7a6a306a50
2014-07-23 13:40:49 +00:00
drh
5ec659cfcb Casting hex literals directly from string to float always results in a
positive number.

FossilOrigin-Name: 4b86ccdf4f4eb4339a5706e10ad24f01b6c3939e
2014-07-23 02:07:11 +00:00
drh
d35588dc21 Reformatting a few test cases for clarity.
FossilOrigin-Name: 7e1bbacb11a4689b69856450125cae3d045307af
2014-07-23 01:59:47 +00:00
drh
fce4da1b73 Test cases for hex literals.
FossilOrigin-Name: 19054339c47448bcdfd1f7be35daa3826c409077
2014-07-23 01:56:32 +00:00
drh
a45fdc7b1e The optimization of check-in [b67a6e33f2] does not work (it generates
incorrect VDBE code) if an OR term is AND-ed with a constant expression.
So back that optimization out and add a test case to make sure it does not
get added back in.

FossilOrigin-Name: eed754fe93644f4df082eac0c0a7ffc5c78ccd10
2014-07-22 19:14:42 +00:00
drh
25df48d967 Enhance the sqlite_stat1.stat parsing to allow additional text parameters
at the end.  Unrecognized parameters are silently ignored.

FossilOrigin-Name: ca2a5a2c770fa94cd8db1b1b241ede058a7c58e2
2014-07-22 14:58:12 +00:00
drh
358406fc57 Expire prepared statements after running ANALYZE.
FossilOrigin-Name: b083a961f8ac3a6158e822574d73cd63e3103b09
2014-07-22 14:42:16 +00:00
dan
857745c089 Update the sqlite3_stmt_busy() function so that it correctly returns true for "ROLLBACK" statements that have been stepped but not yet reset.
FossilOrigin-Name: 61cee3c0678f5abd9131a29ab946a5e71f55643e
2014-07-19 17:57:10 +00:00
drh
71607c77c8 SQLite has long accepted some unadvertised and non-standard join syntax.
Add a test to ensure that future versions continue to accept this non-standard
syntax, to avoid breaking legacy applications that use the undefined syntax.

FossilOrigin-Name: 824dde7fc48dbca6d6c956c4eb79bbfa2d139ee5
2014-07-18 17:39:48 +00:00
dan
43fbe5e2c9 Add another test to verify that SQLite is using stat4 data for composite primary keys on WITHOUT ROWID tables.
FossilOrigin-Name: 0df1fe72f8271abc86cd552027d938c910f90967
2014-07-01 15:22:11 +00:00
dan
39caccf83d Ensure that all fields are loaded from the stat4 table for records that correspond to indexes on WITHOUT ROWID tables with composite primary keys.
FossilOrigin-Name: 21981e35062cc6b30e9576786cbf55265a7a4d41
2014-07-01 11:54:02 +00:00
drh
6614181610 Merge the latest trunk changes into the threads branch.
FossilOrigin-Name: ae23a65eb1547fbe8b86ab71477071990a22d31d
2014-06-30 20:25:03 +00:00
drh
855f63908f Attempt to use STAT4 information to estimate the selectivity of WHERE clause
terms when using the skip-scan optimization.

FossilOrigin-Name: d09ca6d5efad3e4cfa93a4dc711e6ba6079d4b4b
2014-06-30 19:07:58 +00:00
dan
fd984b8114 Fix a problem in where.c with using the stat4 sample data of an index on a WITHOUT ROWID table.
FossilOrigin-Name: 053a210e3169732c58f84cb54c9b6f6df3a8f4ea
2014-06-30 18:02:20 +00:00
dan
39129ce8d9 Fix where.c so that the primary key values appended to every index entry on a WITHOUT ROWID table may be used when useful.
FossilOrigin-Name: 6624a61d16e47ad691c4195ca8a1d68b7348118d
2014-06-30 15:23:57 +00:00
dan
6696ba3eab Add an OOM fault injection test for the new code on this branch.
FossilOrigin-Name: c96de490ac77dd23c108004b95152cce4922fe27
2014-06-28 19:06:49 +00:00
dan
8e9028d0f8 Add further tests to skipscan5.test.
FossilOrigin-Name: 4b8230e8fe93e73a615a46708aed5fa3557b6228
2014-06-28 17:35:15 +00:00
dan
fa8874542c Fix a problem with using stat4 samples of type text when estimating the rows visited by a range-query/skip-scan loop.
FossilOrigin-Name: dfb09db6d412f3bc2a71bda393813783580dbad1
2014-06-28 15:26:10 +00:00
dan
4364dc5ea6 Merge fixes from trunk with this branch.
FossilOrigin-Name: 6af219d1b83ec54b3fb4ad4e6216d9ad9ea0fc70
2014-06-28 14:25:32 +00:00
dan
4e42ba4a35 Fix a couple of problems in estimating the number of rows visited by a range query that uses a skip-scan.
FossilOrigin-Name: 219736f54dcd1448af3400e699f1c20755ac6876
2014-06-27 20:14:25 +00:00
mistachkin
5d24951865 Add some more IN operator tests.
FossilOrigin-Name: fb32e374b75b160e7b535e732ced6c34dbb513eb
2014-06-26 22:17:21 +00:00
mistachkin
9bec6fb3ef Revise the affinity returned for expressions flagged as 'generic'. Fix for [9a8b09f8e6].
FossilOrigin-Name: 92f7ad43dbfe4e02490df2f932c3c74fb89064d6
2014-06-26 21:28:21 +00:00
drh
5dfcfe7dc0 Merge in all recent changes from trunk, and especially the automatic index
enhancements.

FossilOrigin-Name: 0e1b73496f861bd497f92f1ead936b2d94aa52d5
2014-06-18 15:18:12 +00:00
drh
f9944b5053 Prevent an automatic index from taking the place of a declared index.
FossilOrigin-Name: 0a52bddd9db49b2b79fc24888b50023d0fe74f7b
2014-06-18 15:11:54 +00:00
drh
dabe36d9dd Prevent an automatic index from taking the place of a declared index.
FossilOrigin-Name: 4ece839d445ff578a449a339ab579a32e64c9d28
2014-06-17 20:16:43 +00:00
drh
03202a97f8 Add the likely() function for symmetry with unlikely(). The likely(X)
function means the same thing as likelihood(X,0.9375).

FossilOrigin-Name: 38965484199153e3e5b999f5196c1d66e5296f60
2014-06-17 16:11:28 +00:00
drh
2daa64cd63 Add the autoindex2.test testing module.
FossilOrigin-Name: ffe3fea47b8ba8ec4557f68243ef3ef5aac00dfd
2014-06-17 13:23:36 +00:00
drh
6b7ff748a1 Allow an automatic index on a WHERE constraint where the RHS is does not
reference another table as long as the RHS is not a constant.

FossilOrigin-Name: 58acc2a8b38c5f13175c191697b4d2b663db1872
2014-06-17 09:00:54 +00:00
mistachkin
6fe0338ca9 Fix CSV import issue, reported via the mailing list, in the shell when the file to be imported ends with an empty line.
FossilOrigin-Name: fc918f7d332b8f7cabc79a0f1586bd6760d14d40
2014-06-16 22:45:28 +00:00
drh
a2412c1613 Fix the extension01.test script so that it works on windows. Fix a
harmless compiler warning in the fileio extension.

FossilOrigin-Name: baf95a190907d05a847ae8b6a3dd60625c2a078a
2014-06-16 12:51:56 +00:00
drh
51ed298364 Add test cases for the fileio extension.
FossilOrigin-Name: 8634333127c4d868d3ec27e88b5818f6479774f3
2014-06-16 12:44:32 +00:00
drh
69e9782f23 Add a test case to ensure that estLog() works for negative numbers.
FossilOrigin-Name: 813469d98519b609669a004b7b604af78ef40c02
2014-06-06 20:49:19 +00:00
drh
33ca481923 Bring the threads branch up-to-date with the 3.8.5 release.
FossilOrigin-Name: e4b01676d7e7ac14f5120ca3a618cc34dbf5dab2
2014-06-05 13:22:52 +00:00
dan
33b7bcb319 Fix a problem that was causing the FTS4 integrity-check command to fail if the table had one or more "notindexed" columns.
FossilOrigin-Name: 7123bb2605216396f65db5d156431b3613f313b5
2014-06-05 11:15:56 +00:00
drh
d0dc5d4984 Avoid closing a pseudo-table associated with sorting in a co-routine since
that pseudo-table might be used again in an outer loop.

FossilOrigin-Name: 6d81805298ea882f5fee99504d5a95f1a762a90b
2014-06-03 14:42:34 +00:00
dan
5a0b8b124b Add a test to double-check that [1cbe7a0883] did not affect anything.
FossilOrigin-Name: c6b512a724aebcd084aad2a80d020b95773b3012
2014-06-03 11:32:38 +00:00
drh
974db61d9d Fix a typo in a requirements mark comment in a test script. No changes to
code.

FossilOrigin-Name: 75ff459b06e1a5c180d316d227ce2f73c99a1f52
2014-06-02 18:24:55 +00:00
drh
2504c6c632 Fix the query planner so that it once again knows that queries without a
FROM clause will never return more than one row and hence do not require
sorting.

FossilOrigin-Name: 9f18b303cd1bc5779d82669884f802c7889b4947
2014-06-02 11:26:33 +00:00
dan
5f43812af8 Add the "valgrind-nolookaside" permutation to permutations.test.
FossilOrigin-Name: 8e8472d9b689d128eb11d3111e009161cf4580f7
2014-06-02 09:39:24 +00:00
mistachkin
110e0ebe6d Revise locking retry semantics in Win32 VFS to abort early if the file handle is reported as invalid.
FossilOrigin-Name: a4df4a5b34111f755ffd9ee6f089ff05d03ebc7a
2014-05-30 21:01:41 +00:00
mistachkin
ff9fcd5a14 Add extra checking of the database extended error code.
FossilOrigin-Name: f2906c44519d76db5bc36013369ae498b80655a8
2014-05-30 16:54:09 +00:00
mistachkin
6b98d67b2b Add tests for the invalid file handle detection logic in the winLock() function.
FossilOrigin-Name: ed5a9eb4f30a395bc641e79254217c7d7cf0aa5d
2014-05-30 16:42:35 +00:00
drh
ff14013496 Merge changes from the trunk into the threads branch.
FossilOrigin-Name: 416cb091267de91b9cadee9f7453b8627570b7d3
2014-05-29 20:24:20 +00:00
drh
c2ce0bea88 Improvements to error messages for errors in the dot-commands of the
command-line shell.  Add the ".once" command.  The output of ".help"
now goes to the designated output channel.

FossilOrigin-Name: 48dce821a07ac29da6ce05e92cf3f6e52b6eb388
2014-05-29 12:36:14 +00:00
dan
3b21f6d62d Add an extra test to verify that the FTS notindexed option is working.
FossilOrigin-Name: c461c0fe051d33cc8b4fede4eca13cd71f28126a
2014-05-28 10:00:38 +00:00
dan
c2070c7d96 Add a test to whereI.test that uses a multi-column PK.
FossilOrigin-Name: aa183e60929bdbbcea3c436dd8cc674fc44ad09a
2014-05-27 11:42:23 +00:00
drh
79045882c9 Merge recent trunk changes into the threads branch.
FossilOrigin-Name: 8215202759dbd863edf20aa26ff21da20bc35d73
2014-05-26 20:15:21 +00:00
dan
f97dad8849 Enable the OR optimization for WITHOUT ROWID tables. Use a temp table instead of the RowSet object to track the rows that have already been included in the result set.
FossilOrigin-Name: 2c7e277bbebd5c93dec53d381d9737909d40d846
2014-05-26 20:06:45 +00:00
dan
6a8ac852aa Fix a problem in the shell when importing CSV files. If the leftmost field of the first row in the CSV file was both zero bytes in size and unquoted, no data was imported.
FossilOrigin-Name: 856d44a206d82e96265103556dedda39ca3602b1
2014-05-26 18:27:12 +00:00
dan
cde81d5fd0 Fix a problem in FTS4 where columns with names that are prefixes of any notindexed column were also being (incorrectly) marked as not indexed. For example in "CREATE ... t1(abc, bc, abcd, notindexed=abcd)", both abc and abcd were being treated as notindexed.
FossilOrigin-Name: d90c4964fcf46b0b043dbfd58267098582267001
2014-05-26 16:40:02 +00:00
dan
e96f2df3dd Changes to the output of EXPLAIN QUERY PLAN to make it clearer when a query uses the PRIMARY KEY index of a WITHOUT ROWID table.
FossilOrigin-Name: 9268df305b90ac11e44b3107bbab5becf38860b7
2014-05-23 17:17:06 +00:00
drh
e48ae7157a Make sure sufficient VDBE registers are allocated for an INSERT...SELECT
when there is an idlist on the insert table that includes an explicit
rowid.  Ticket [9654505cfda93610585fde5a9bbf2e730c8a8d5]

FossilOrigin-Name: 9a2dd18776cc7003752980be0a0920a8799e5f35
2014-05-23 11:48:57 +00:00
dan
6044f31d13 Add a test for the EQP output of a skip-scan query that uses the PK index of a WITHOUT ROWID table.
FossilOrigin-Name: 10238fad94a198c0639461645227b6c5ebe16eee
2014-05-22 09:58:45 +00:00
drh
781597feca Fix the sqlite3_db_readonly() API so that it reports true if the database
is readonly because the file format write version (byte 18 of the header)
is too large.

FossilOrigin-Name: 8d8af114dac301335ec10671c1e9a5a6d8266a60
2014-05-21 08:21:07 +00:00
drh
db2f91907d Merge recent changes from trunk.
FossilOrigin-Name: 6eefdad946da6a5f4052ac51d327777890fa3f18
2014-05-19 23:17:33 +00:00
dan
83e05b814e Fix a broken test case in fts4growth2.test.
FossilOrigin-Name: 9fde5b960af39b187474e5b2909ff0e56d5e0bf9
2014-05-17 15:10:37 +00:00
dan
4bd855fae5 Fixes to prevent an FTS index from growing indefinitely as the corresponding table is updated. Change the FTS 'automerge' option to allow the user to specify the number of segments that should be merged simultaneously by auto-merges.
FossilOrigin-Name: a75f1800021d30b712053373440041b7b355a36a
2014-05-16 16:16:59 +00:00
dan
e82384817d Add extra test to backcompat.test to ensure that old and new versions of FTS may work together on the same incremental merge operation.
FossilOrigin-Name: 3997d47bb9c8593a2cd30317ea65163b99db1832
2014-05-16 15:48:17 +00:00
drh
d25c69ef39 Merge all recent changes from trunk, and especially the new sqlite3FaultSim()
interface.

FossilOrigin-Name: 43fcbd9116401f30781fdcbe55d1674d6b96311b
2014-05-16 14:27:05 +00:00
drh
c007f61bb0 Repurpose the SQLITE_TESTCTRL_FAULT_INSTALL test-control to register a
callback to be invoked by sqlite3FaultSim().  That test-control has been
unused since 2008-06-20 and was never used in any official release.

FossilOrigin-Name: 0d43a7ad9abe821e33e0bf83a997aa4461b1e3f2
2014-05-16 14:17:01 +00:00
dan
a7b9e7d2d9 Fix a bug causing an incorrect segment size value to be stored if both an old and new FTS version performed work on the same incremental merge operation.
FossilOrigin-Name: a9a2aeab298ba2ac0b8835e61406e2d83bf7e39b
2014-05-16 10:30:44 +00:00
dan
5b34f15a82 Do not search for promotable segments following an FTS 'optimize' operation or creation of a new segment on the oldest existing level.
FossilOrigin-Name: 34f6b4b8e4cb8ea45fd518672dc96335d1ce06ab
2014-05-14 19:49:17 +00:00
dan
a0b7ca90b7 Fix a problem to do with loading the value of the FTS automerge setting from the database.
FossilOrigin-Name: 7268119f74602929b372b88eca7b3c3b4964f7d5
2014-05-14 18:45:27 +00:00
dan
9e83e465eb Fix various problems to do with segment promotion. Add test file fts4growth2.test, containing tests to check that the FTS index does not grow indefinitely as the table is updated.
FossilOrigin-Name: 21491a9bc686e63bec32f1a67103622f1160a2f9
2014-05-14 15:58:47 +00:00
dan
c0caea21de Fix a problem preventing delete markers from ever being removed from the FTS index.
FossilOrigin-Name: 7f47ae5c5ddb1227484ddae7c6960183932a052a
2014-05-13 20:11:37 +00:00
dan
6bb9889ef0 Experimental code to prevent FTS indexes from growing indefinitely as the table is updated.
FossilOrigin-Name: b3b505a4dd0c679437a4272109f1188175088cd1
2014-05-12 20:04:48 +00:00
dan
ae289fccbf Merge the latest trunk changes into the threads branch.
FossilOrigin-Name: 9ac8f1e7115bc50663235adedeb0d3e1234c5740
2014-05-09 15:00:32 +00:00
dan
d2d8ca600e Fix the way parenthesis in MATCH expressions are handled by FTS if the tokenizer considers them to be token characters.
FossilOrigin-Name: e21bf7a2ade6373e94ea403c665f78e1ad22143f
2014-05-07 19:59:36 +00:00
drh
eacc050f30 Make sure the group_concat() function returns an empty string, not a NULL,
if it has at least one input row.  Fix for ticket [55746f9e65f8587].

FossilOrigin-Name: 0deac8737545a020d344be96fff16660a7977ab8
2014-05-07 17:19:31 +00:00
drh
731dc0cb0e Add the SQLITE_IOCAP_IMMUTABLE bit as a possible return value from
the xDeviceCharacteristics method in the VFS.  Add the "nolock" and
"immutable" query parameters to URI filenames.

FossilOrigin-Name: 1a0d7d3d9dd54b783e3a805961287dd01f94770c
2014-05-07 15:46:04 +00:00
drh
6451c2b04e Fix nolock and immutable so that they work even if READONLY is requested.
FossilOrigin-Name: e193aced2942e7405d0f45f90d4954b5663b4ba5
2014-05-07 15:32:03 +00:00
drh
62e603a904 Add test cases and documentation for the nolock and immutable query
parameters.

FossilOrigin-Name: 19d56cbaca222b32e2e354063149cccd89441d73
2014-05-07 15:09:24 +00:00
dan
5a7dbc70ea Add a little extra variety to the tests in sort4.test.
FossilOrigin-Name: 7de6aee6a5cb5c7f89dced89f2ebf38f8be7a4fa
2014-05-06 16:21:30 +00:00
dan
dfea45330e Re-implement the core of the multi-threaded sorter tests in sort4.test using C. Run each test in sort4.test ten times, or repeat all tests for 300 seconds as part of the "multithread" permutation test.
FossilOrigin-Name: 208b2b04d4d282bec4424ea7160a123ba549d118
2014-05-06 15:38:07 +00:00
dan
449cb9a5af Add test file sort4.test, containing brute force tests for the multi-theaded sorter.
FossilOrigin-Name: 9cc364c42cc64ab7b55b5c55e303fb63a456cf00
2014-05-05 20:03:50 +00:00
dan
d94d4ee7bd Add tests so that the "coverage-sorter" test permutation covers all branches in vdbesort.c. Fix a few minor problems in the same file.
FossilOrigin-Name: bde28b702dabd02269e333535cc41481351c5efc
2014-05-05 09:08:54 +00:00
dan
f7f425d600 Add an extra fault-injection test to sortfault.test. Remove an unreachable branch from vdbesort.c.
FossilOrigin-Name: a33a366ba8a0da81ddd895d552a348441ef8529a
2014-05-03 20:43:13 +00:00
dan
e18e90ebaf Fix a race condition in the sorter.
FossilOrigin-Name: 32ccf3ae18531682dfd039fa8df6ad9a907ac455
2014-05-03 19:33:00 +00:00
dan
0d51def29e Fix a problem in the sorter causing it to return spurious SQLITE_NOMEM errors when configured to use memsys3 or memsys5.
FossilOrigin-Name: 3a66c4e1bf311d38668dfcdcd77867feff6db7bd
2014-05-03 14:28:14 +00:00
dan
2ae56f50ce Merge orderby-planning with this branch.
FossilOrigin-Name: d9549de31741239ece060e448b592ce8fc5b8042
2014-05-02 18:05:38 +00:00
dan
a7bf23c6b5 Fix some broken asserts in btree.c and vdbeaux.c that may fail following an OOM error.
FossilOrigin-Name: e15f47064bef431c0afd8bf93eb4e160c23ad562
2014-05-02 17:12:41 +00:00
dan
a153643b07 Fix a broken test case in fuzz.test.
FossilOrigin-Name: faa469355eabb2c407f24638b090725448aac37f
2014-05-02 14:54:56 +00:00
drh
fb0d6e56d6 Merge latest trunk enhancements and fixes into the orderby-planning branch.
FossilOrigin-Name: 84862d3a095629d20c8e7b8a16f4dc26cd41ab6d
2014-05-02 13:09:06 +00:00
dan
3852413246 Fix an obscure problem to do with temp register allocation that could occur if more than one simple SELECT within a compound SELECT uses a partial sort.
FossilOrigin-Name: 427409ae106cdab7892a6b50fe30c5f52de5addc
2014-05-01 20:26:48 +00:00
dan
e03d76254c Update a test case in wal2.test that explicitly corrupts a checksum in the wal file to account for the fact that the first byte of said checksum may initially be 0xFF.
FossilOrigin-Name: 2b935bdea1452505f36dc8c7aad49e6c42f4eceb
2014-05-01 10:19:16 +00:00
dan
5da73e1a09 Fix a problem in calculating the costs of "OR" scans.
FossilOrigin-Name: 9bbca48b42e4fe16f2188e18dc736da30a96435c
2014-04-30 18:11:55 +00:00
dan
75525cbe24 Update a couple of test cases to account for the fact that this branch prefers an index scan and partial sort over a full-table scan and full external sort.
FossilOrigin-Name: 9b975bf33cd8fc28c64183a9642bf9fb436a4746
2014-04-30 14:53:21 +00:00
dan
264d2b97a9 Test that the default values used when sqlite_stat1 data is not available are calculated correctly. Fixes for the same.
FossilOrigin-Name: e2d42f909de85a0586389f2dc0e654f7af2e351a
2014-04-29 19:01:57 +00:00
dan
e4618fb30d Merge trunk changes into this branch.
FossilOrigin-Name: d74299f037f3a6a4b3bce8b4d1c76c407c1f3b3e
2014-04-29 16:46:24 +00:00
dan
09e1df6c00 Ignore likelihood() values on indexed IPK lookups.
FossilOrigin-Name: 5bb7757a7b32a74482d3e93e9c9eea02273fe981
2014-04-29 16:10:22 +00:00
dan
67a03cfd6e Fix a test case so that it updates sqlite_stat1 consistently.
FossilOrigin-Name: 2dc5a0b55567f13f0528ed17242e680cde2f2a29
2014-04-29 12:01:35 +00:00
dan
7de2a1faf6 Do not reduce the number of rows scanned at all for "IS NOT NULL" constraints. Fix a bug in calculating the number of rows visited by scans of partial indicies.
FossilOrigin-Name: a8ae93f0cffa116df0ba34d46a53f49d42dace41
2014-04-28 20:11:20 +00:00
drh
65e6b0dd12 Add the sqlite3_rtree_query_callback() API to the RTree virtual table.
(Cherrypick from the sessions branch.)

FossilOrigin-Name: af2cbe64adab5f9e3b0f3da00d06428088589d7f
2014-04-28 17:56:19 +00:00
dan
6b6828625b Update unordered.test to take into account for the fact that SQLite now prefers a full-table scan over a non-covering index scan that visits a large percentage of the table rows.
FossilOrigin-Name: 20f468dfbcb247e51446fad411a6e6cc0d130411
2014-04-28 15:11:25 +00:00
dan
9881d60d17 Add an extra column to a table in analyze9.test to give the planner a little more reason to select an index.
FossilOrigin-Name: 1b95544f84bf83c28cc15f6d0690fdf8a6bb3941
2014-04-28 12:08:23 +00:00
dan
b51926e67c Update test script analyze3.test to account for the fact that SQLite now prefers a full-table scan over a non-covering index scan that visits a large percentage of the table rows.
FossilOrigin-Name: 35f46a55d866b9a87c1321aab8e0cfe86ccadb93
2014-04-28 10:00:59 +00:00
dan
440e6ff3b0 Fix an error in estimating of the number of rows visited by a range scan.
FossilOrigin-Name: d491de62fce69d93e89f65f7713972f7c2c451f7
2014-04-28 08:49:54 +00:00
dan
2dd3cdcfab Fix an sqlite3_stmt_status() problem caused by recent changs on this branch.
FossilOrigin-Name: dee204092421a239f9f60ab83c3a5b3e24d1baea
2014-04-26 20:21:14 +00:00
drh
1f8bb4b0a8 Update requirements marks to fix typos in the requirements text.
No changes to code.

FossilOrigin-Name: f5a263658187250044afc1a74000e6f6962733ca
2014-04-26 19:23:14 +00:00
drh
453e0261df Allow the xfer optimization to proceed if the DEFAULT on the very first
column of the two tables is different.  This is a refinement of the
fix for ticket [f67b41381a].

FossilOrigin-Name: 349f483499dd685a8da94923b6bd810a52e5e236
2014-04-26 17:52:08 +00:00
dan
9940e2aa45 Avoid transfering records between tables unless the default values for all columns are the same. Fix for [f67b41381a].
FossilOrigin-Name: f8c4c495e6de1f124d205383d4bafa46accbff5c
2014-04-26 14:07:57 +00:00
dan
8ad1d8ba38 If the user provides likelihood() data for a WHERE clause term used as part of an index key, have the planner use it when calculating the expected number of rows visited by the loop.
FossilOrigin-Name: c51efaa5d29ee0a91b9e6a83a8dd82530670811a
2014-04-25 20:22:45 +00:00
drh
b79c718f1a Add test cases to ensure correct operation of joins with a virtual table
that include DISTINCT and ORDER BY clauses.  Verification for ticket
[388d01d4bb8f9].

FossilOrigin-Name: 5ada136f43ce744ae8c349eff39838eb44611b6e
2014-04-25 17:37:16 +00:00
dan
aa9933c115 Changes to the way the planner calculates the costs of various table and index scans. Some test cases still failing.
FossilOrigin-Name: c5a6ec0a880652dc8f4593d9f7acd58ddc3dc5f3
2014-04-24 20:04:49 +00:00
drh
0ff435a782 Reopen the orderby-planning branch and merge in the latest trunk enhancements
and fixes.

FossilOrigin-Name: 6077ddcd93318e24b9756adaaf293ba9fb3cedf7
2014-04-24 15:06:25 +00:00
drh
9e0ed8d4ec Merge all recent trunk changes into the threads branch.
FossilOrigin-Name: e2c9f71a451e44040624b9f255b4510743513019
2014-04-23 12:57:55 +00:00
drh
f0582f43dd Comment tweaks on the test case for the [b75a9ca6b0] bug fix.
FossilOrigin-Name: 65d2544af9adc1e2f1d193e57f8be0422fb0d5eb
2014-04-21 13:36:54 +00:00
dan
374cd78c1d Avoid discarding an ORDER BY clause in the case where an identical GROUP BY clauses uses an index to group, but not sort, the rows. Fix for [b75a9ca6b0].
FossilOrigin-Name: de9a490f594183f337a2ec9e0f87792eac83548b
2014-04-21 13:21:56 +00:00
drh
46a06bbe47 Add to speedtest1.c the --threads option for setting the
SQLITE_CONFIG_WORKER_THREADS configuration.

FossilOrigin-Name: 5fce40c44aacf883df2e8e9472c399a6e92197b3
2014-04-18 13:57:39 +00:00
drh
e9af1894e3 Merge recent trunk changes into the threads branch.
FossilOrigin-Name: 8729aa3e3ed1da2e15408ef8705cbe185cd2a5ac
2014-04-18 12:38:54 +00:00
dan
22ace89179 Fix some problems to do with OOM conditions in vdbesort.c. Some problems remain.
FossilOrigin-Name: 2f94f9ce9bf11f1599bbc640b3fc8c15da588416
2014-04-15 20:52:27 +00:00
drh
65b9ac5224 Make sure the undocumented sqlite_rename_parent() function does not
crash even if it is invoked with NULL arguments.
Ticket [264b970c4379fd4b94]

FossilOrigin-Name: c6fa8d0d82805be230f672eabccdfa5680d4ddfd
2014-04-14 19:48:25 +00:00
drh
87744513e7 Make sure column cache elements are cleared correctly when jumping over
code for key generation in a partial index. 
Fix for ticket [2ea3e9fe6379fc3f6].

FossilOrigin-Name: 3122b8364082be783821da01d4af2af6a9586327
2014-04-13 19:15:49 +00:00
dan
4be4c406fa Avoid having the sorter merge too many PMAs at a time when incrementally merging data following a SorterRewind().
FossilOrigin-Name: 98bf0307b121b0776a7170108cc8d3f948a7ebfe
2014-04-11 19:43:07 +00:00
drh
d83cad235a Modify the OR-clause handling so that it can safely deal with OR-clause
with 17 or more terms.  Fix for ticket [10fb063b1179be53ea0b53bb].

FossilOrigin-Name: a67b5312f63909737c052fe58ab5772d45530d49
2014-04-10 02:24:48 +00:00
dan
d30ab3d9dd Experimental multi-threaded sorting changes to allow the sorter to begin returning items to the VDBE before all data is sorted.
FossilOrigin-Name: f9d5e09afaf64d68a0e461c1c2f38179bcea4b1f
2014-04-09 20:04:17 +00:00
drh
48e080b26c Performance improvements when reading large blobs, especially if
SQLITE_DIRECT_OVERFLOW_READ is defined.

FossilOrigin-Name: 2312eb6a9eb31051db4e0baf19e033ba39adc7b1
2014-04-04 18:49:19 +00:00
drh
85462ed939 Merge the latest trunk changes into the threads branch.
FossilOrigin-Name: 39ac79cffe716f88af0871bdd206231b6a6511ff
2014-04-04 18:37:36 +00:00
drh
853546d047 Merge changes to the query planner that strive to ensure that any index
usage that is a proper subset of some other index usage always has a slightly
higher cost.

FossilOrigin-Name: 683dd379a293b2f330e1e4cd746f190527fe48ee
2014-04-04 18:20:35 +00:00
drh
1fb6a11072 Ensure the "PRAGMA journal_mode=WAL" works coming from any other journal_mode
with ATTACH-ed databases.

FossilOrigin-Name: e54330b43127e46fc6494748cbb353a6fc91cfd7
2014-04-04 14:12:52 +00:00
dan
8daefc2af0 Add test file sort3.test, which should have been part of commit [9d3351b8d7].
FossilOrigin-Name: dceed2c803fca23c83c02c448d5ae7c4698efee1
2014-04-04 07:52:44 +00:00
drh
1aca5caa88 Merge all recent changes from trunk.
FossilOrigin-Name: a0910079adde95245680dee59b43613b60903f10
2014-04-03 16:42:21 +00:00
drh
c438df1be0 Use OP_Copy instead of OP_SCopy when moving results out of a subquery,
to prevent the subquery results from changing out from under the outer
query.  Fix for ticket [1e64dd782a126f48d78].

FossilOrigin-Name: d5513dfa23baa0b0a095aaf17d19aacd30dcef61
2014-04-03 16:29:31 +00:00
dan
8930c2ab0c Fix an integer overflow problem in the sorter.
FossilOrigin-Name: 9d3351b8d713232133dad149c73fb2a27c72abb1
2014-04-03 16:25:29 +00:00
dan
dd95d30f82 Fix some problems with OOM handling in vdbesort.c.
FossilOrigin-Name: 47e702bd8392bc50c4edaf6a2c8c499af87b520e
2014-04-02 15:15:25 +00:00
dan
fad9f9a8a6 When sorting data for a CREATE INDEX statement in single-threaded mode, assume that keys are delivered to the sorter in primary key order. Also fix various comments that had fallen out of date.
FossilOrigin-Name: 821d1ac4504243fa13b9e3c0d56361ad9fb80d78
2014-04-01 18:41:51 +00:00
dan
578e1ca8d7 Even if compile time option SQLITE_MAX_WORKER_THREADS is set to one or greater, set the default number of worker threads to zero. Distribute data more evenly between threads in sqlite3VdbeSorterWrite() to improve performance when sorting large amounts of data. Add new test file sort2.test.
FossilOrigin-Name: 643c86a056168e39fcb7f39b8a72731f1eb246db
2014-04-01 15:38:44 +00:00
dan
38fdead890 Fix a problem with OOM handling in the sorter code.
FossilOrigin-Name: 59cd5229e2b5be5272cf57c7e7d09e97d16a5425
2014-04-01 10:19:02 +00:00
drh
e4529c5724 Merge in the latest changes and fixes from trunk.
FossilOrigin-Name: f6211540c9d66a08dc580dd733e4f4a98968ae30
2014-03-31 22:03:32 +00:00
drh
3fb183d2f7 Also make sure an index that is a proper subset of some other index has a
higher cost than that other index.  Add test cases.

FossilOrigin-Name: b7830d232b073a197aa1092e78cb24e88cb10fd3
2014-03-31 19:49:00 +00:00
dan
2f17001521 Merge latest changes from orderby-planning branch.
FossilOrigin-Name: 4c7fb5423430f3b936befaa7c309f8e1968ee7d8
2014-03-28 19:18:16 +00:00
drh
7c8e9c78c8 Merge the latest changes from trunk.
FossilOrigin-Name: 3047a25f1c41e83f0b4772f7c36fbfec0f12dc7e
2014-03-28 18:35:39 +00:00
drh
70c93204ea Disable the wal64k.test script for non-unix systems since it depends on
unix-only features.

FossilOrigin-Name: 27deb6e49bcc76714dbdc61b34748603155ac770
2014-03-28 14:41:35 +00:00
drh
a1f7c0a21c Enhance the sqlite3VdbeRecordCompare() routines so that if they encounter
database corruption, they will set the UnpackedRecord.isCorrupt field and
return 0.  The sqlite3BtreeMovetoUnpacked() routine detects this and returns
SQLITE_CORRUPT, causing the corruption to be reported back to the top-level.

FossilOrigin-Name: 7fa85eaaaf6d211378620d728a759fdfe30a15b0
2014-03-28 03:12:48 +00:00
drh
bfa463696b Merge the latest trunk changes and the fix for the crash on a corrupt
database.

FossilOrigin-Name: 0b35346c32dba14963c85ec178f2b46aa2bbf6dc
2014-03-27 00:09:00 +00:00
dan
68916c9fd3 Add an extra test case for the potential buffer overread patched by [28ddecff04].
FossilOrigin-Name: f585f5d7a0f9bf8c590388654a3638231eba8892
2014-03-26 15:14:59 +00:00
drh
d9c131c366 Add a test case to verify that the previous change avoids excess buffer
overread in sqlite3VdbeRecordCompare().

FossilOrigin-Name: 2b28e8d582cf10936fa1faca04a16ca2eeead66f
2014-03-26 15:05:56 +00:00
drh
182ea4e324 Earlier detection of corruption in sqlite3VdbeRecordCompare() in order to
avoid a potential buffer overread.

FossilOrigin-Name: 28ddecff044dbc2dff50a7d8406ab67dfe06587f
2014-03-26 14:51:07 +00:00
drh
5e8980ddb1 Adjust the repeat counts on several tests in speedtest1 so that the relative
time spent on the test is roughly the same regardless of --size.

FossilOrigin-Name: 7922809ee0d3978ce9221fbb7df63aa0684d0c4d
2014-03-25 20:28:38 +00:00
drh
e6c7b09df6 Merge enhancements and fixes from trunk.
FossilOrigin-Name: e005f2d6dd9faf38cc8fdb9428b5aa6192a6adae
2014-03-25 18:29:12 +00:00
drh
c872966ef4 Add another performance test case to speedtest1. This case is another
ORDER BY test but this time without LIMIT.

FossilOrigin-Name: 9ab7ffd59209aef0ffbf384b3902a93fd3b86a6d
2014-03-25 17:45:49 +00:00
dan
ab1dcc1a4b Fix a problem in the code added by [707ea170b3] causing vdbesort.c to sort unstably.
FossilOrigin-Name: d3e640afe611b6ae0b7f2cff5b00900d7e4d5ee3
2014-03-25 17:07:48 +00:00
drh
0c60c1fe66 Add an ORDER BY test case to speedtest1.c
FossilOrigin-Name: 588122641e57e957813d329ea071e13ccbde5acd
2014-03-25 14:54:36 +00:00
drh
3d1d90a13d Fix arithmetic operators so that they do not change the affinity of their
input operands.  Ticket [a8a0d2996a].

FossilOrigin-Name: 221f8f944703108e47d789fa8ce6c00fe2abcbb6
2014-03-24 15:00:15 +00:00
dan
4979088506 Avoid attempting to mmap memory from an offset that is not a multiple of the system page size on systems with page sizes larger than 32KB.
FossilOrigin-Name: db7d62c8d58eb1e8654a762c9b199ae4e2759038
2014-03-24 11:23:17 +00:00
drh
d345a66428 merge fixes from trunk
FossilOrigin-Name: faf7f9caf526ab33a6fdb9c89b45a0483510db21
2014-03-23 18:47:00 +00:00
drh
f45f2326a2 Use only a single OP_MakeRecord instead of two when constructing entries
to go onto a sorter.

FossilOrigin-Name: d696cdedacd39075aa7fc407ab7c7e50f01d9f39
2014-03-23 17:45:03 +00:00
drh
9a4444778f Add the ability to use indices for the first few terms of an ORDER BY clause,
then sort in batches to handle the later terms.

FossilOrigin-Name: fa06a6fed9f48322d9b89721799ba12c46efa898
2014-03-21 20:58:42 +00:00
dan
9afccba269 Avoid leaking memory in an obscure case where the flattener adds an ORDER BY clause to the recursive part of a recursive query.
FossilOrigin-Name: 1f413aca00015100224273480e1ce39a76bf93ab
2014-03-21 19:27:54 +00:00
drh
cc08fa48b8 Merge the OFFSET-on-query-without-FROM fix from trunk.
FossilOrigin-Name: 71e9ae72c272dc86720b2bfe719f57de437c400b
2014-03-21 18:45:19 +00:00
drh
a22a75e5ca Fix the OFFSET clause so that it works correctly on queries that lack
a FROM clause.  Ticket [07d6a0453d4ed8].

FossilOrigin-Name: 179ef81648b0ad557df78b7712f216b876b6fb65
2014-03-21 18:16:23 +00:00
drh
e99b9cdc70 New test case for block-sorting.
FossilOrigin-Name: e70cfa28aa393661ccc742ecd5e672d807bdd0a9
2014-03-21 15:24:07 +00:00
drh
f9f1bdb0c8 Merge trunk fixes for "x IN (?)" handling.
FossilOrigin-Name: eca35871c34374ca9189c7c9b6d490ac3c30357f
2014-03-20 20:56:49 +00:00
dan
9bc21b535e Only use the direct-overflow-read optimization if all data from the overflow page in question is being read.
FossilOrigin-Name: d8e1f75ddf10f3c0b21acd5455f90fdcea54a948
2014-03-20 18:56:35 +00:00
drh
fbb24d1092 The "x IN (?)" optimization in check-ins [2ff3b25f40] and [e68b427afb] is
incorrect, as demonstrated by the in4-5.1 test case in this check-in.
The "COLLATE binary" that was being added to the RHS of IN was overriding
the implicit collating sequence of the LHS.  This change defines the EP_Generic
expression node property that blocks all affinity or collating sequence
information in the expression subtree and adds that property to the expression
taken from RHS of the IN operator.

FossilOrigin-Name: 2ea4a9f75f46eaa928ba17e9e91bc0432750d46d
2014-03-20 17:03:30 +00:00
drh
0a8d14261c Previous check-in is not quite correct. "x IN (?)" is not exactly the same
as "x==?" do to collation and affinity issues.  The correct converstion should
be to "x==(+? COLLATE binary)".  The current check-in fixes this problem and
provides test cases.  Ticket [e39d032577df69]

FossilOrigin-Name: 2ff3b25f40fd117c8a2da1d1a3625f6b167b7b16
2014-03-20 14:56:47 +00:00
drh
2b59b3a4c8 Convert expressions of the form "X IN (?)" with exactly one value on the
RHS of the IN into equality tests:  "X=?".  Add test cases to verify that
statements work correctly on this corner case.
Fix for ticket [e39d032577df6942].

FossilOrigin-Name: e68b427afbc82e201c64474117851aa4c9eb0c92
2014-03-20 13:26:47 +00:00
dan
bc76063cd2 Add a test to ensure os_unix.c works with 64KiB OS pages.
FossilOrigin-Name: e3d2be3ba47cdaafd26347620ae3bc2813203f16
2014-03-20 09:42:09 +00:00
drh
6284db908a Fix query planner weights associated with choosing block-sorting. Fix
block sorting of tables with collating functions.  Fix various test cases.
All "veryquick" tests are now passing, though more tests need to be added.

FossilOrigin-Name: 01afbf97c0ff29667806e9a7c4d74ca717819de5
2014-03-19 23:24:49 +00:00
dan
d88e521f59 Fix an obscure bug causing sqlite3_close() to fail if there are virtual tables on the disconnect list when it is called.
FossilOrigin-Name: 6504aa47a8ebb13827be017c4cb4b2dc3c4c55f4
2014-03-12 19:38:38 +00:00
dan
82d25da5b0 Changes to FTS to ensure that it does not access the database from within the xConnect method.
FossilOrigin-Name: c67a52c356416cc200f51f9168d942e78db11d34
2014-03-12 19:20:36 +00:00
drh
89212fb9f9 Adjustments to the cost computation for the skip-scan query plan, to take
into account the fact that a seek has to occur on each skip.

FossilOrigin-Name: 0769eebd028ce31375cf93509a1d3687f7b117eb
2014-03-10 20:12:31 +00:00
dan
b72cad14d0 Fix a bug causing "SELECT char()" to return SQLITE_NOMEM.
FossilOrigin-Name: ba39df9d4f7ffc6475ae0dc794f7d3f58c486de8
2014-03-08 19:07:03 +00:00
mistachkin
8879481868 Avoid calling sqlite3OsDelete() on a file that is open, since this causes Windows to run *very* slowly. Comes up on error recovery in journal_mode=PERSIST.
FossilOrigin-Name: fdc651e2ec7a0babee669e24fd56632e7cd5f0e9
2014-03-07 02:29:56 +00:00
dan
f0ec2a5ea7 Do not run corruptH.test in mmap mode.
FossilOrigin-Name: c0d54b4e41cba84dc5934e0fcd03fe422fe5c92b
2014-03-06 18:16:45 +00:00
dan
a6eaa635cc Avoid running a couple of test cases that use realloc() extensively if SQLITE_MEMDEBUG is defined.
FossilOrigin-Name: e406d4bb786a34cdd5dd23ed39f35dfce3e1cabd
2014-03-05 19:13:32 +00:00
dan
13ef14afc1 Add tests to join.test to verify that it is not possible to use more than 64 tables in a join.
FossilOrigin-Name: ef1a998625e1fc051732228844388d6c59665382
2014-03-05 16:15:07 +00:00
dan
1496566560 Add a test case for the problem fixed by [1d134ba2ed].
FossilOrigin-Name: d4fbc05df9501a09623d420fcd5b2bce3a57201b
2014-03-05 15:04:36 +00:00
dan
d520041bc0 Do not run corruptI.test with the mmap permutation.
FossilOrigin-Name: 378b290da85cadc1acba081322d1f0e8d7694e17
2014-03-05 11:22:33 +00:00
drh
19c6d96aec Avoid indexing off the front end of an array when creating a view with
two or more blank column names in the SELECT statement that defines the view.

FossilOrigin-Name: 554501f158534f9c27fd51900589c2ab7cf300d8
2014-03-04 21:19:51 +00:00
dan
052c6784ee Fix a problem with "DEFAULT (-(-9223372036854775808))" clauses in ALTER TABLE ... ADD COLUMN commands.
FossilOrigin-Name: e072cb3ee2a03d786c08230cecc6e970de2cec5b
2014-03-04 21:00:20 +00:00
mistachkin
b64fa0adf7 Fix comment in test.
FossilOrigin-Name: 1e57f67b20a1c01ede36d684be628e9270bf109a
2014-03-04 12:07:24 +00:00
mistachkin
ad4b262545 Fix minor typos in the new test file.
FossilOrigin-Name: 3cbb9b1b4f8c5c2735799e84dc80614586222cd2
2014-03-04 11:54:35 +00:00
dan
5810d0315b Add tests to verify the fix for bug [4ef7e3cfca].
FossilOrigin-Name: 62410bb8a7b33efcd13bce8fd75b83523922adb8
2014-03-04 11:35:20 +00:00
dan
9b8afef260 Avoid a buffer overread in vdbeCompareRecordInt() that might occur if the database is corrupt.
FossilOrigin-Name: 7c0b4381f0e6f33cb13299a915851d9431bf3850
2014-03-03 20:48:50 +00:00
dan
80b2f97234 Merge latest trunk changes.
FossilOrigin-Name: 1d60356462f111ed147aa865dd17a13511db6ab7
2014-03-03 17:48:03 +00:00
drh
6295524e3d Change an OP_SCopy into an OP_Copy in a case where the destination might be
used after the source has changed.

FossilOrigin-Name: c0fa0c0e2de50d7eda19ab8862496b18eff93538
2014-03-03 17:36:39 +00:00
dan
dea63f24e1 Change the "explain_i" tcl test command so that xterm color codes are only added if the output is actually a terminal.
FossilOrigin-Name: 559835e54e0715f2b4d207d056199a8268af739e
2014-03-03 16:48:47 +00:00
dan
597515d70c Update some test cases that deal with corrupt databases.
FossilOrigin-Name: 3a09f5605ac7c6e503eb10acfdc607010414d917
2014-02-28 18:39:51 +00:00
dan
a6efad8a97 Merge in latest trunk changes.
FossilOrigin-Name: 8f30b09518d23c3f6cecd244a66ef918fdb55323
2014-02-27 20:52:26 +00:00
drh
3852b68edd In the command-line shell for CSV import, if the lines are \r\n terminated
and the last field is blank, make sure an empty string and not a "\r" string
is imported.

FossilOrigin-Name: 9c2e7612cd137895e13ee872e668ce1216719d85
2014-02-26 13:53:34 +00:00
drh
434a93147c Improved handling of constants and especially constant functions in the
ORDER BY clause of a query.  Do not optimize out "ORDER BY random()".
Fix for ticket [65bdeb9739605cc2296].

FossilOrigin-Name: dca1945aeb3fb005263f9be00ee8e72b966ae303
2014-02-26 02:26:09 +00:00
drh
0baa035a1e Do not allow temporary registers to be in use across an OP_Yield within a
co-routine.  Fix for ticket [8c63ff0eca81a9132d8].

FossilOrigin-Name: 97a8c9733cba97c78e979dfd5c66610c23e90288
2014-02-25 21:55:16 +00:00
dan
1fed5dab0d Attempt to speed up sqlite3VdbeRecordCompare() by various means. This code is in an interim state.
FossilOrigin-Name: 85206e0bbac29adab52bef795f6d1479f2ae2c0e
2014-02-25 21:01:25 +00:00
mistachkin
1925a2e6f8 Enhance testing support for the Win32 VFS dynamic extension loading facilities.
FossilOrigin-Name: 53081e7202fb55f792a78e73627466eb0200f11c
2014-02-24 21:20:25 +00:00
dan
98c91905c9 Close some stray connections in walro.test.
FossilOrigin-Name: d6746cabaa22429644c956a4b5fd91896376de2d
2014-02-24 19:49:36 +00:00
drh
c0bf493ea5 Make sure a multi-row VALUES clause works correctly in a compound SELECT.
FossilOrigin-Name: 85b355cfb40e8dbeb171980204ffad897184063f
2014-02-19 01:31:02 +00:00
drh
8be09304b7 Add a test case for OP_SoftNull.
FossilOrigin-Name: f29d194e03d6bcc78bf883b77e591dbccada02f0
2014-02-17 15:40:19 +00:00
drh
05a86c5c0f Enhance the code generator for INSERT INTO ... SELECT so that the SELECT
generates output directly in the registers that INSERT INTO will be using,
in many cases, and OP_SCopy operations can thus be avoided.

FossilOrigin-Name: aa2d8b0e8154dd2f5e2c837dc11ab362b083495b
2014-02-16 01:55:49 +00:00
drh
cfc6ca4179 Seek past NULLs in a top-constrained search. Avoid checking for NULLs in
the body of the search.

FossilOrigin-Name: e07a32f30862acf3b322d4d8deb015846d6f8f5f
2014-02-14 23:49:13 +00:00
mistachkin
2953ba9e20 Revise how the Tcl system encoding is handled by the test suite.
FossilOrigin-Name: 9e573198e107f1b85ee37c52a10343d38968bda1
2014-02-14 00:25:03 +00:00
dan
dd973548f1 Ensure that if the "psow=0" URI option or FCNTL_POWERSAFE_OVERWRITE file-control is used to clear the power-safe overwrite flag, extra padding frames are added to the WAL file.
FossilOrigin-Name: 48c821fd97a8f03757c90560c37a46bd0843570e
2014-02-13 19:27:08 +00:00
drh
784156f84c Make sure "rowid" columns are correctly resolved in joins between normal
tables and WITHOUT ROWID tables.  Fix for ticket [c34d0557f740c45070].

FossilOrigin-Name: 5d01426ddfb2d47c57f93f71378594e637424be0
2014-02-12 14:43:52 +00:00
drh
39a3088dc4 Updates to the command-line shell. Simplify the banner message. Add the
".save" command as an alias for ".backup".  When starting with no arguments,
include a banner message warning that the database is transient and in-memory
and mention the ".open" command.

FossilOrigin-Name: f5ad1e1bf2828c5da70c1ff944d8212036142e6f
2014-02-11 16:22:18 +00:00
drh
7c3280649a Make sure that virtual WHERE-clause terms do not get transformed into real
terms when processing set of OR-connected terms.
Fix for ticket [4c86b126f22ad].

FossilOrigin-Name: c950d6c4117d076f871518e738cdf9e8c46a19fc
2014-02-11 01:50:29 +00:00
drh
a6e3a8c9d5 Fix a pointless conditional. Add a test case.
FossilOrigin-Name: 9367632dd7e4fec9197227e35b0627c2e81ebffc
2014-02-10 21:07:51 +00:00
drh
5574e3f456 Add a compound-query test to the speedtest1 test program.
FossilOrigin-Name: 532995759114ab7a7cba18cc9d8820d78eb1a96e
2014-02-09 23:59:28 +00:00
drh
d227a291b2 Use the WITH clause to help resolve names for SELECT statements on the left
of a compound query.  Proposed fix for ticket [31a19d11b97088296a].

FossilOrigin-Name: 67bfd59d9087a987f15f6148efa1ff104983e1fb
2014-02-09 18:02:09 +00:00
drh
fa46bfbbc5 Add the Mandelbrot Set testcase to the "cte" testset of speedtest1.
FossilOrigin-Name: 56febbeb575a298ae8839b3a59711150ceb9999d
2014-02-09 00:52:53 +00:00
drh
c47548057d Add a new "testset" to the speedtest1 program: The sudoku solver.
FossilOrigin-Name: 4677ef2f8a726573c48ee2e532c00a68308dd7e1
2014-02-09 00:18:21 +00:00
drh
826af37865 Change the OP_Found opcode so that it expands zero-blobs prior to comparing
them.  Fix for ticket [fccbde530a6583b]

FossilOrigin-Name: e2303d1b0c17b6e7494fb7db8264f4c2ac193723
2014-02-08 19:12:21 +00:00
drh
bb44b3de39 Update evidence marks on SELECT tests. Comment changes only.
No changes to code or tests.

FossilOrigin-Name: 1973d80e474cb95d053e04415b22154897d4d710
2014-01-30 17:47:02 +00:00
drh
9a2555f538 Fix requirements marks only. No changes to code or tests.
FossilOrigin-Name: 4a34378b9b02e463081729186dcb9b0404dbcd06
2014-01-30 15:03:50 +00:00
drh
a88aca5442 Update a requirement mark and add some additional test cases to cover
the requirement associated with ORDER BY and LIMIT on compound SELECT
statements.

FossilOrigin-Name: 8560091e85f2f99a24810648868bf2e081c32698
2014-01-30 14:10:00 +00:00
dan
81a034b62b Do not run test script mmapfault.test as part of the "inmemory_journal" permutation test.
FossilOrigin-Name: b222b61a98dc1f3c2c48ea06efe7d82d9fcf4d75
2014-01-30 12:16:23 +00:00
dan
705a48758a Fix a couple of problems with new test scripts causing the permutations test to fail.
FossilOrigin-Name: 48d736c0ee1ac0879bd12d2f1901f208e87e538a
2014-01-27 16:35:15 +00:00
drh
a820c05aa0 Update some requirements marks to conform with improvements
in the documentation.

FossilOrigin-Name: be1acb610f7e594b417dd8409b7a7aa8f3af5f77
2014-01-27 15:02:07 +00:00
dan
d0879bad42 Fix a problem in pagerfault.test causing an assert() to fail.
FossilOrigin-Name: ba8d2d507f82e2baaceadcf7ac6d71bb91f7e06b
2014-01-27 14:19:22 +00:00
dan
abfe034692 Fix some problems in test scripts. No code changes.
FossilOrigin-Name: 08acfc65877e207f1a62d31a14afb4add20c4c35
2014-01-27 08:48:10 +00:00
dan
53bed45ecb Select collation sequences for ORDER BY expressions attached to recursive CTEs in the same way as they are selected for other compound SELECT statements.
FossilOrigin-Name: 9554519c126c5e714421a82fd2e8aa9b19e11493
2014-01-24 20:37:18 +00:00
dan
05d3dc29c5 Add test cases for LIMIT and ORDER BY on recursive CTEs.
FossilOrigin-Name: 67d6c42d44cb191368ce20f553b32fcb14bfc4d7
2014-01-24 16:57:42 +00:00
drh
9e2c7ae1b0 Add a few more CTE test cases to closure.test.
FossilOrigin-Name: 1b6405d9788c1bb89761b2bcdce560a5020ff503
2014-01-24 15:42:51 +00:00
drh
3c2aeae16e Add test cases that compare the performance of the transitive_closure
virtual table again common table expressions for walking a tree.

FossilOrigin-Name: 9a23f020e8ed0e7a1ad227b4ab379fdf5e2de222
2014-01-24 14:37:44 +00:00
drh
b090352b5a Add test cases showing the use of ORDER BY on a recursive query to control
depth-first versus breath-first search of a tree.

FossilOrigin-Name: 83b0b2916589db0184435dbd4c304387f393ed60
2014-01-24 11:16:01 +00:00
dan
afcf9bd806 Modifications to test files to omit any tests that intentionally access out-of-bounds locations in clang -fsanitize=address builds.
FossilOrigin-Name: f4a701d55f5c4e1e62ed64b779ad4fff89dd31b7
2014-01-23 14:44:08 +00:00
drh
953dfa4e60 Change the WITH RECURSIVE implementation to use a queue instead of a pair of
tables.  Add support for ORDER BY, LIMIT, and OFFSET on recursive queries.

FossilOrigin-Name: b6cea42006910d590373e8f9e296d7672edb114b
2014-01-22 18:16:27 +00:00
drh
aa9ce7078a Add support for LIMIT and OFFSET in a recursive query.
FossilOrigin-Name: 1945484e6b9769c1943f750f5b09860417fb190a
2014-01-22 18:07:04 +00:00
dan
a8a0617e06 Update the spellfix virtual table to optimize queries of the form "SELECT ... FROM tbl WHERE rowid=?".
FossilOrigin-Name: a0ba55ff0596c5f15e9cdb254c68ef50df2dfaad
2014-01-22 17:43:16 +00:00
drh
fe1c6bb9c2 Get ORDER BY working for recursive queries.
FossilOrigin-Name: 37b343b01841b338954ddfa9b76d92aa50037aec
2014-01-22 17:28:35 +00:00
dan
a4ff825095 In where.c, do not allocate space in sqlite3_index_info structures for the internal WHERE clause "terms" generated to record column equivalencies.
FossilOrigin-Name: 7d9e22187daaa3160b875a1df17b924969bf718e
2014-01-20 19:55:33 +00:00
dan
7df42aba12 Handle a few obscure problems that could manifest if a database corrupted in a certain way was written by a connection in the middle of a SELECT statement on the same db.
FossilOrigin-Name: eba8a564e62f84a9620008beead80081fe90a1b7
2014-01-20 18:25:44 +00:00
dan
7f3068aa83 Do not run the tests in with2.test with SQLITE_OMIT_CTE builds.
FossilOrigin-Name: 8a973912e98c9b1bb9d3f914527d35c1e7f2011a
2014-01-20 14:17:08 +00:00
drh
717c09c4a9 Add a sudoku solver to the recursive query tests in with1.test.
FossilOrigin-Name: 679eff8759aa25368b977c0d26b78a9fcd9486f5
2014-01-18 18:33:44 +00:00
dan
1fe3c4b526 Add extra test cases. No changes to code.
FossilOrigin-Name: d38d485e581dab99a3ee6b348da8ddaf9b379ff2
2014-01-18 15:59:35 +00:00
drh
75303a2c68 Add asserts() for a couple of unreachable conditions. Add the Mandelbrot Set
query as a test case.

FossilOrigin-Name: 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a
2014-01-18 15:22:53 +00:00
dan
ebbf08a012 Avoid spurious "no such table" errors in statements of the form "INSERT INTO tbl WITH xxx AS (...) SELECT * FROM xxx".
FossilOrigin-Name: cccff8a0b427feb05cc8952a765b829e731394fd
2014-01-18 08:27:02 +00:00
dan
7c82932723 Add extra tests to with2.test.
FossilOrigin-Name: eecc325afd72e37d7d565787c8cea68aad6d7a5c
2014-01-17 20:36:17 +00:00
drh
c59731c4ae Minor simplification of error message text for a couple of errors associated
with WITH clause processing.

FossilOrigin-Name: 2031004d960526d6426d50d7b732f37b281534e2
2014-01-17 18:34:28 +00:00
dan
98f45e53a7 Resolve table names within CTEs in the context in which the CTE is declared, not the context in which it is used.
FossilOrigin-Name: a7323838bbd354a1c2f339e5e0f164f0eada47b3
2014-01-17 17:40:46 +00:00
drh
a026b98500 Add tests that verify that keywords WITH, WITHOUT, and RECURSIVE can still
be used as table and column names.

FossilOrigin-Name: 9ca18a0191db6a9b0763e2f0b3b35d23099fb71b
2014-01-17 16:19:01 +00:00
dan
718569443d Add support for common table expressions (WITH clauses).
FossilOrigin-Name: 0171e3bb4f663a9414b0e8b64c87b5d0683855b5
2014-01-17 15:15:10 +00:00
dan
b290f11775 Fix some problems to do with WITH clauses and name resolution.
FossilOrigin-Name: 6a549187ed8b5ed50daefa676ff666ae2ed43346
2014-01-17 14:59:27 +00:00
dan
2d4dc5fc60 Remove some code from resolve.c that was only required for recursive cte references in sub-queries. Also a stray "finish_test" command in pagerfault.test.
FossilOrigin-Name: f68c6c4d36481526a9348244adc571ea282dc9eb
2014-01-17 11:48:24 +00:00
drh
65a2aaa633 Add the ability for the authorizer callback to disallow recursive
queries.

FossilOrigin-Name: 9efc120a1548c03f3d8aabbadf1050ff2a119c31
2014-01-16 22:40:02 +00:00
drh
727a99f1e3 Tweaks to error message text.
FossilOrigin-Name: 090a77d97808b86d1e9f5c63c743a2b159a15f5d
2014-01-16 21:59:51 +00:00
dan
f2655fe8b6 Improve the error messages used to report illegal recursive cte references.
FossilOrigin-Name: 54eee9fe99290e59469bd3e1a66bb749887d37ee
2014-01-16 21:02:02 +00:00
drh
6ade453cd8 Always use available indices to optimize LIKE operators even if the pattern
of the LIKE operator has a COLLATE modifier.  This fixes an ineffiency that
was introduced into 3.7.15 by check-in [8542e6180d4] on 2012-12-08.

FossilOrigin-Name: 16bd54783a3f5531c55564ddefdada657c078eb0
2014-01-16 15:31:41 +00:00
dan
eede6a538d Fixes so that SQLITE_OMIT_CTE builds work.
FossilOrigin-Name: 3908e2ea2e7e5f466cbbbffdc27e0fe8dc9751ac
2014-01-15 19:42:23 +00:00
dan
62ba4e418d Disable automatic indices on recursive CTE references.
FossilOrigin-Name: 28aa6db8c878655255dbfb618f8d65be78e3d7e5
2014-01-15 18:21:41 +00:00