Detect oversized strings in the OP_String opcode even if the P4 argument
is originally UTF8 and has to be converted to UTF16 to match the database
file and that conversion causes the string to become shorter and cross
below SQLITE_LIMIT_LENGTH threshold. This might fix an OSSFuzz problem
that we have been so far unable to reproduce.
Leaf
check-in: c13d5639 user: drh tags: trunk

Progress handler improvements:
(1) Invoke the callback after OP_Program opcodes
(2) Invoke the callback multiple times in a row to catch up after a
long run of no progress checks.
check-in: 0c5db18d user: drh tags: trunk

When an IN operator drives a query loop, mark it as "CODED" so that it
will not be used afterwards for a (pointless) membership test. This is
a better fix for ticket [df46dfb631f75694] than the previous fix that is
now on a branch as it preserves the full optimization of
check-in [e130319317e76119].
check-in: fa792714 user: drh tags: trunk

Back off the optimization of check-in [e130319317e76119] slightly so that
it only applies to IN operators that are used for membership tests.
Proposed fix for ticket [df46dfb631f75694].
Closed-Leaf
check-in: b5f90bfe user: drh tags: tkt-df46dfb631

Fix a potential memory leak in RBU if the rbu_fossil_delta() SQL function is
misused. Misuse never happens in a working RBU system, so this is not a
particularly important fix.
check-in: 12517d1b user: drh tags: trunk

Enhance the virtual table in test_schemapool.c so that it can be used to check that SHARED_SCHEMA connections are not allocating and freeing schemas when they should not be.
check-in: cb236cb9 user: dan tags: reuse-schema

Fix a problem with eponymous virtual tables and SHARED_SCHEMA databases. Also, after preparing statements that require all database schemas (REINDEX, ANALYZE, CREATE, DROP and some PRAGMA statements), do not allow the database connection to return more than one schema to each schema-pool.
check-in: ecf6251e user: dan tags: reuse-schema

Revert the rearrangement of VDBE code in [219b39e14] so that vdbe.c matches trunk. Since the new call to sqlite3Init() in OP_ParseSchema was removed, the rearrangement no longer provides any performance advantage.
check-in: 03c4f003 user: dan tags: reuse-schema

Enhancement the progress callback mechanism so that the progress callback
is always invoked at least once at the end of a prepared statement if the
opcode count has been exceeded. This makes the progress callback more
effective at limiting run times. This check-in also includes and unrelated
performance enhancement to OP_Column.
check-in: 68cce272 user: drh tags: trunk

Change an assert() into a NEVER(), since the condition is difficult to prove
with certainty. Improved comment on the MemPage.nFree field.
Closed-Leaf
check-in: fec071b8 user: drh tags: deferred-free-space

Defer computing the MemPage.nFree value of an in-memory btree page
until it is actually needed, since for many pages it is never needed.
This checkin works sufficiently to prove the concept, but still has issues
with exception handling.
check-in: 1d43ee40 user: drh tags: deferred-free-space

Change the sqlite3VdbeMemGrow() routine so that it no longer guarantees a
minimum size of 32 bytes. That minimum is no longer required, and without
the extra check for the minimum size, the routine runs faster.
check-in: 5c499da8 user: drh tags: trunk

Give the sqlite3 object a pointer to the current Parse so that if an OOM
occurs, it can automatically set the Parse.rc value to SQLITE_NOMEM. This
avoids a frequent extra test of db.mallocFailed in the innermost parser loop.
check-in: 5c663804 user: drh tags: trunk

Do not do the optimization that attempts to pull expression values from
an index on that expression when processing a multi-index OR
(see check-in [a47efb7c8520a0111]) because the expression transformations
that are applied become invalid when the processing moves off of the current
index and on to the next index. Fix for ticket [4e8e4857d32d401f].
check-in: 440a7cda user: drh tags: trunk

When extending the size of SrcList objects, do not attempt to use
extra space on the end of the allocation, as that provides scarcely any
performance benefit but does greatly complicate cross-platform testing.
check-in: 3087a0c3 user: drh tags: trunk

Back out check-in [008112bcef561a8], reenabling deprecated PRAGMAs when the
SQLITE_OMIT_DEPRECATED compile-time option is used, because way too many
TH3 tests depend on those deprecated PRAGMAs.
check-in: 9dbf512d user: drh tags: trunk

Slight adjustment to the printf formatter large memory allocation detector
so that it does not overestimate the amount of space needed for
oversize %d conversions.
check-in: 1aee70d6 user: drh tags: trunk

Prevent the printf formatter from doing large memory allocations - larger
than either the size of the static buffer for interfaces like
sqlite3_snprintf(), or larger than SQLITE_LIMIT_LENGTH for interfaces that
are associated with a database connection. This helps to prevent DOS
attacks on products that let hostile sources inject arbitrary SQL. It also
helps fuzzers run faster and more effectively.
check-in: 179e5d46 user: drh tags: trunk

Add the SQLITE_CONFIG_MEMDB_MAXSIZE configuration option for configuring
the default maximum size of an in-memory database created using
sqlite3_deserialize(). This is necessary to make the interface reasonably
testable.
check-in: cb72ee04 user: drh tags: trunk

If the amalgamation file "sqlite3.c" is generated using the
SQLITE_ENABLE_UPDATE_DELETE_LIMIT option, but then subsequently (mis-)compiled
without that option, and then a particular syntax error could cause
a memory leak, but for this fix.
check-in: 1bb17c86 user: drh tags: trunk

Improvements to the ".eqp trace" command in the CLI so that it ensures that
the schema has been read prior to activing the tracing feature, to avoid
cluttering the output with a trace of the schema parse.
check-in: 42687d45 user: drh tags: trunk

Update fuzzcheck so that with the --load-dbsql options it screens its
inputs to ensure that they are valid dbsqlfuzz cases. Add new dbsqlfuzz
finds to the test/fuzzdata8.db database.
check-in: 004f7d9b user: drh tags: trunk

Add the ".eqp trace" command to the CLI when using SQLITE_DEBUG, as a
convenient shorthand for "PRAGMA vdbe_debug=ON" but with automatic indentation
feature for program listings provided by the CLI.
check-in: 626502fa user: drh tags: trunk

Reinitialize debugging information on registers of a trigger prior to each
invocation of the trigger. This prevents false-positives from the
sqlite3VdbeMemAboutToChange() test logic.
check-in: 98b3b975 user: drh tags: trunk

While PRAGMA full_column_names is off (the default) do not make changes to
the short_column_names pragma when computing the column names for subqueries.
Leaf
check-in: 718ead55 user: drh tags: literal-column-names

Fix problems with sub-selects in WINDOW definitions. Also rename-column operations when the column being renamed appears in a WINDOW definition that is part of a VIEW or TRIGGER.
check-in: 0387cb3a user: dan tags: trunk