dan [Thu, 4 Jul 2019 16:05:26 +0000 (16:05 +0000)]
Fix a race condition that could occur in SQLITE_ENABLE_MEMORY_MANAGEMENT builds when two threads simultaneously open the first two database connections in the process.
Restore the legacy behavior of enabling double-quoted string literals in
all contexts. But also provide a new compile-time option (SQLITE_DQS) to
change the default to something more restrictive.
dan [Wed, 26 Jun 2019 21:04:30 +0000 (21:04 +0000)]
Ensure that when an ephemeral cursor is reopened with a second invocation of to OP_OpenEphemeral, the sequence counter is reset and the cache marked as stale. Fix for [9cdc5c46].
drh [Sun, 16 Jun 2019 14:56:41 +0000 (14:56 +0000)]
Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE.
Instead, transform the uppermost Expr node in the expression tree that
is not of this type. Fix for [e1e07ef2].
dan [Sun, 16 Jun 2019 08:58:14 +0000 (08:58 +0000)]
Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type.
drh [Sat, 15 Jun 2019 15:21:49 +0000 (15:21 +0000)]
Ensure that sqlite3RenameExprUnmap() does an unmap of the result set alias
names in subqueries when ALTER TABLE fails because of a syntax error in a
trigger.
drh [Fri, 14 Jun 2019 17:37:39 +0000 (17:37 +0000)]
Deprecate the SQLITE_ALLOW_COVERING_INDEX_SCAN compile-time option when it is
turned off. This probably will impact no-one. If it does, they will get an
error message instructing them to contact developers, so that we can get
feedback that somebody is actually using this feature. Start-time disabling
of covering index scan is not affected.
drh [Fri, 14 Jun 2019 13:24:46 +0000 (13:24 +0000)]
Fix the implementation of the built-in RTRIM collating sequence so that
it works for control characters at the end of the string.
Ticket [f1580ba1b574e9e9]
drh [Fri, 14 Jun 2019 12:28:21 +0000 (12:28 +0000)]
Refactor the LIKE optimization decision logic so that it uses
sqlite3AtoF() on both boundary keys to determine if the optimization can be
used when the LHS is something that might not have TEXT affinity.
Ticket [ce8717f0885af975]. See also [c94369cae9b561b1],
[b043a54c3de54b28], [fd76310a5e843e07], and [158290c0abafde67].
drh [Tue, 11 Jun 2019 18:07:53 +0000 (18:07 +0000)]
Make sure the affinity of the RHS of an IN operator does not affect the
outcome even if the RHS expression contains a COLLATE clause.
Ticket [57353f8243c637c0]
drh [Tue, 11 Jun 2019 02:43:22 +0000 (02:43 +0000)]
The ALTER TABLE command should not attempt to rename objects that are
contained within an expression tree that has been optimized out because
it is the other branch of an "AND false" expression.
Ticket [533010b8cacebe82]
drh [Mon, 10 Jun 2019 18:33:16 +0000 (18:33 +0000)]
Make sure a CAST to "NUMERIC" results in an integer if the value can be
losslessly expressed as an integer, as the documentation requires.
Ticket [dd6bffbfb6e61db9].
drh [Fri, 7 Jun 2019 22:26:08 +0000 (22:26 +0000)]
When casting string values into numeric and the string has a prefix that looks
like a number but total string is not a well-formed number, then take extra
care that the result is either integer or real depending on what the prefix
looks like. Fix for tickets [e8bedb2a184001] and [4c2d7639f076aa].
drh [Wed, 29 May 2019 17:22:38 +0000 (17:22 +0000)]
Fix the query flattener optimization so that it preserve the "SF_Compound"
bit when flattening a compound subquery into a non-compound outer query.
Failure to preserve that bit could allow subsequent flattenings which are
not valid. Fix for ticket [c41afac34f15781fe09cd].
drh [Wed, 22 May 2019 22:49:23 +0000 (22:49 +0000)]
Renumber the Select.selId values in the copies of SELECT statements that
implement VIEWs when the VIEW is expanded, so that when the same VIEW is
used twice in the same join, each expansion as a distinct selId.
This fixes ticket [ce823231949d3abf42453c8].
drh [Mon, 20 May 2019 18:35:49 +0000 (18:35 +0000)]
A minor variation on check-in [1685610ef8e0dc] which (hopefully) makes the
logic a little easier to follow. Also disallows the use of the double-quoted
string hack in the query expression used for VACUUM INTO, which is not
strictly required, but moves us toward the goal of disallowing the double-quoted
string hack everywhere.
dan [Mon, 20 May 2019 17:14:25 +0000 (17:14 +0000)]
Disallow string constants enclosed in double-quotes within new CREATE TABLE and CREATE INDEX statements. It is still possible to enclose column names in double-quotes, and existing database schemas that use double-quotes for strings can still be loaded. This addresses ticket [9b78184b].
dan [Sat, 18 May 2019 21:22:25 +0000 (21:22 +0000)]
Fix an assert() failure that could occur in a join query if the RHS of an IN() operator is a list containing correlated expressions. This problem was introduced by checkin [e130319317e7611938] which was part of the fix for ticket [787fa716be3a7f650c] - so this commit is part of that ticket's fix too.
dan [Sat, 18 May 2019 19:49:08 +0000 (19:49 +0000)]
Avoid including the comment in the output of "PRAGMA table_info" in situations where there is a comment following a DEFAULT value within a CREATE TABLE statement.
drh [Thu, 16 May 2019 20:36:07 +0000 (20:36 +0000)]
Initialize the 18-byte overrun area on the buffer used to reconstruct
overflow btree cells during a btree search, to avoid a harmless
jump-depends-on-uninit-values warning.
drh [Thu, 16 May 2019 01:22:21 +0000 (01:22 +0000)]
Make sure the OP_Concat opcode always correctly zero-terminates a UTF16
string, even if the input strings are ill-formed. This is a followup to
check-in [3a16ddf91f0c9c516a7] that fixes a case the previous check-in missed.
Also add assert()s to prove correct zero termination.
dan [Tue, 14 May 2019 20:25:22 +0000 (20:25 +0000)]
Fix a problem with the fix for [9cf6c9bb51] (commit [658b84d7]) that could cause a cursor to be left in an invalid state following a (rowid < text-value) search.
drh [Tue, 14 May 2019 00:43:13 +0000 (00:43 +0000)]
Disable index seek optimizations on REINDEX when the order of primary keys
in the index differs from the main table.
Fix for ticket [bba7b69f9849b5bf11b4].
drh [Sat, 11 May 2019 19:36:03 +0000 (19:36 +0000)]
A new implementation for the sqlite3ExprImpliesExpr() theorem prover that
does a better job of answering TRUE to "(NOT A) OR B" when B is a NOT NULL
expression.