Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/sqlite/src/tool/showstat4.c

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/tool/showlocks.c ('k') | third_party/sqlite/src/tool/showwal.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/tool/showstat4.c
diff --git a/third_party/sqlite/src/tool/showstat4.c b/third_party/sqlite/src/tool/showstat4.c
index 668d2106af270a06fbe17c59d1bdf0f1e06e7e58..c7f9b10fbc2eff34341ff57a1cb1a90e29699069 100644
--- a/third_party/sqlite/src/tool/showstat4.c
+++ b/third_party/sqlite/src/tool/showstat4.c
@@ -9,6 +9,8 @@
#include <ctype.h>
#include "sqlite3.h"
+#define ISPRINT(X) isprint((unsigned char)(X))
+
typedef sqlite3_int64 i64; /* 64-bit signed integer type */
@@ -39,6 +41,7 @@ int main(int argc, char **argv){
int nSample;
i64 iVal;
const char *zSep;
+ int iRow = 0;
if( argc!=2 ){
fprintf(stderr, "Usage: %s DATABASE-FILE\n", argv[0]);
@@ -60,13 +63,13 @@ int main(int argc, char **argv){
}
while( SQLITE_ROW==sqlite3_step(pStmt) ){
if( zIdx==0 || strcmp(zIdx, (const char*)sqlite3_column_text(pStmt,0))!=0 ){
- if( zIdx ) printf("\n");
+ if( zIdx ) printf("\n**************************************"
+ "**************\n\n");
sqlite3_free(zIdx);
zIdx = sqlite3_mprintf("%s", sqlite3_column_text(pStmt,0));
- printf("%s:\n", zIdx);
- }else{
- printf(" -----------------------------------------------------------\n");
+ iRow = 0;
}
+ printf("%s sample %d ------------------------------------\n", zIdx, ++iRow);
printf(" nEq = %s\n", sqlite3_column_text(pStmt,1));
printf(" nLt = %s\n", sqlite3_column_text(pStmt,2));
printf(" nDLt = %s\n", sqlite3_column_text(pStmt,3));
@@ -130,7 +133,7 @@ int main(int argc, char **argv){
printf("%s\"", zSep);
for(j=0; j<sz; j++){
char c = (char)aSample[y+j];
- if( isprint(c) ){
+ if( ISPRINT(c) ){
if( c=='"' || c=='\\' ) putchar('\\');
putchar(c);
}else if( c=='\n' ){
« no previous file with comments | « third_party/sqlite/src/tool/showlocks.c ('k') | third_party/sqlite/src/tool/showwal.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698