SQLite

Check-in [2da677c4]
Login

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

Overview
Comment:Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by forum post 61bf7ccbdf.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2da677c45b643482eec39e4db7079c772760bc966dc71bf6c01658cc468f5823
User & Date: dan 2022-10-14 15:10:36
Original Comment: Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by 61bf7ccbdf.
Context
2022-10-14
15:52
Generic minor cleanups and docs in the OPFS async proxy. (check-in: a4423ca2 user: stephan tags: trunk)
15:10
Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by forum post 61bf7ccbdf. (check-in: 2da677c4 user: dan tags: trunk)
13:26
Remove a resolved TODO comment. (check-in: 32fd4ac3 user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/func.c.

736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
      ** first matching character and recursively continue the match from
      ** that point.
      **
      ** For a case-insensitive search, set variable cx to be the same as
      ** c but in the other case and search the input string for either
      ** c or cx.
      */
      if( c<=0x80 ){
        char zStop[3];
        int bMatch;
        if( noCase ){
          zStop[0] = sqlite3Toupper(c);
          zStop[1] = sqlite3Tolower(c);
          zStop[2] = 0;
        }else{







|







736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
      ** first matching character and recursively continue the match from
      ** that point.
      **
      ** For a case-insensitive search, set variable cx to be the same as
      ** c but in the other case and search the input string for either
      ** c or cx.
      */
      if( c<0x80 ){
        char zStop[3];
        int bMatch;
        if( noCase ){
          zStop[0] = sqlite3Toupper(c);
          zStop[1] = sqlite3Tolower(c);
          zStop[2] = 0;
        }else{

Changes to test/like2.test.

1001
1002
1003
1004
1005
1006
1007








1008
1009
do_test like-2.126.2 {
  db eval "SELECT x FROM t2 WHERE y LIKE '~%'"
} {126}
do_test like-2.126.3 {
  db eval "SELECT x FROM t3 WHERE y LIKE 'abc~%'"
} {126}










finish_test







>
>
>
>
>
>
>
>


1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
do_test like-2.126.2 {
  db eval "SELECT x FROM t2 WHERE y LIKE '~%'"
} {126}
do_test like-2.126.3 {
  db eval "SELECT x FROM t3 WHERE y LIKE 'abc~%'"
} {126}


do_test like-3.1 {
  db eval "SELECT '\u01C0' LIKE '%\x80'"
} {0}
do_test like-3.2 {
  db eval "SELECT '\u0080' LIKE '%\x80'"
} {1}


finish_test