Fix a heap-corruption causing race condition in os_unix.c that could occur
when one thread wal opening a database file while another is unlocking the
same file. Edit: Let's go in a slightly different direction with this fix.
Closed-Leaf
check-in: 2447e0fd user: dan tags: unix-lock-fix-attempt

Add the "atrc" test program. "Atrc" is short for "ALTER TABLE RENAME COLUMN".
See the header comment on the program itself for further information.
check-in: ed64a55a user: drh tags: alter-table-rename-column

If the new column name in an ALTER TABLE RENAME COLUMN statement is quoted,
then also use quotes for the column name in the edited SQL statements.
check-in: ca5184a2 user: dan tags: alter-table-rename-column

Fix a bug causing all ALTER TABLE RENAME COLUMN commands to fail if ANALYZE
had been run on the database. Also prevent the user from renaming the columns
of system tables.
check-in: ca644a28 user: dan tags: alter-table-rename-column

Reload the entire schema after renaming a column in order to ensure that the
schema for any tables for which parent key definitions were changed are
reloaded.
check-in: f4497b01 user: dan tags: alter-table-rename-column

Fix the isLikeOrGlob() routine in the WHERE clause processing logic so that
it avoids signed/unsigned character comparisons, as that can lead to an
incorrect answer if the ESCAPE clause is an invalid UTF8 string. Problem
found by OSSFuzz.
check-in: 4195a3f8 user: drh tags: trunk

Remove the column-cache from the code generator. The column-cache has been
a persistent source of bugs for years and with recent improvements
in the performance of OP_Column, it no longer provides a benefit. After
the column cache is removed, the binary is almost 2KB smaller and the
speed-check.sh performance test is over 3 million cycles faster.
check-in: cdff3af7 user: drh tags: trunk

Remove a testcase() that is no longer reachable without the column cache.
Provide an assert() to help prove that the testcase is no longer reachable.
Closed-Leaf
check-in: a500893b user: drh tags: omit-column-cache

Ensure that all expressions that are to be evaluated once at the start of
a prepared statement (the Parse.pConstExpr expressions) pass the
sqlite3ExprIsConstantNotJoin() test. It is not sufficient to pass just the
sqlite3ExprIsConstant() test as that would allow through column references
that are bound to constants by the WHERE clause in the constant propagation
optimization. This fixes a problem discovered by OSSFuzz.
check-in: 8bc7f84c user: drh tags: trunk

Completely remove the column cache logic, which has been a persistent source
of bugs for many years. Due to recent enhancements to the performance of the
OP_Column opcode, removing the column cache actually makes speed-check.sh
run faster. Removing the column cache also saves about 1,800 bytes of code space.
check-in: 3f5f60cd user: drh tags: omit-column-cache

Fix the OP_SeekRowid opcode so that it has no type-change side-effects on the
key register in P3. This fixes an obcure problem that arises when doing
equi-joins between a table with a TEXT column against another table with
an INTEGER PRIMARY KEY. The original problem was discovered when OSSFuzz
created such a query and hit an assert() in OP_VerifyTabCol that was
specifically designed to catch these kinds of errors at run-time. Test cases
for this fix are in TH3.
check-in: fa94b49e user: drh tags: trunk

Do not allow a column reference that is converted into a constant by the
WHERE-clause constant propagation optimization to be moved to the init-time
constant expression list, as the table reference will not work there.
This fixes a problem found by OSSFuzz.
check-in: d30b2a94 user: drh tags: trunk

Add assert() statements to sqlite3ExprDelete() that prove various symmetry
properties of the Expr object that might be exploited to make the Expr object
smaller and faster.
check-in: 81f25d5c user: drh tags: expr-simplify

Improvements to the parser to increase coverage. Fix the parser so that
at least one expresssion is required after PARTITION BY and within the
list of expressions on VALUES().
check-in: 02204f8b user: drh tags: trunk

The WHERE-clause constant propagation optimization attempts to use
transitive laws to replace column values with constants in the WHERE
clause in order to help to query planner make more aggressive optimizations.
check-in: f4229707 user: drh tags: trunk

Only run the constant propagation optimization on joins since that is the
only scenario where it is useful. This saves prepare time for the common
case of a simple query.
check-in: 598d6083 user: drh tags: propagate-const-opt

Constant propagation is now restricted to just the WHERE clause. The
mechanism is changed to take affinity and collation into account. This
seems to give correct answers. But the search for constant propagation
costs 4 million cycles in the speed test.
check-in: 82c67efb user: drh tags: propagate-const-opt

Generalize the constant propagation optimization so that it applies on every
WHERE close, not just those that contain a subquery. This then demonstrates
that the current implementation is inadequate since it does not take into
account collating sequences.
check-in: 57eb2abd user: drh tags: propagate-const-opt

In the unix VFS, give every unixInodeInfo object its own mutex, rather
than using the global VFS mutex, to improve concurrency in cases where there
are many threads operating on separate database files.
check-in: 22f47cf4 user: drh tags: trunk

Fix the macros used to generate the output of "PRAGMA compile_options" so that
they handle valid values for the SQLITE_DEFAULT_LOOKASIDE macro (which
contain a "," character).
check-in: 1cc72845 user: dan tags: trunk

Change the SQLITE_Stat34 bit of the optimization test-control so that it
prevents STAT4 data from being used but allows it to be loaded into the
Index objects. This permits STAT4 to be turned on and off on a per-statement
basis.
check-in: 489f3caf user: drh tags: trunk

Experimental change to ANALYZE so that when computing values for
sqlite_stat1, it uses the maximum number for the number of rows
having equivalent values, rather than the average.
Leaf
check-in: 085f17e1 user: drh tags: stat1-max

On an UPSERT when the order of constraint checks is rearranged, make sure
that the affinity transformations on the inserted content occur before
any of the constraint checks. Fix for ticket [79cad5e4b2e219dd197242e9e5f4e].
check-in: d120c45f user: drh tags: trunk

Identify Select objects within a single statement using small sequential
integers rather than "0x%p". This is more readable and yields the same result
on successive runs.
check-in: a7cdc5bc user: drh tags: trunk