]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix another pattern for which the LIKE optimization does not work for a
authordrh <drh@noemail.net>
Wed, 8 May 2019 19:55:24 +0000 (19:55 +0000)
committerdrh <drh@noemail.net>
Wed, 8 May 2019 19:55:24 +0000 (19:55 +0000)
non-TEXT affinity.  Case found by Manuel Rigger.

FossilOrigin-Name: 740201107ae802c12b678e388ea524db01ad0eb70601c78490ad63eae0fe6cf1

manifest
manifest.uuid
src/whereexpr.c
test/like3.test

index 536e47c4343cd54c06e840bae2fa52497617d3f3..cb3c9fbe3a946ed76e3743a6b8a3b60511440e8f 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Simplification\sto\sthe\slogic\sunderlying\sPRAGMA\scase_sensitive_like.
-D 2019-05-08T19:32:33.786
+C Fix\sanother\spattern\sfor\swhich\sthe\sLIKE\soptimization\sdoes\snot\swork\sfor\sa\nnon-TEXT\saffinity.\s\sCase\sfound\sby\sManuel\sRigger.
+D 2019-05-08T19:55:24.788
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -610,7 +610,7 @@ F src/walker.c 7607f1a68130c028255d8d56094ea602fc402c79e1e35a46e6282849d90d5fe4
 F src/where.c 99c7b718ef846ac952016083aaf4e22ede2290beceaf4730a2df55c023251369
 F src/whereInt.h 5f14db426ca46a83eabab1ae9aa6d4b8f27504ad35b64c290916289b1ddb2e88
 F src/wherecode.c 37a1004237d630d785c47bba2290eac652a7a8b0047518eba3cb7c808b604c4a
-F src/whereexpr.c 7fedf990999722dafda5ab8040feac93937a6f95f4671d8d629f2baf014b4b80
+F src/whereexpr.c 3a8abba627bffcd930c181bbd78cf5d31c5ef496126d49d0ba94874db16efa33
 F src/window.c 038c248267e74ff70a2bb9b1884d40fd145c5183b017823ecb6cbb14bc781478
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
@@ -1091,7 +1091,7 @@ F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
 F test/lemon-test01.y 58b764610fd934e189ffbb0bbfa33d171b9cb06019b55bdc04d090d6767e11d7
 F test/like.test 11cfd7d4ef8625389df9efc46735ff0b0b41d5e62047ef0f3bc24c380d28a7a6
 F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
-F test/like3.test b065d1ca38c03dd76caae1d4cc84ed3d6eb3f64b3ff6b0dfad6413a7b406cca4
+F test/like3.test ac61947ef35bde9d97718bcfa04659a17d9218f1fffc4104b135b3f82ed43836
 F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
 F test/limit2.test 9409b033284642a859fafc95f29a5a6a557bd57c1f0d7c3f554bd64ed69df77e
 F test/loadext.test faa4f6eed07a5aac35d57fdd7bc07f8fc82464cfd327567c10cf0ba3c86cde04
@@ -1825,7 +1825,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 8658574e3f435f03a87c04f398bd05078ebc53ecb4a477d3b24902d701d935c4
-R 2a03805a01d2e55ce8878d993088a328
+P ef0015fde4c87e992ffd3d7dea8586951bdd65ff98d30d436b126b85b1cc9c74
+R 76ed0b382d531a90e41c3e087ed11622
 U drh
-Z c59eafe33a9b24be06876b542e867244
+Z e9e0cda4b886af13a74fd7aa63325365
index 572c921e66c0f913d2157785586ca4aae0973c53..14f3592fe1a2cea5ccf674c5b5dd1a30e9fbbc84 100644 (file)
@@ -1 +1 @@
-ef0015fde4c87e992ffd3d7dea8586951bdd65ff98d30d436b126b85b1cc9c74
\ No newline at end of file
+740201107ae802c12b678e388ea524db01ad0eb70601c78490ad63eae0fe6cf1
\ No newline at end of file
index 90e1b5be65aa3897177ebdcd5d97c2cbbe0741c9..39c4ba3c94fbbcf58f3f078085136d9e29210afa 100644 (file)
@@ -278,7 +278,7 @@ static int isLikeOrGlob(
         if( sqlite3Isdigit(zNew[0])
          || zNew[0]=='-'
          || zNew[0]=='+'
-         || (zNew[0]+1=='0' && iTo==1)
+         || (iTo>0 && zNew[iTo-1]=='0'-1)
         ){
           if( pLeft->op!=TK_COLUMN 
            || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT 
index f9120e738430b458903bfcd3198e5ae127f13255..5e75571b617b51e0136258366271e9f41b791d3f 100644 (file)
@@ -179,7 +179,7 @@ do_eqp_test like3-5.211 {
 }
 
 # 2019-05-01
-# another case of the above reported on the mailing list by Manual Rigger.
+# another case of the above reported on the mailing list by Manuel Rigger.
 #
 do_execsql_test like3-5.300 {
   CREATE TABLE t5c (c0 REAL);
@@ -188,6 +188,17 @@ do_execsql_test like3-5.300 {
   SELECT * FROM t5c WHERE (c0 LIKE '+/');
 } {+/}
 
+# 2019-05-08
+# Yet another case for the above from Manuel Rigger.
+#
+do_execsql_test like3-5.400 {
+  DROP TABLE IF EXISTS t0;
+  CREATE TABLE t0(c0 INT UNIQUE COLLATE NOCASE);
+  INSERT INTO t0(c0) VALUES ('./');
+  SELECT * FROM t0 WHERE t0.c0 LIKE './';
+} {./}
+
+
 # 2019-02-27
 # Verify that the LIKE optimization works with an ESCAPE clause when
 # using PRAGMA case_sensitive_like=ON.