/ Check-in [dc794d8f]
Login

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

Overview
Comment:Fix an off-by-one error when parsing the names of indexes that do not have arguments in the index_usage utility.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: dc794d8f518ed46536928a77a560d46e4f9365c30a00cd108f000d8556a66c00
User & Date: drh 2019-01-30 16:58:04
Context
2019-01-30
18:33
Detect if two indexes of the same table share a common rootpage while parsing the schema, and throw an error immediately. check-in: f21c6f13 user: drh tags: trunk
16:58
Fix an off-by-one error when parsing the names of indexes that do not have arguments in the index_usage utility. check-in: dc794d8f user: drh tags: trunk
15:47
Add the --progress, --using, and -q options to the index_usage utility program. check-in: a5e6be7c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/index_usage.c.

   182    182           const char *zExplain = (const char*)sqlite3_column_text(pS2,3);
   183    183           const char *z1, *z2;
   184    184           int n;
   185    185           /* printf("EXPLAIN: %s\n", zExplain); */
   186    186           z1 = strstr(zExplain, " USING INDEX ");
   187    187           if( z1==0 ) continue;
   188    188           z1 += 13;
   189         -        for(z2=z1+1; z2[1] && z2[1]!='('; z2++){}
          189  +        for(z2=z1+1; z2[0] && z2[1]!='('; z2++){}
   190    190           n = z2 - z1;
   191    191           if( zUsing && sqlite3_strnicmp(zUsing, z1, n)==0 ){
   192    192             printf("Using %s:\n%s\n", zUsing, zLog);
   193    193             fflush(stdout);
   194    194           }
   195    195           sqlite3_bind_text(pIncrCnt,1,z1,n,SQLITE_STATIC);
   196    196           sqlite3_step(pIncrCnt);