/ Check-in [19c739b4]
Login

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

Overview
Comment:Enhancements to the index_usage utility program.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:19c739b4a8a43d894e37a99fa34838f3e3fa1fe0d019aefbc33f1d38d76af1a4
User & Date: drh 2019-01-30 14:01:43
Context
2019-01-30
15:47
Add the --progress, --using, and -q options to the index_usage utility program. check-in: a5e6be7c user: drh tags: trunk
14:01
Enhancements to the index_usage utility program. check-in: 19c739b4 user: drh tags: trunk
12:15
Fix another buffer overread in fts5 that may occur when accessing a corrupt database. check-in: 760d1437 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

  1331   1331   showwal$(TEXE):	$(TOP)/tool/showwal.c sqlite3.lo
  1332   1332   	$(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
  1333   1333   
  1334   1334   showshm$(TEXE):	$(TOP)/tool/showshm.c
  1335   1335   	$(LTLINK) -o $@ $(TOP)/tool/showshm.c
  1336   1336   
  1337   1337   index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
  1338         -	$(LTLINK) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
         1338  +	$(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
  1339   1339   
  1340   1340   changeset$(TEXE):	$(TOP)/ext/session/changeset.c sqlite3.lo
  1341   1341   	$(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
  1342   1342   
  1343   1343   changesetfuzz$(TEXE):	$(TOP)/ext/session/changesetfuzz.c sqlite3.lo
  1344   1344   	$(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
  1345   1345   

Changes to main.mk.

  1017   1017   	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
  1018   1018   		$(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
  1019   1019   
  1020   1020   showshm$(EXE):	$(TOP)/tool/showshm.c
  1021   1021   	$(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
  1022   1022   
  1023   1023   index_usage$(EXE): $(TOP)/tool/index_usage.c sqlite3.o
  1024         -	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED -o index_usage$(EXE) \
         1024  +	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED $(SHELL_OPTS) -o index_usage$(EXE) \
  1025   1025   		$(TOP)/tool/index_usage.c sqlite3.o $(THREADLIB)
  1026   1026   
  1027   1027   changeset$(EXE):	$(TOP)/ext/session/changeset.c sqlite3.o
  1028   1028   	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
  1029   1029   		$(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
  1030   1030   
  1031   1031   changesetfuzz$(EXE):	$(TOP)/ext/session/changesetfuzz.c sqlite3.o

Changes to tool/index_usage.c.

    86     86     rc = sqlite3_exec(db, zSql, 0, 0, 0);
    87     87     sqlite3_free(zSql);
    88     88     if( rc ){
    89     89       printf("Cannot open the LOG database \"%s\" - %s\n",
    90     90              argv[2], sqlite3_errmsg(db));
    91     91       goto errorOut;
    92     92     }
    93         -  rc = sqlite3_prepare_v2(db, "SELECT sql, rowid FROM log.sqllog",
           93  +  rc = sqlite3_prepare_v2(db,
           94  +     "SELECT sql, rowid FROM log.sqllog"
           95  +     " WHERE upper(substr(sql,1,5)) NOT IN ('BEGIN','COMMI','ROLLB','PRAGM')",
    94     96                             -1, &pStmt, 0);
    95     97     if( rc ){
    96     98       printf("Cannot read the SQLLOG table in the LOG database \"%s\" - %s\n",
    97     99              argv[2], sqlite3_errmsg(db));
    98    100       goto errorOut;
    99    101     }
   100    102