/ 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 Unified Diffs Ignore Whitespace Patch

Changes to tool/index_usage.c.

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







|







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