/ Check-in [f735c249]
Login

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

Overview
Comment:Improved display of record data in the "NNNbd" output of the showdb.exe utility program.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f735c2497eaad15216c90c6b92fd5ceff460220a
User & Date: drh 2014-06-20 13:55:06
Context
2014-06-23
10:04
Fix a problem with SQLITE_OMIT_WAL builds. check-in: 612b6d1b user: dan tags: trunk
2014-06-20
13:55
Improved display of record data in the "NNNbd" output of the showdb.exe utility program. check-in: f735c249 user: drh tags: trunk
01:32
In the showdb.exe utility, for the "NNNbd" command, also show data fields in addition to header fields on each record decoded. Improvements to formatting. check-in: b451fe0c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/showdb.c.

   475    475              double r;
   476    476              memcpy(&r, &v, sizeof(r));
   477    477              printf("%#g\n", r);
   478    478            }else{
   479    479              printf("%lld\n", v);
   480    480            }
   481    481          }else{
   482         -         printf("%d bytes of %s\n", szCol[i],
   483         -                (typeCol[i]&1)==0 ? "BLOB" : "TEXT");
          482  +         int ii, jj;
          483  +         char zConst[32];
          484  +         if( (typeCol[i]&1)==0 ){
          485  +           zConst[0] = 'x';
          486  +           zConst[1] = '\'';
          487  +           for(ii=2, jj=0; jj<szCol[i] && ii<24; jj++, ii+=2){
          488  +             sprintf(zConst+ii, "%02x", pData[jj]);
          489  +           }
          490  +         }else{
          491  +           zConst[0] = '\'';
          492  +           for(ii=1, jj=0; jj<szCol[i] && ii<24; jj++, ii++){
          493  +             zConst[ii] = isprint(pData[jj]) ? pData[jj] : '.';
          494  +           }
          495  +           zConst[ii] = 0;
          496  +         }
          497  +         if( jj<szCol[i] ){
          498  +           memcpy(zConst+ii, "...'", 5);
          499  +         }else{
          500  +           memcpy(zConst+ii, "'", 2);
          501  +         }
          502  +         printf("%s\n", zConst);
   484    503          }
   485    504          j = ofstCol[i] + szCol[i];
   486    505       }
   487    506     }
   488    507     if( j<nLocal ){
   489    508       printBytes(a, x+j, 0);
   490    509       printf("... %d bytes of content ...\n", nLocal-j);