Add a missing OP_ColumnsUsed opcode to code for expressions like "? IN (SELECT ...)" in cases where expression can use an index that may contain NULL values.
(Backported fix from version 3.14.0).
Leaf
check-in: 11368e67 user: drh tags: branch-3.8.9

Add the OP_ColumnsUsed opcode (when compiled with
SQLITE_ENABLE_COLUMN_USED_MASK) as a hint to the b-tree layer as to which
columns of a btree cursor will be used.
(Backport from 3.8.11)
check-in: b29e02f8 user: drh tags: branch-3.8.9

Enable the ".wheretrace" and ".selecttrace" options in the shell when
configure is run using --enable-debug. This mirrors a similar change
that has already occurred on trunk.
Leaf
check-in: c4f798b2 user: drh tags: branch-3.9.2

Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with
views and WITHOUT ROWID tables. This is a modified cherrypick of [dae4a97a].
check-in: b2679d3b user: dan tags: branch-3.8.9

Disallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID
tables. This is a temporary fix for ticket [d4beea1633f1b88f] until a better
solution can be found.
check-in: 30aa941f user: drh tags: branch-3.8.9

Add new interfaces sqlite3_result_pointer(), and
sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
pointer to the snippet() and offsets() routines. This changes is a
cherry-pick of [f0f49224] with version-specific edits. That check-in was
inspired by check-in [72de49f2].
check-in: 69906880 user: drh tags: branch-3.9.2

Add new interfaces sqlite3_result_pointer(), and
sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
pointer to the snippet() and offsets() routines. This is a cherry-pick
of [f0f49224] which was in turn inspired by [72de49f2].
Leaf
check-in: 5a3022e0 user: drh tags: branch-3.8.10

Add new interfaces sqlite3_result_pointer(), and
sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
pointer to the snippet() and offsets() routines. This is a cherry-pick
of [f0f492245e95], which is in turn inspired by check-in [72de49f2].
Leaf
check-in: a66a5b39 user: drh tags: branch-3.8.6

Try to push relevant WHERE clause terms of the outer query down
into the subquery in order to help the subquery run faster and/or
use less memory. This is a cherry-pick of [6df18e949d36] with
bug fixes.
check-in: cd6ac078 user: drh tags: branch-3.8.9

When checking for the WHERE-clause push-down optimization, verify that
all terms of the compound inner SELECT are non-aggregate, not just the
last term. Fix for ticket [f7f8c97e97597].
Closed-Leaf
check-in: adc082c1 user: drh tags: push-down-backport

Do not apply the WHERE-clause pushdown optimization to terms that originate
in the ON or USING clause of a LEFT JOIN. Fix for ticket
[c2a19d81652f40568c].
check-in: 52674f94 user: drh tags: push-down-backport

For FROM-clause subqueries that cannot be flattened, try to push relevant
WHERE clause terms of the outer query down into the subquery in order to help
the subquery run faster and/or use less memory.
Cherry-pick from [6df18e949d36]. Still need to backport bug fixes associated
with that check-in.
check-in: 043d6ce8 user: drh tags: push-down-backport

Only do the specialized MacOS single-core zone_malloc initialization if
compiled with the SQLITE_MIGHT_BE_SINGLE_CORE flag. This avoids a (harmless)
warning about OSAtomicCompareAndSwapPtrBarrier() being deprecated.
check-in: 4e6a03d9 user: drh tags: trunk

Set a reasonable limit on the number of opcodes in a prepared statement
for ossfuzz.c. This should prevent timeouts in OSS-Fuzz when it generates
totally unreasonable queries.
check-in: f74899ed user: drh tags: trunk

Fix a problem in the enhanced PRAGMA integrity_check where it verifies
CHECK constraints: Do not be confused by the reuse of the Table.pCheck field
by VIEWs with named columns. Problem discovered by OSS-Fuzz.
check-in: 019dd3d5 user: drh tags: trunk

If the user has not set it explicitly, set the "PRAGMA synchronous" setting to
SQLITE_DEFAULT_SYNCHRONOUS when a database connection changes from wal to
rollback journal mode.
check-in: 5c604479 user: dan tags: trunk

If the user has not set it explicitly, set the "PRAGMA synchronous" setting to
SQLITE_DEFAULT_SYNCHRONOUS when a database connection changes from wal to
rollback journal mode.
check-in: 78030c0f user: dan tags: default-synchronous-fix

Infrastructure for an extension C-library to implement sqlite3_db_dump() and
a corresponding "dbdump" command-line utility - both of which do the same
work as the ".dump" command of the CLI.
check-in: 74c5ace4 user: drh tags: dbdump

In the output of the ".dump" command in the CLI, quote newline and
carriage-return characters using the char() function, so that they do not
get eaten by end-of-line processing logic in the OS or in other command-line
utilities and/or libraries.
check-in: 68f6dc7a user: drh tags: trunk

In the OSSFuzz test module, invoke the progress handler much more frequently
so that timeouts are detected punctually even if the test script is running
opcodes that individually take a long time (for example, an OP_Function opcode
that invokes "randomblob(1.5e6)").
check-in: f3b6959c user: drh tags: trunk

Make sure the translateColumnToCopy() routine in the query planner does not
try to access an array that failed to be fully allocated due to a prior OOM.
This fixes an issue discovered by OSSFuzz.
check-in: 3299a261 user: drh tags: trunk

Fix an error in the SQLITE_MAX_MEMORY implementation resulting from a bad
merge. Update the OSSFuzz interface so that it times out after running
the byte-code engine for 10 seconds.
check-in: f8560c60 user: drh tags: trunk

Improvements to ".selftest --init". Tests are number in increments of 10
starting with 100. The tests are generated inside a SAVEPOINT. Errors are
reported during test generation. Tests can be appended to existing tests.
Add a test case to verify the schema.
check-in: b044b152 user: drh tags: trunk

Remove the test/dbselftest.c program. In its place, add the ".selftest"
command to the CLI. The new CLI version is .selftest is slightly different
in that it uses SHA3 hashing instead of SHA1, so the new is subtly
incompatible with the old.
check-in: f4fcd46f user: drh tags: trunk

Add the --recovery-mode option to the CLI ".dump" command. This involves
enhancing the "PRAGMA reverse_unordered_selects" command to accept a "TOGGLE"
option. Recovery mode used to be always on. Now it is opt-in. Not sure this
is the correct approach. Also not sure if TOGGLE is a good feature to have
on boolean PRAGMA statements.
Closed-Leaf
check-in: 5dc82a15 user: drh tags: dump-recovery

Refactor the output logic in the CLI. Not sure we want to go this way. Just
saving the work for historical reference, or in case I decide to come back
to it.
Leaf
check-in: aacac906 user: drh tags: shell-print-refactor

In the ".sha3sum" command, if there is a LIKE pattern, show the hashes for
each table separately. Without a LIKE pattern, show a single hash over the
entire database.
check-in: 30f87883 user: drh tags: trunk

Before beginning an incremental checkpoint in RBU, sync the directory
containing the target database file. This ensures that the new directory entry
created by renaming the *-oal file to *-wal is synced to disk. Cherrypick of
[915a9a28].
Leaf
check-in: 694fe0b2 user: dan tags: version-3.17.0-rbu-fixes

Fix another RBU case similar to the previous. This one for systems where the
sector-size is larger than the page-size. Cherrypick of [4012bb3a].
check-in: 59a11b7f user: dan tags: version-3.17.0-rbu-fixes

When saving the state of an RBU update in the incremental-checkpoint phase,
sync the database file. Otherwise, if a power failure occurs and the RBU
update resumed following system recovery, the database may become corrupt.
Cherrypick of [edee6a80].
check-in: 811a5599 user: dan tags: version-3.17.0-rbu-fixes

If a reprepare is needed after binding to a variable with a number larger
than 32, set only the high-order bit of the Vdbe.expmask rather than setting
all bits. This could potentially result in fewer false-positive reprepares.
check-in: 45797fee user: drh tags: trunk

Before beginning an incremental checkpoint in RBU, sync the directory
containing the target database file. This ensures that the new directory entry
created by renaming the *-oal file to *-wal is synced to disk.
check-in: 915a9a28 user: dan tags: trunk

When saving the state of an RBU update in the incremental-checkpoint phase,
sync the database file. Otherwise, if a power failure occurs and the RBU
update resumed following system recovery, the database may become corrupt.
check-in: edee6a80 user: dan tags: trunk

Add an sqlite3_set_last_insert_rowid() method. Use it to work around fts4 and
fts5 modifying the last-insert-rowid unintuitively from within commit
processing.
Closed-Leaf
check-in: fe41bb56 user: dan tags: set-last-insert-rowid

Change the name of the analyze_as_needed pragma to "optimize". Enhance the
comment (which will become documentation, assuming these changes land on trunk)
to explain that the optimize pragma is likely to be enhanced in various ways
in future releases and that applications should not depend upon the current
behavior.
check-in: 9fced545 user: drh tags: auto-analyze

Fix integrity_check so that it verifies NOT NULL constraints even for tables
that have no indexes. Enhance quick_check so that it verifies NOT NULL and
CHECK constraints.
check-in: 5264844b user: drh tags: integrity-check-improvements

The VDBE cycle counts for the sqlite3_progress_handler() callback are now
cumulative. Leftovers from the previous statement are applied to the next
statement.
Leaf
check-in: 7a62fc6a user: drh tags: cumulative-progress-count

Avoid unsigned integer overflows for SQLITE_WIN32_HEAP_INIT_SIZE when the Win32 heap subsystem is used with very large values of SQLITE_DEFAULT_CACHE_SIZE and/or SQLITE_DEFAULT_PAGE_SIZE.
check-in: 96b6a98e user: mistachkin tags: trunk

Add an optimization to OP_Column to speed up sequential OP_Column
instructions that read earlier fields from the same cursor. Attempt to reorder
OP_Column opcodes so as to take advantage of this.
Leaf
check-in: c1adf959 user: dan tags: sort-column-opcodes

Set the TF_StatsUsed flag on tables when the query planner outcome is
affected by the sqlite_stat1 data. Also, change the column names of the
"PRAGMA stats" command so that they are not keywords.
check-in: fb2b8ae8 user: drh tags: auto-analyze

Enhance the Index and Table objects so that they remember if their stats come
from the sqlite_stat1 table. Make the "PRAGMA stats" an SQLITE_DEBUG only
pragma. Add the flags column to "PRAGMA stats". These are all preliminary
steps toward a "PRAGMA analyze_ifneeded;" feature.
check-in: 85026c8e user: drh tags: auto-analyze

Fix a test case that was made to fail by the LIKE optimization enhancement
in check-in [158290c0ab] but which went unnoticed because test builds were
running with ICU enabled and ICU disables the LIKE optimization.
check-in: 218b2bbb user: drh tags: trunk

Enable the ".wheretrace" and ".selecttrace" extensions in the command-line
shell when compiled on Windows using DEBUG=3 or higher. Fix a harmless
warning in the shell that comes up when compiled this way.
check-in: 8a03be1d user: drh tags: trunk

Bummer. Checked this in as a branch off of the wrong branch.... Was:
Add the companion "carray_asc" table-valued function to the carray extension.
Closed-Leaf
check-in: 396b9d99 user: drh tags: mistake

Remove the CLANG_VERSION macro, since we have learned that version numbers in
clang are "marketing" and are inconsistent and unreliable. Builds using clang
will still use the GCC_VERSION macro since clang works hard to be gcc
compatible.
check-in: 8d3f485d user: drh tags: branch-3.17

Remove the CLANG_VERSION macro, since we have learned that version numbers in
clang are "marketing" and are inconsistent and unreliable. Builds using clang
will still use the GCC_VERSION macro since clang works hard to be gcc
compatible.
check-in: 810d2932 user: drh tags: trunk

Enhance the LIKE optimization so that it works for arbitrary expressions on
the LHS as long as the pattern on the RHS does not begin with a digit or
a minus sign.
check-in: 158290c0 user: drh tags: trunk

Cleanup the usage of the SQLITE_DISABLE_INTRINSIC compile-time option.
Remove the SQLITE_RUNTIME_BYTEORDER compile-time option. Use
-DSQLITE_BYTEORDER=0 instead. Fix a bug in R-Tree that occurs when compiling
on a known little-endian machine without the use of intrinsic byteswapping
functions.
check-in: 798fb9d7 user: drh tags: trunk