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

Side by Side Diff: third_party/sqlite/src/tool/showstat4.c

Issue 2765553002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 ** This utility program decodes and displays the content of the 2 ** This utility program decodes and displays the content of the
3 ** sqlite_stat4 table in the database file named on the command 3 ** sqlite_stat4 table in the database file named on the command
4 ** line. 4 ** line.
5 */ 5 */
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <ctype.h> 9 #include <ctype.h>
10 #include "sqlite3.h" 10 #include "sqlite3.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 }else{ 123 }else{
124 printf("%s%lld", zSep, v); 124 printf("%s%lld", zSep, v);
125 } 125 }
126 }else if( (iVal&1)==0 ){ 126 }else if( (iVal&1)==0 ){
127 printf("%sx'", zSep); 127 printf("%sx'", zSep);
128 for(j=0; j<sz; j++){ 128 for(j=0; j<sz; j++){
129 printf("%02x", aSample[y+j]); 129 printf("%02x", aSample[y+j]);
130 } 130 }
131 printf("'"); 131 printf("'");
132 }else{ 132 }else{
133 printf("%s\"", zSep); 133 printf("%s'", zSep);
134 for(j=0; j<sz; j++){ 134 for(j=0; j<sz; j++){
135 char c = (char)aSample[y+j]; 135 char c = (char)aSample[y+j];
136 if( ISPRINT(c) ){ 136 if( ISPRINT(c) ){
137 if( c=='"' || c=='\\' ) putchar('\\'); 137 if( c=='\'' || c=='\\' ) putchar('\\');
138 putchar(c); 138 putchar(c);
139 }else if( c=='\n' ){ 139 }else if( c=='\n' ){
140 printf("\\n"); 140 printf("\\n");
141 }else if( c=='\t' ){ 141 }else if( c=='\t' ){
142 printf("\\t"); 142 printf("\\t");
143 }else if( c=='\r' ){ 143 }else if( c=='\r' ){
144 printf("\\r"); 144 printf("\\r");
145 }else{ 145 }else{
146 printf("\\%03o", c); 146 printf("\\%03o", c);
147 } 147 }
148 } 148 }
149 printf("\""); 149 printf("'");
150 } 150 }
151 zSep = ","; 151 zSep = ",";
152 y += sz; 152 y += sz;
153 } 153 }
154 printf("\n"); 154 printf("\n");
155 } 155 }
156 sqlite3_free(zIdx); 156 sqlite3_free(zIdx);
157 sqlite3_finalize(pStmt); 157 sqlite3_finalize(pStmt);
158 sqlite3_close(db); 158 sqlite3_close(db);
159 return 0; 159 return 0;
160 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698