1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

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].

FossilOrigin-Name: 94b58ab059cba9771e75f16d1460f313104a8fb879f9f8805725d362aa58cbcd
This commit is contained in:
dan
2019-06-10 13:46:42 +00:00
parent 55700bcd72
commit 32d0f64e8d
4 changed files with 35 additions and 15 deletions

View File

@ -17,6 +17,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix like
# Create some sample data to work with.
#
@ -1095,4 +1096,22 @@ do_execsql_test like-15.121 {
} {/SEARCH/}
}
#-------------------------------------------------------------------------
# Tests for ticket [b1d8c79314].
#
reset_db
do_execsql_test 16.0 {
CREATE TABLE t1(a INTEGER COLLATE NOCASE);
CREATE INDEX i1 ON t1(a);
INSERT INTO t1 VALUES(' 1x');
INSERT INTO t1 VALUES(' 1-');
}
do_execsql_test 16.1 {
SELECT * FROM t1 WHERE a LIKE ' 1%';
} {{ 1x} { 1-}}
do_execsql_test 16.2 {
SELECT * FROM t1 WHERE a LIKE ' 1-';
} {{ 1-}}
finish_test