drh [Thu, 3 Mar 2022 16:48:35 +0000 (16:48 +0000)]
Make sure the xParseCell and xCellSize methods of the MemPage object are
initialized consistently even if the page is detected as being corrupt.
dbsqlfuzz fd21f341f3b4f582401d2feb2a1c0c4cc2c26caa.
drh [Thu, 3 Mar 2022 15:59:22 +0000 (15:59 +0000)]
Fix for the problem identified in
[forum:/forumpost/0cd8e058bf|forum post 0cd8e058bf]:
When evaluating an multi-index OR, do not push down auxiliary WHERE clause
terms that involve subqueries into the OR-subqueries. Otherwise, the
covering-index optimizer might convert table-references into index-references
for the particular OR index that is active for the branch in which the
subquery subroutine is coded, and those index-references
will not work if the subquery subroutine is invoked from a different OR branch
that uses a different index.
drh [Thu, 3 Mar 2022 15:00:44 +0000 (15:00 +0000)]
Add the new OP_BeginSubrtn opcode (which is really an alias for OP_Integer)
and make other changes so that the span of a subroutine that implements
a subquery is more readily apparent in bytecode listings.
drh [Wed, 2 Mar 2022 21:04:10 +0000 (21:04 +0000)]
Bloom filter pull-down optimization is incompatible with Skip-Scan.
Make sure the query planner does not try to to both.
[forum:/info/50a1bbe08ce4c29c|Forum post 50a1bbe08ce4c29c].
drh [Tue, 1 Mar 2022 20:15:04 +0000 (20:15 +0000)]
The MemPage.aDataEnd field should point to the end of the data buffer for
the page, not just the end of the usable portion of that buffer. The purpose
aDataEnd is to detect cells that overflow the page, and that won't work on a
page with reserved bytes and a cell that starts in the reserved region, unless
the boundary is at the very end of the page. Chromium issue 1276294.
drh [Tue, 1 Mar 2022 16:22:54 +0000 (16:22 +0000)]
Fix two assert() statements in btree.c which were not true in the case of
a corrupt database file.
[forum:/forumpost/14819f2063|Forum post 14819f2063].
drh [Tue, 1 Mar 2022 14:13:32 +0000 (14:13 +0000)]
Increase the max_page_count on ROLLBACK, if necessary, so that it is sufficient
to cover the entire database. Fix for the problem identified by
[forum:/forumpost/3b9e894312|forum post 3b9e894312].
drh [Mon, 28 Feb 2022 16:44:58 +0000 (16:44 +0000)]
Fix the Xfer-optimization on the INSERT statement so that it is omitted if
there is a RETURNING clause, since that optimization is not able to deal
with RETURNING. See [forum:/forumpost/595e132f71|forum thread 595e132f71]
for details.
drh [Mon, 28 Feb 2022 12:08:09 +0000 (12:08 +0000)]
The performance increase in the previous check-in of this branch was due to
the revised loop in initMemArray() and reordering fields of Mem - not the
call the memcpy(). Changing the code to avoid memcpy() results in an even
better gain, and code that is far less dodgy.
drh [Mon, 28 Feb 2022 03:25:13 +0000 (03:25 +0000)]
An optimization to initMemArray() saves almost 500K cycles. But it seems a
little dodgy. I want to think about this more before merging to trunk.
Perhaps there is a cleaner way to accomplish the same.
drh [Sat, 26 Feb 2022 14:39:08 +0000 (14:39 +0000)]
Allow the OP_Column opcode to read rows that are larger than
SQLITE_LIMIT_LENGTH as long as the specific field being read out is
less than or equal to SQLITE_LIMIT_LENGTH.
drh [Fri, 25 Feb 2022 01:23:17 +0000 (01:23 +0000)]
Invoking SQLITE_TESTCTRL_INTERNAL_FUNCTIONS causes the flags field of the
PRAGMA function_list to show all bits, including internal-use-only bits,
rather than just the bits that are part of the API.
drh [Thu, 24 Feb 2022 14:44:23 +0000 (14:44 +0000)]
Change the OP_Next and OP_Prev opcodes so that they invoke
sqlite3BtreeNext() and sqlite3BtreePrevious() directly rather than through
a function pointer, for improved performance and a decrease in code size.
drh [Wed, 23 Feb 2022 22:56:10 +0000 (22:56 +0000)]
Add a new subclass for MemPage.xCellSize specifically for the case of a leaf
page in a B+Tree, that is optimized for that cases. This gains a half million
cycles or more at the cost of less than 200 bytes of code space.
drh [Wed, 23 Feb 2022 17:00:44 +0000 (17:00 +0000)]
Store the page number for the PENDING_BYTE page in the Pager object, rather
than computing the page number every time it is needed, because it turns out
that number is needed quite frequently. This saves a few hundred thousand
CPU cycles and a few bytes of code space.
drh [Tue, 22 Feb 2022 15:47:55 +0000 (15:47 +0000)]
Fix an undersized memory allocation in the test harness for RTREE. This
error was in test logic only, not in the SQLite library itself.
[forum:/forumpost/35470a0a72a005e1|forum post 35470a0a72a005e1]
drh [Thu, 17 Feb 2022 17:24:39 +0000 (17:24 +0000)]
Enhance the documentation on sqlite3_stmt_readonly() to explain that
EXPLAIN and EXPLAIN QUERY PLAN do not affect the return value. Add test
cases to verify this. Add new test cases and requirements marks for
complete requirements test coverage on this interface.
drh [Tue, 15 Feb 2022 13:23:09 +0000 (13:23 +0000)]
Improved rendering of floating point numbers without a fractional part in
".dump" output from the CLI.
[forum:/forumpost/550d877659f37cb2|Forum post 550d877659f37cb2].
drh [Mon, 14 Feb 2022 18:18:56 +0000 (18:18 +0000)]
Minor correction to the early corruption detection added by
[a6fda39e81d0da98|check-in a6fda39e81d0da98] so that it works even if
the page being cleared in page 1 of the database.
drh [Fri, 11 Feb 2022 17:33:02 +0000 (17:33 +0000)]
Fix an assert() in the pager by adding "|| CORRUPT_DB", in as much as the
assert() is not necessarily true if the database size in the header is
wrong. dbsqlfuzz f2f996065b90988aa9b0ae425b66dbb296546a08.
drh [Fri, 11 Feb 2022 12:06:37 +0000 (12:06 +0000)]
Fix the bind2.test test script so that it works even if
SQLITE_ENABLE_PREUPDATE_HOOK is not defined.
Fix for test-case breakage from check-in [c006515ae6faff65].
drh [Thu, 10 Feb 2022 21:26:53 +0000 (21:26 +0000)]
Enhance SQLITE_TESTCTRL_LOCALTIME_FAULT so that is able to install an
alternative localtime() interface so that the localtime logic an be better
tested.
drh [Wed, 9 Feb 2022 18:47:09 +0000 (18:47 +0000)]
When process first moves a database into WAL mode and then tries to run
sqlite3_wal_checkpoint() without first performing a transaction, first
try to run a synthesized transaction to get the Pager caught up before
attemptingn the checkpoint.
[forum:/forumpost/fd0f19d229156939|forum post fd0f19d229156939].
dan [Wed, 9 Feb 2022 18:42:15 +0000 (18:42 +0000)]
Fix a problem with using sqlite3_bind_value() with sqlite3_value objects obtained from sqlite3_preupdate_new() when an integer value is written to a column with real affinity.