/ Check-in [204432ee]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Case folding in the LIKE operator should look at all bits of the character, not just the lower 8 bits. Fix for ticket [80369eddd5c94]. This is a back-out of check-in [0a99a8c4facf] with a testcase added.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 204432ee72fda8e82d244c4aa18de7ec4811b8e1
User & Date: drh 2016-01-20 14:22:41
Context
2016-01-20
15:19
Fix a problem in autoconf/configure.ac causing --enable-readline to fail if libedit was not present. check-in: e8adeb64 user: dan tags: trunk
14:30
Case folding in the LIKE operator should look at all bits of the character, not just the lower 8 bits. Fix for ticket [80369eddd5c94]. This is a back-out of check-in [0a99a8c4facf] with a testcase added. check-in: 29dc4a3e user: drh tags: branch-3.10
14:22
Case folding in the LIKE operator should look at all bits of the character, not just the lower 8 bits. Fix for ticket [80369eddd5c94]. This is a back-out of check-in [0a99a8c4facf] with a testcase added. check-in: 204432ee user: drh tags: trunk
08:47
Improve performance of sqlite3VtabImportErrmsg(). check-in: 18d61c8e user: dan tags: trunk
2015-12-30
14:06
Remove unnecessary tests from the LIKE pattern matcher. Slightly faster and slightly smaller, and it should also now works with EBCDIC. check-in: 0a99a8c4 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

   735    735             return 0;
   736    736           }
   737    737           continue;
   738    738         }
   739    739       }
   740    740       c2 = Utf8Read(zString);
   741    741       if( c==c2 ) continue;
   742         -    if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
          742  +    if( noCase && c<0x80 && c2<0x80 && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
   743    743         continue;
   744    744       }
   745    745       if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue;
   746    746       return 0;
   747    747     }
   748    748     return *zString==0;
   749    749   }

Changes to test/like.test.

   959    959     EXPLAIN QUERY PLAN
   960    960     SELECT id FROM t12nc WHERE x LIKE 'abc%' COLLATE binary ORDER BY +id;
   961    961   } {/SEARCH/}
   962    962   do_execsql_test like-12.16 {
   963    963     EXPLAIN QUERY PLAN
   964    964     SELECT id FROM t12b WHERE x LIKE 'abc%' COLLATE binary ORDER BY +id;
   965    965   } {/SCAN/}
          966  +
          967  +# Ticket [https://www.sqlite.org/src/tktview/80369eddd5c94d49f7fbbcf5]
          968  +# 2016-01-20
          969  +#
          970  +do_execsql_test like-13.1 {
          971  +  SELECT char(0x304d) LIKE char(0x306d);
          972  +} {0}
          973  +do_execsql_test like-13.2 {
          974  +  SELECT char(0x4d) LIKE char(0x306d);
          975  +} {0}
          976  +do_execsql_test like-13.3 {
          977  +  SELECT char(0x304d) LIKE char(0x6d);
          978  +} {0}
          979  +do_execsql_test like-13.4 {
          980  +  SELECT char(0x4d) LIKE char(0x6d);
          981  +} {1}
          982  +
   966    983   
   967    984   
   968    985   finish_test