Fix an incorrect comment and possible integer overflow in pager
resulting from check-in [23ca23894af352ea]. Problem reported by
[forum:/forumpost/e2ea1a3f61|forum post e2ea1a3f61]. Also change
the datatype of Pager.pageSize to i64 even though page size never
exceeds 65536, in order to help prevent future problems of this kind.
Back out changes [00286ca5d998d802] and [6844ede29e1dac93] (replacing the
associated branches with NEVER()) and add a single new test to
btreeOverwriteCell() that detects when an overflow pages is also mapped
into a b-tree page and raises and immediate SQLITE_CORRUPT error before
making any changes.
dbsqlfuzz 81791bd980fe6935ff2c7334ec8bef11c1c12b82 and others.
Fix a potential NULL pointer deference in the LIKE optimization. The
problem was introduced by the addition of generated columns
in check-in [b855acf1831943b3] (SQLite version 3.31.0, 2020-01-22).
Reported by Wang Ke in
[forum/forumpost/699b44b3ee|forum post 699b44b3ee].
drh [Tue, 24 Aug 2021 17:07:44 +0000 (17:07 +0000)]
Correctly preserve the collating sequence for a column when changing
its datatype. Fix for the problem reported by
[forum:/forumpost/e5c76b738e|forum post e5c76b738e]. Test cases
in TH3.
drh [Mon, 23 Aug 2021 10:28:02 +0000 (10:28 +0000)]
Back out the change that allows typeless columns in strict tables. Replace
that capability with an ANY type for strict tables that will accept any
datatype with BLOB affinity.
drh [Sat, 21 Aug 2021 16:42:58 +0000 (16:42 +0000)]
Defer deleting subqueries in the compound-SELECT code generator until the
end of code generation, in order to avoid deleting expressions out from under
the aggregation function sanity checking assert()s that occur near the
end of SELECT code generation. This fixes the assertion fault described by
[forum:/forumpost/cfcb4b461d|forum post cfcb4b461d].
drh [Fri, 20 Aug 2021 15:44:48 +0000 (15:44 +0000)]
Support for STRICT tables. A table with the STRICT option only allows a few
core datatypes on columns and enforces those types rigidly. Also, PRIMARY KEY
columns must be NOT NULL.
drh [Wed, 18 Aug 2021 19:22:27 +0000 (19:22 +0000)]
Trying to insert an incorrect datatype into a STRICT table raises an
SQLITE_CONSTRAINT_DATATYPE error. Seems to work, though lots more testing
is needed.
drh [Wed, 18 Aug 2021 13:13:58 +0000 (13:13 +0000)]
What would it be like if you could add the keyword "STRICT" after a CREATE
TABLE statement to cause the table to (1) allow only a few well-defined
datatypes, (2) rigidly enforce those types, (3) require NOT NULL on PK
columns, (4) always enforce foreign key constraint, and so forth? This
branch seeks to explore that question.
drh [Tue, 17 Aug 2021 19:59:09 +0000 (19:59 +0000)]
Fix an off-by-one error in the error-handling logic of the Lemon
parser-generator. This does not affect SQLite.
[forum:/forumpost/cff80737bf|Forum cff80737bf].
dan [Thu, 12 Aug 2021 14:22:30 +0000 (14:22 +0000)]
By default, do not use memory mapping to access the temporary files used for external sorts. The old behaviour (to use memory mapping by default) may be restored by building with SQLITE_ENABLE_SORTER_MMAP defined.
drh [Wed, 11 Aug 2021 18:43:54 +0000 (18:43 +0000)]
During DELETE, if an index entry is missing, do not raise the
SQLITE_CORRUPT_INDEX error (added by [f339f31f9e9a856b]) if in
"PRAGMA writable_schema=ON" mode.
drh [Wed, 11 Aug 2021 13:48:56 +0000 (13:48 +0000)]
Do not apply the push-down optimization to CTE subqueries that will be
reused in other contexts in where the same optimization is unlikely to
be valid. Fix for the bug reported by
[forum:/forumpost/d496c3d29bc93736|forum post d496c3d29bc93736].
drh [Mon, 9 Aug 2021 17:37:58 +0000 (17:37 +0000)]
Undocumented "--threadsafe N" option added to the CLI for testing purposes.
One of SQLITE_CONFIG_SINGLETHREAD, _MULTITHREAD, or _SERIALIZED is called
depending on the value of the N integer.
drh [Thu, 5 Aug 2021 15:27:19 +0000 (15:27 +0000)]
Store the collating sequence name for each column of a table as an
extension to the column name, for an additional savings in the heap space
needed to hold the schema.
drh [Wed, 4 Aug 2021 13:42:12 +0000 (13:42 +0000)]
Always prefer built-in SQL functions over app-defined SQL functions within
sqlite3NestedParse(). Formerly this was the case for a few calls to
sqlite3NestedParse(), but not for all of them.
dan [Wed, 4 Aug 2021 11:29:18 +0000 (11:29 +0000)]
Avoid using LIKE with the target db in RBU. It is possible the user may issue "PRAGMA case_sensitive_like = 1" or override the like() user function, causing RBU to malfunction.
Recognize certain standard datatypes ("INT", "INTEGER", "REAL", "TEXT", and
"BLOB") and if a column has one of those datatypes, store the type part of
the bit-field information in the Column structure to save space.
If a generated column uses the optional keywords GENERATE ALWAYS, try to avoid
putting those keywords in the typename of the column.
[forum:/forumpost/ff3ffe09251c105b|Forum post ff3ffe09251c105b]
Minor tweaks to various TCL build scripts so that they work even for TCL 8.4,
which is obsolete, but is also all that is available for some legacy platforms.
Remove ALWAYS() macros that can be true if the internal test function
implies_nonnull_row() is used in the result set of a query and contains
comparison operator against a computed column.
dbsqlfuzz 4c34db5bff6247f33ee49e341a1f3018e72be0a0.
Enhance the CLI with the ".connection" command that can switch between
up to five different database connections. Used for manual testing of multiple
database connections in the same process.
Set the checkSchema flag if a CREATE TABLE parse fails because the table
already exists, to ensure that the table was not previously deleted by
some other connection.
Fix ALTER TABLE DROP COLUMN so that it generates valid bytecode even when
operating on a corrupt database and using PRAGMA writable_schema=ON.
dbsqlfuzz 5f09e7bcc78b4954d06bf9f2400d7715f48d1fef
One of the optimizations of check-in [de9c86c9e4cdb34f] does not work for
terms originating in the ON/USING clause, as demonstrated by
[forum:/forumpost/6cf3bb457c3f4685|forum post 6cf3bb457c3f4685]. This
check-in disables that optimization for ON/USING terms. Also improve the
TreeView display for the resulting "true"/"false" nodes to show that they
originate from the ON/USING clause. Add a testcase() to the other optimization
to show that it can still be used for ON/USING terms.
Improved robustness of cursor renumbering in the UNION ALL flattener
when operating on vector assignments of an UPDATE FROM.
dbsqlfuzz 417d2b053b9b3c9edaf22dd515564f06999e029c
Run a "PRAGMA quick_check", if necessary, on the modified table after
an ALTER TABLE ADD COLUMN to verify that added NOT NULL or CHECK constraints
are satisfied by existing rows. Abort the ADD COLUMN if not.
[forum:/forumpost/c04814903d6ec4f7|Forum post c04814903d6ec4f7].