/ Check-in [9466d952]
Login

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

Overview
Comment:Simplification to the like optimization logic. Remove unnecessary branches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9466d952e169a6a60f6e575e679a61f05887b51c693505764edaf10f62cd829f
User & Date: drh 2017-08-11 03:47:21
Context
2017-08-11
12:49
Convert the LSM1 virtual table to be WITHOUT ROWID and get UPDATE and DELETE operations working on it. check-in: 2164031b user: drh tags: trunk
03:47
Simplification to the like optimization logic. Remove unnecessary branches. check-in: 9466d952 user: drh tags: trunk
2017-08-10
20:43
Allow WITHOUT ROWID virtual tables to be writable as long as they have exactly one column as their PRIMARY KEY. check-in: c601d128 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/whereexpr.c.

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
      }
    }

    /* Count the number of prefix characters prior to the first wildcard */
    cnt = 0;
    while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
      cnt++;
      if( c==wc[3] && z[cnt]!=0 ){
        if( z[cnt++]>0xc0 ) while( (z[cnt]&0xc0)==0x80 ){ cnt++; }
      }
    }

    /* The optimization is possible only if (1) the pattern does not begin
    ** with a wildcard and if (2) the non-wildcard prefix does not end with
    ** an (illegal 0xff) character.  The second condition is necessary so
    ** that we can increment the prefix key to find an upper bound for the
    ** range search. 







|
<
<







247
248
249
250
251
252
253
254


255
256
257
258
259
260
261
      }
    }

    /* Count the number of prefix characters prior to the first wildcard */
    cnt = 0;
    while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
      cnt++;
      if( c==wc[3] && z[cnt]!=0 ) cnt++;


    }

    /* The optimization is possible only if (1) the pattern does not begin
    ** with a wildcard and if (2) the non-wildcard prefix does not end with
    ** an (illegal 0xff) character.  The second condition is necessary so
    ** that we can increment the prefix key to find an upper bound for the
    ** range search.