When generating individual loops for each ORed term of an OR scan, move any
constant WHERE expressions outside of the loop, as is done for top-level
loops.
(Closed-Leaf
check-in: e4a022be user: dan tags: or-optimization)

Ensure that the query planner knows that any column of a flattened LEFT JOIN
can be NULL even if that column is labeled with "NOT NULL".
Fix for ticket [892fc34f173e99d8].
(check-in: 48346268 user: dan tags: trunk)

Rework the code in ctime.c a bit to report on more compile time options. And
to only output configuration options passed in to SQLite, not the default
values of #define symbols set automatically. Also generate the large array in
ctime.c using new script tool/mkctime.tcl, instead of entering it manually.
(check-in: 9a443397 user: dan tags: trunk)

Ensure that the value of the THREADSAFE symbol is always included when
reporting compile time options, even if it was not explicitly configured.
(Closed-Leaf
check-in: 95141c64 user: dan tags: ctime-refactor)

Rework the code in ctime.c a bit to report on more compile time options. And
to only output configuration options passed in to SQLite, not the default
values of #define symbols set automatically. Also generate the large array in
ctime.c using new script tool/mkctime.tcl, instead of entering it manually.
(check-in: bc1951d6 user: dan tags: ctime-refactor)

Move the "shell_add_schema()" SQL function used by the ".schema" command
of the command-line shell to a different spot in the shell.c source file
so that it is not in the middle of an unrelated module.
(check-in: 254617a1 user: drh tags: trunk)

Fix an off-by-one error that messes up the display of loop codes in the
".wheretrace" debugging output for queries with more than 62 candidate
loops when SQLITE_ENABLE_WHERETRACE is on.
(check-in: 0bbdaf28 user: drh tags: trunk)

Ensure pointer map entries are always added when a row that does use overflow
pages replaces one that does not in an auto-vacuum database. Fix for
[fda22108].
(check-in: b30dfba8 user: dan tags: trunk)

Add the SQLITE_STMTSTATUS_MEMUSED option for sqlite3_stmt_status() that reports
the amount of heap memory used for a single prepared statement.
(Closed-Leaf
check-in: b57d5104 user: drh tags: stmtstatus-memused)

Change sqlite3BtreeNext() and sqlite3BtreePrevious() so that they return
SQLITE_DONE if they have already reached the end (or beginning) of the table.
This gives a performance increase and size reduction.
(check-in: e972a386 user: drh tags: trunk)

Correctly initialize the iSelectId of FROM clause terms that are a self
join of a reused materialized subquery. Without this, the EXPLAIN QUERY PLAN
output for the query will identify the subquery using the uninitialized
(and arbitrary) iSelectId.
(check-in: 43c9ae37 user: drh tags: trunk)

The SQLITE_EXTRA_IFNULLROW compile-time option causes OP_IfNullRow opcodes
to be issued for references to the right-hand side table of *any* flattened
join, not just LEFT JOINs. This puts extra stress on the OP_IfNUllRow opcodes
for testing purposes.
(check-in: 1a074c8a user: drh tags: branch-3.19)

Ensure that the expression rewriter inside the query flattener decends into
the substructure of the TK_IF_NULL_ROW operator. This is a continuation
of the fix for ticket [cad1ab4cb7b0fc344].
(check-in: 28d2902d user: drh tags: branch-3.19)

Ensure that the expression rewriter inside the query flattener decends into
the substructure of the TK_IF_NULL_ROW operator. This is a continuation
of the fix for ticket [cad1ab4cb7b0fc344].
(check-in: 941d8142 user: drh tags: trunk)

Remove a surplus semicolon, which was harmless on gcc and clang but caused
compile-time errors on msvc. This only comes up using the encryption extension.
(check-in: 4510d55d user: drh tags: branch-3.19)

When flattening a query, make sure iTable attribute of TK_IF_NULL_ROW
operators (that result from a prior flattening of a LEFT JOIN) are updated
correctly. Fix for ticket [cad1ab4cb7b0fc344].
(check-in: 919d36e6 user: drh tags: branch-3.19)

When flattening a query, make sure iTable attribute of TK_IF_NULL_ROW
operators (that result from a prior flattening of a LEFT JOIN) are updated
correctly. Fix for ticket [cad1ab4cb7b0fc344].
(check-in: 92c17850 user: drh tags: trunk)

Fix a case where NULL was being passed to memcmp() following an OOM. This is
probably not a real problem, as the number-of-bytes parameter was passed 0 in
this case, but it was causing a santizer complaint.
(check-in: 3ea2bad2 user: dan tags: trunk)