/ Check-in [7df82c46]
Login

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

Overview
Comment:Improved output formatting for the showstat4 tool.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7df82c46da437bc743576358c25e758280067df8
User & Date: drh 2014-11-04 21:38:45
Context
2014-11-05
09:07
Add the ".scanstats on" command to the shell tool. Executing this command causes the shell tool to print values from sqlite3_stmt_scanstatus() after each query is run. check-in: 7974c0ed user: dan tags: trunk
2014-11-04
21:38
Improved output formatting for the showstat4 tool. check-in: 7df82c46 user: drh tags: trunk
17:23
Add various requirements evidence marks for sqlite3_config() options. check-in: d423349d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/showstat4.c.

    35     35     sqlite3_stmt *pStmt;
    36     36     char *zIdx = 0;
    37     37     int rc, j, x, y, mxHdr;
    38     38     const unsigned char *aSample;
    39     39     int nSample;
    40     40     i64 iVal;
    41     41     const char *zSep;
           42  +  int iRow = 0;
    42     43   
    43     44     if( argc!=2 ){
    44     45       fprintf(stderr, "Usage: %s DATABASE-FILE\n", argv[0]);
    45     46       exit(1);
    46     47     }
    47     48     rc = sqlite3_open(argv[1], &db);
    48     49     if( rc!=SQLITE_OK || db==0 ){
................................................................................
    56     57     if( rc!=SQLITE_OK || pStmt==0 ){
    57     58       fprintf(stderr, "%s\n", sqlite3_errmsg(db));
    58     59       sqlite3_close(db);
    59     60       exit(1);
    60     61     }
    61     62     while( SQLITE_ROW==sqlite3_step(pStmt) ){
    62     63       if( zIdx==0 || strcmp(zIdx, (const char*)sqlite3_column_text(pStmt,0))!=0 ){
    63         -      if( zIdx ) printf("\n");
           64  +      if( zIdx ) printf("\n**************************************"
           65  +                        "**************\n\n");
    64     66         sqlite3_free(zIdx);
    65     67         zIdx = sqlite3_mprintf("%s", sqlite3_column_text(pStmt,0));
    66         -      printf("%s:\n", zIdx);
    67         -    }else{
    68         -      printf("  -----------------------------------------------------------\n");
           68  +      iRow = 0;
    69     69       }
           70  +    printf("%s sample %d ------------------------------------\n", zIdx, ++iRow);
    70     71       printf("  nEq    = %s\n", sqlite3_column_text(pStmt,1));
    71     72       printf("  nLt    = %s\n", sqlite3_column_text(pStmt,2));
    72     73       printf("  nDLt   = %s\n", sqlite3_column_text(pStmt,3));
    73     74       printf("  sample = x'");
    74     75       aSample = sqlite3_column_blob(pStmt,4);
    75     76       nSample = sqlite3_column_bytes(pStmt,4);
    76     77       for(j=0; j<nSample; j++) printf("%02x", aSample[j]);