/ Check-in [e3107631]
Login

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

Overview
Comment:Add output of PRAGMAs auto_vacuum and encoding to the "schema" command of the fts3view utility program.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts4-incr-merge
Files: files | file ages | folders
SHA1:e31076319363a46905836880765bae3bf204ed19
User & Date: drh 2012-03-27 18:00:05
Context
2012-03-28
13:55
Fix a problem in fts4merge3.test. check-in: 64fc8b30 user: dan tags: fts4-incr-merge
2012-03-27
18:00
Add output of PRAGMAs auto_vacuum and encoding to the "schema" command of the fts3view utility program. check-in: e3107631 user: drh tags: fts4-incr-merge
15:10
Really delete the fts3merge.test script (should have been deleted by the previous commit). check-in: 83838149 user: dan tags: fts4-incr-merge
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/tool/fts3view.c.

    71     71     sqlite3_free(zSql);
    72     72     return pStmt;
    73     73   }
    74     74   
    75     75   /*
    76     76   ** Run an SQL statement
    77     77   */
    78         -static void runSql(sqlite3 *db, const char *zFormat, ...){
           78  +static int runSql(sqlite3 *db, const char *zFormat, ...){
    79     79     va_list ap;
    80     80     char *zSql;
           81  +  int rc;
    81     82   
    82     83     va_start(ap, zFormat);
    83     84     zSql = sqlite3_vmprintf(zFormat, ap);
    84         -  sqlite3_exec(db, zSql, 0, 0, 0);
           85  +  rc = sqlite3_exec(db, zSql, 0, 0, 0);
    85     86     va_end(ap);
           87  +  return rc;
    86     88   }
    87     89   
    88     90   /*
    89     91   ** Show the table schema
    90     92   */
    91     93   static void showSchema(sqlite3 *db, const char *zTab){
    92     94     sqlite3_stmt *pStmt;
................................................................................
   104    106       printf("PRAGMA page_size=%s;\n", sqlite3_column_text(pStmt, 0));
   105    107     }
   106    108     sqlite3_finalize(pStmt);
   107    109     pStmt = prepare(db, "PRAGMA journal_mode");
   108    110     while( sqlite3_step(pStmt)==SQLITE_ROW ){
   109    111       printf("PRAGMA journal_mode=%s;\n", sqlite3_column_text(pStmt, 0));
   110    112     }
          113  +  sqlite3_finalize(pStmt);
          114  +  pStmt = prepare(db, "PRAGMA auto_vacuum");
          115  +  while( sqlite3_step(pStmt)==SQLITE_ROW ){
          116  +    const char *zType = "???";
          117  +    switch( sqlite3_column_int(pStmt, 0) ){
          118  +      case 0:  zType = "OFF";         break;
          119  +      case 1:  zType = "FULL";        break;
          120  +      case 2:  zType = "INCREMENTAL"; break;
          121  +    }
          122  +    printf("PRAGMA auto_vacuum=%s;\n", zType);
          123  +  }
          124  +  sqlite3_finalize(pStmt);
          125  +  pStmt = prepare(db, "PRAGMA encoding");
          126  +  while( sqlite3_step(pStmt)==SQLITE_ROW ){
          127  +    printf("PRAGMA encoding=%s;\n", sqlite3_column_text(pStmt, 0));
          128  +  }
   111    129     sqlite3_finalize(pStmt);
   112    130   }
   113    131   
   114    132   /* 
   115    133   ** Read a 64-bit variable-length integer from memory starting at p[0].
   116    134   ** Return the number of bytes read, or 0 on error.
   117    135   ** The value is stored in *v.
................................................................................
   797    815   }
   798    816   
   799    817   int main(int argc, char **argv){
   800    818     sqlite3 *db;
   801    819     int rc;
   802    820     const char *zTab;
   803    821     const char *zCmd;
          822  +
   804    823     if( argc<2 ) usage(argv[0]);
   805    824     rc = sqlite3_open(argv[1], &db);
   806    825     if( rc ){
   807    826       fprintf(stderr, "Cannot open %s\n", argv[1]);
   808    827       exit(1);
   809    828     }
   810    829     if( argc==2 ){