Commit Graph

18113 Commits

Author SHA1 Message Date
drh 2e9d706252 Remove the (undocumented) query-planner control that prevents
a "SELECT ALL" subquery in FROM clause from being implemented as a co-routine.

FossilOrigin-Name: ff2f5a31a2ac67a2fdbb25793e8013cb0e062ab90bdcba2d52a62d6d4d8b6d18
2017-09-28 17:29:24 +00:00
drh 3d240d2119 Fix over-length source code lines in select.c. No logic changes.
FossilOrigin-Name: fd3267ef92384fcefaee7460a5ffbaf8ddcb6049eec36f72a7046a43e2871fbf
2017-09-28 16:56:55 +00:00
drh 4e6cec1ca0 Fix an issue introduced by check-in [4cd2a9672c59] (2017-03-03) that could
allow a negative value in the 3rd parameter to memmove() when
defragmentPage() is called on a btree page with a corrupted
freeblock list.  The corruption is now detected early and results in
an SQLITE_CORRUPT return before the memmove() is reached.

FossilOrigin-Name: 5b9ae693120fe4f7bc3b6270f35d773876f6cc8f5990e05cce0d255c54b36ae7
2017-09-28 13:47:35 +00:00
drh 70efa84da7 Add new routines to simplify dealing with collating sequences in expressions:
sqlite3ExprNNCollSeq() and sqlite3ExprCollSeqMatch().

FossilOrigin-Name: 490e488ea963fe725b16212822c8608f2b6abce688931b611446bc2cbfe6b87c
2017-09-28 01:58:23 +00:00
drh db8e68b4cd Indexes on expressions with a COLLATE clause are able to satisfy an ORDER BY
with the same COLLATE clause.

FossilOrigin-Name: 0413001843dce7c63659d39b329ca14cdcd54f4407922f51b2fb7659572a733e
2017-09-28 01:09:42 +00:00
drh 488e619192 In two places, change the magic number -1 to its proper symbol XN_ROWID.
FossilOrigin-Name: 80277d2fc9b76fe41e345d00952da1528e69884f25911cf6e4f78b09ff778421
2017-09-28 00:01:36 +00:00
drh 9325c87c26 Disable tests for the LIKE optimization when ICU is enabled, since the
LIKE optimization only works for the built-in LIKE operator and ICU overrides
the built-in.

FossilOrigin-Name: f5ef2e1bcd2790f960c15947f87cda19bd6a6a384ad09b25f6d07d5244cfecbd
2017-09-27 16:51:00 +00:00
dan b92d585c60 Add an extra snapshot related test case.
FossilOrigin-Name: 24a95e143785bb8e12198092d13c979ec2e116fa8b55d0bf482cb473a92294d8
2017-09-25 09:37:37 +00:00
mistachkin 3314062b9d Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well.
FossilOrigin-Name: 2c03d8b8f028b6a736aaf2cf8b28a51b3434cf341c95cf3a80469e0a24acdd98
2017-09-22 16:23:23 +00:00
drh 24ddadfa3b Partial backout of check-in [e0af9a904076]. It turns out we do need some
extra space at the end of the record blob as an overrun area to use when
decoding a maliciously malformed record.

FossilOrigin-Name: 403b88a894d877b85bcc33133abad06c3c576e4928de4a4b0c091f74c4015355
2017-09-22 12:52:31 +00:00
drh 0b11bcb3e4 Update the configure script so that it looks for tclsh8.7 ahead of tclsh8.6.
FossilOrigin-Name: 0a12915b373cd0491a58d8f7a645711c620c70efced623e6b40aa01f23284157
2017-09-22 00:24:44 +00:00
drh 0e97e9a4c2 In the Windows VFS, when trying to open a database file read/write, if it
fails check to see if the file exists and is read-only and immediately fall
back to a read-only open attempt, rather than running the AV retry loop.

FossilOrigin-Name: 5d03c738e93d36815248991d9ed3d62297ba1bb966e602e7874410076c144f43
2017-09-21 20:43:48 +00:00
drh b40d9eea50 In the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when
falling back from SQLITE_OPEN_READWRITE to SQLITE_OPEN_READONLY.  Wait until
the open fails completely.

FossilOrigin-Name: fa3f5bcc23d9342f6df8ea15732988d637e9fa5dade85a73b05a9f66136d6964
2017-09-21 20:03:17 +00:00
drh 8dfde89bc6 Fix harmless UB in the ICU extension.
FossilOrigin-Name: 68e9a840d9cfbf4988e1a68c34e809d15d0235998cf0bfa147a1ab88ea842a61
2017-09-21 19:08:25 +00:00
drh 9616805728 Fix a potential use of an uninitialized pointer in RTree following an OOM
error.

FossilOrigin-Name: fd4ec0cdbd84f3333dd4c7a4236491bce6b9ab21fb2c088751ca1279b31bd864
2017-09-21 13:11:47 +00:00
drh 19be1b631b Fix a bug in tool/mksourceid.c:
The mksourceid.c program was incorrectly including the "# Remove this line"
line of the Fossil-generated "manifest" file in the SHA3 hash.  That means
that all SQLITE_SOURCE_IDs for trunk versions going back to
check-in [30966d56] (2017-08-22) are incorrect.

FossilOrigin-Name: 65765222ef6f4e80c05a24994fcee145f5fbc0ad35c9fab3d75492964b3eb187
2017-09-21 10:24:10 +00:00
drh c07df4c3b9 Revert one performance improvement changes from check-in [3b3e32d4cd07] as
it was causing a reference to an uninitialized value.

FossilOrigin-Name: f8b1c64d3eeb8413ca149f34cc00f9154a5446d06ad33bbffa69118e6110f81d
2017-09-21 01:04:30 +00:00
drh b5c1063ab7 Fix the rendering of the P4_INTARRAY argument to the OP_IntegrityCk opcode
in the output of EXPLAIN.

FossilOrigin-Name: adc12c83dda8ba93ca220bbff649f763058b9440968ae463621f0cb7de8889cf
2017-09-21 00:49:15 +00:00
drh 762dffa54a Size and performance optimization on sqlite3VdbeMemGrow().
FossilOrigin-Name: 4b3f7eacb862fbb5b75cf50b72fb60dfbd0acb5818e9f83383a6a63c8bbeacdf
2017-09-20 18:47:51 +00:00
drh 63d1632f1e The BLOB returned by sqlite3VdbeMemFromBtree() does not need to be
zero-terminated.

FossilOrigin-Name: e0af9a9040768adf8bba42a8780adeb6304bc442afb1f35d239d019db1624f40
2017-09-20 18:07:50 +00:00
drh 97397a70e4 Small size and performance optimization in the bytecode engine.
FossilOrigin-Name: 3b3e32d4cd07a1d2d1708fffa47819345ae6b39205a9f548280d499c8f481d64
2017-09-20 17:49:12 +00:00
drh 84d4f1a328 Improved resolution of large integer values in "CAST(x AS NUMERIC)".
FossilOrigin-Name: 7f2bd4ff45fba29528c18cac6da983bd9b164303525d3965056f5b40f85dc83f
2017-09-20 10:47:10 +00:00
drh 9a243e69c2 Updates to the "lemon.html" document received from Andy Goth.
FossilOrigin-Name: 5b2002f3df1902aaa571a0efd01ab8bae7f4d37ac4819cc51595277f4de93433
2017-09-20 09:09:34 +00:00
drh cf51255c44 Add the sqlite3_mmap_warm() function as an extension in the ext/misc/mmapwarm.c source file.
FossilOrigin-Name: 1b2de41453ac33de82f9cd6cbb92eee4fe184fb282c27e5efa5243c8cb239630
2017-09-18 18:17:01 +00:00
drh 262d55121f Fix a typo in the MSVC makefile.
FossilOrigin-Name: 3235835babb49b4dd1acaabd1aa6cfb0b7fe19a914db1cb511e8cc872d3c0c39
2017-09-18 18:08:54 +00:00
dan 460f1fa55c Add extension "mmapwarm.c". Provides function sqlite3_mmap_warm(), used to
"warm up" the memory mapping used by SQLite in mmap mode to access db file
content.

FossilOrigin-Name: d4a30b91f9aad93510baead8c04ee51b82c98763be5a224ed4873298214c963a
2017-09-18 16:28:56 +00:00
drh 63347e7df8 Minor simplification of error message generation during compound query
code generation.

FossilOrigin-Name: a944719314e0ac2f1954b65668815769eba3ab3e39a74666293b8dea52a184b2
2017-09-18 13:16:10 +00:00
drh edea4a7cc9 The out-of-bounds read on recovery fix of check-in [378afa16381a222a] caused
problems for some corner-case error conditions.  This alternative fix appears
to work better.

FossilOrigin-Name: 74f399d81fe250e09fde730ac0c17fe8b2b776ed32a3f576adaad56090f2b7fa
2017-09-18 09:40:46 +00:00
drh 2acd24d90c Fix the CSV virtual table extension so that it works when the default character
is unsigned.

FossilOrigin-Name: 42f07775556758754e92e29a759d200d0d81d16eee83ab982b840db11292f834
2017-09-18 00:18:31 +00:00
drh 97258194a2 Do not make the assumption (as check-in [4da49a95c0f07] incorrectly did) that
the ExprList returned by sqlite3ExprListDup() would never be passed into
sqlite3ExprListAppend().  Include a new test case that shows this sometimes
does happen.

FossilOrigin-Name: 29227d00a9999f0f28a0b55ef70183799a667c3b9d81d2e5ac0ab1840bef98b1
2017-09-17 19:45:28 +00:00
drh 559656196b Simplify the sqlite3VdbeGet() routine. Smaller, faster, and easier to maintain.
FossilOrigin-Name: 5dbb255a9377a6c2619fbac519f18caa4d8cb23257dfba0ffb9e36dd9dc16627
2017-09-16 20:58:41 +00:00
drh 2def2f7e0a Remove an unnecessary parameter from selectInnerLoop().
FossilOrigin-Name: dd95887f82739d05585edfb70913fdaaab154de46c4d3113dd32d283767fb6fc
2017-09-15 17:40:34 +00:00
drh 3df6c3b1c5 Improved the header-comment documentation on sqlite3ExprCodeExprList().
No changes to code.

FossilOrigin-Name: 5dc3ecb5f67968545fb35ceed61ad625e069c4e744c5c3ebaea65e2fee347a5f
2017-09-15 15:38:01 +00:00
drh a19543fe70 Optimization to the ExprList object to make it slightly smaller and faster.
FossilOrigin-Name: 4da49a95c0f07ed7790169e8833c3e2dacda504a3d997f567572020148abe30b
2017-09-15 15:17:48 +00:00
drh 154896e8d2 Fix a harmless comment typo. No changes to code.
FossilOrigin-Name: f7f0bf1da03f7fc1647ef172d9cb71a2ac46f136d4dee8e3a24e39313a981eb5
2017-09-15 14:36:13 +00:00
dan 3ed0f1c936 Add another test case for the problem fixed by the previous commit.
FossilOrigin-Name: 1a7e0b61c8a6bdd3ed105b9bc8a3732668fd7a897d2ed16c99445498e3c87089
2017-09-14 21:12:07 +00:00
dan 629ec14abc Avoid an out-of-bounds read that can be caused by a specially constructed
journal file.

FossilOrigin-Name: cf5bf42cad6e019a38dc0a36ff1f53ada619eef5259e175c3554a16669e03202
2017-09-14 20:41:17 +00:00
drh 263a8b660f Avoid an out-of-bounds read on a recovery attempt using a carefully crafted
database and rollback journal with mismatched page sizes.  The test case for
this is in TH3.

FossilOrigin-Name: 378afa16381a222aafa6009dbbbc92473a69683537f1c265694678b0595a42c8
2017-09-14 02:36:27 +00:00
drh bb6896226f Test case update due to PRAGMA integrity_check enhancements in [8525c30c].
No changes to code.

FossilOrigin-Name: 43c6023bbf6b808ab4cfdbd1a63a516cbe2f1794c7787f8230632bae12e2ff59
2017-09-13 20:20:36 +00:00
drh 4c08735732 Disable FTS3 matchinfo() tests that assume a littleEndian platform when
running on bigEndian.

FossilOrigin-Name: 87ccdf9cbb9284553330683d4971be4f523ce922089aee6dffccfc18b3004263
2017-09-13 12:55:59 +00:00
drh d33bcb8a3c Improvements to PRAGMA integrity_check for better detection of malformed
records.  Integrity_check now avoids returning SQLITE_CORRUPT on a corrupt
record.  Also includes microoptimizations that I stumbled over while working
on integrity_check.

FossilOrigin-Name: 8525c30c1d6676e51b9d9c642450aae3722c129edafdbc39b8435fcfe09b1817
2017-09-13 00:33:36 +00:00
drh 74588ceb31 PRAGMA integrity_check returns SQLITE_OK even if it encounters corruption
while scanning indexes.

FossilOrigin-Name: 81f62e99f27dedf3dc10fa1593c4cd9fc158680867206aee853e503a0cc8df71
2017-09-13 00:13:05 +00:00
mistachkin 77187faf5a Fix test script comment. No changes to code.
FossilOrigin-Name: a5a1949259a26c3330d7b1dcf38a8dd2e9b2c3af8d52f937e8537df138c9a55a
2017-09-13 00:01:26 +00:00
mistachkin bf60baa985 Remove use of the rand_s() function (added by [139081bef9f63c3e]) as it appears to cause issues with some third-party DLLs.
FossilOrigin-Name: 3a2793aa65727cbbf8c4678d478cf8fb02350f19ff98201934a984727368d64d
2017-09-12 23:58:47 +00:00
drh 3ba18adde5 Fix an error in [b22cdd67] that can cause a negative infinity to be (rarely)
reported as a positive infinity.

FossilOrigin-Name: 9780b23ca375de6a542516fbc03eb39d5a393ca577718fda231d0d0ccf3b1c7e
2017-09-12 15:05:34 +00:00
drh b9772e7fe8 Changes to (hopefully) get the build working with recent Intel compilers.
FossilOrigin-Name: b22cdd6734ecda2b2b9749668f353abc2660f192d6a40c5d266309d30e25695e
2017-09-12 13:27:43 +00:00
drh 3e1e14d818 Make sure all connections are closed in the pragma.test script.
Test change only - no changes to code.

FossilOrigin-Name: d7b7f038a2c5e81a58c1dd4b556096b58ce10c30eb74fd4b770445927fdb62f3
2017-09-12 00:24:45 +00:00
drh 68262d85ec New test case for ticket [b899b6042f97f52d].
FossilOrigin-Name: 9d91ee5ee3f316a8804b02eb3c34b175b8f87b28c22df56f481af708c54e297c
2017-09-11 23:46:59 +00:00
drh fa7b471c35 Add support for new operators in virtual tables: !=, IS, IS NOT, IS NULL, and NOTNULL.
FossilOrigin-Name: 3b7dbe9da90b7db336eed597a73a5364d8a691e57c1febd60908349f57a539ad
2017-09-11 20:54:54 +00:00
drh 303a69b5ad Refactor names of constants and functions associated with the auxiliary
operators for xBestIndex.

FossilOrigin-Name: 0fb992af669e765760a94d2b6e2330b21a98f39f18445a94b0a2290560368d58
2017-09-11 19:47:37 +00:00