SQLite

View Ticket
Login
2019-06-14
12:28
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]. (check-in: b4a9e09e user: drh tags: trunk)
2019-06-10
15:35 Closed ticket [fd76310a]: TEXT value interpreted as column name in an index with empty list in an IN expression plus 5 other changes (artifact: f453906c user: dan)
15:34
Handle renaming a column or table when the schema contains a (meaningless) index on the constant expression ('text' IN ()) or ('text' NOT IN()). Fix for [fd76310a]. (check-in: 567b1309 user: dan tags: trunk)
13:46
Do not attempt the LIKE optimization on a column with numeric affinity if the rhs of the operator begins with whitespace. Fix for ticket [fd76310a5e]. (check-in: 94b58ab0 user: dan tags: trunk)
00:14 New ticket [fd76310a] TEXT value interpreted as column name in an index with empty list in an IN expression. (artifact: 683171cb user: mrigger)

Ticket Hash: fd76310a5e843e074a30ed98b859dd0be11d0276
Title: TEXT value interpreted as column name in an index with empty list in an IN expression
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Code_Generator Resolution: Fixed
Last Modified: 2019-06-10 15:35:32
Version Found In:
User Comments:
mrigger added on 2019-06-10 00:14:49:

Consider the following case:

CREATE TABLE t0(c0);
CREATE INDEX i0 ON t0('1' IN ());
ALTER TABLE t0 RENAME TO t1; -- error in index i0: no such column: 1

It seems that the empty list on the right side of the IN operator causes '1' to be interpreted as a column name during the ALTER TABLE statement, but not when the index is created, thus resulting in an error when renaming the table.