Fossil SCM

Update to the latest SQLite 3.38.0 alpha that includes support for --wordwrap in the CLI.

drh 2022-02-01 13:20 trunk
Commit 0505bc82897e2a7bee3b95ae225a290d136d2e7240bc819f13dc181637a7cef6
+106 -51
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -12143,10 +12143,19 @@
1214312143
EQPGraphRow *pRow; /* Linked list of all rows of the EQP output */
1214412144
EQPGraphRow *pLast; /* Last element of the pRow list */
1214512145
char zPrefix[100]; /* Graph prefix */
1214612146
};
1214712147
12148
+/* Parameters affecting columnar mode result display (defaulting together) */
12149
+typedef struct ColModeOpts {
12150
+ int iWrap; /* In columnar modes, wrap lines reaching this limit */
12151
+ u8 bQuote; /* Quote results for .mode box and table */
12152
+ u8 bWordWrap; /* In columnar modes, wrap at word boundaries */
12153
+} ColModeOpts;
12154
+#define ColModeOpts_default { 60, 0, 0 }
12155
+#define ColModeOpts_default_qbox { 60, 1, 0 }
12156
+
1214812157
/*
1214912158
** State information about the database connection is contained in an
1215012159
** instance of the following structure.
1215112160
*/
1215212161
typedef struct ShellState ShellState;
@@ -12161,12 +12170,11 @@
1216112170
u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
1216212171
u8 nEqpLevel; /* Depth of the EQP output graph */
1216312172
u8 eTraceType; /* SHELL_TRACE_* value for type of trace */
1216412173
u8 bSafeMode; /* True to prohibit unsafe operations */
1216512174
u8 bSafeModePersist; /* The long-term value of bSafeMode */
12166
- u8 bQuote; /* Quote results for .mode box and table */
12167
- int iWrap; /* Wrap lines this long or longer in some output modes */
12175
+ ColModeOpts cmOpts; /* Option values affecting columnar mode output */
1216812176
unsigned statsOn; /* True to display memory stats before each finalize */
1216912177
unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */
1217012178
int inputNesting; /* Track nesting level of .read and other redirects */
1217112179
int outCount; /* Revert to stdout when reaching zero */
1217212180
int cnt; /* Number of records displayed so far */
@@ -14250,28 +14258,33 @@
1425014258
** similar tabular formats. z[] might contain control characters such
1425114259
** as \n, \t, \f, or \r.
1425214260
**
1425314261
** Compute characters to display on the first line of z[]. Stop at the
1425414262
** first \r, \n, or \f. Expand \t into spaces. Return a copy (obtained
14255
-** from malloc()) of that first line. Write anything to display
14256
-** on the next line into *pzTail. If this is the last line, write a NULL
14257
-** into *pzTail.
14263
+** from malloc()) of that first line, which caller should free sometime.
14264
+** Write anything to display on the next line into *pzTail. If this is
14265
+** the last line, write a NULL into *pzTail. (*pzTail is not allocated.)
1425814266
*/
1425914267
static char *translateForDisplayAndDup(
14260
- const unsigned char *z,
14261
- const unsigned char **pzTail,
14262
- int mxWidth
14268
+ const unsigned char *z, /* Input text to be transformed */
14269
+ const unsigned char **pzTail, /* OUT: Tail of the input for next line */
14270
+ int mxWidth, /* Max width. 0 means no limit */
14271
+ u8 bWordWrap /* If true, avoid breaking mid-word */
1426314272
){
14264
- int i, j, n;
14265
- unsigned char *zOut;
14273
+ int i; /* Input bytes consumed */
14274
+ int j; /* Output bytes generated */
14275
+ int k; /* Input bytes to be displayed */
14276
+ int n; /* Output column number */
14277
+ unsigned char *zOut; /* Output text */
14278
+
1426614279
if( z==0 ){
1426714280
*pzTail = 0;
1426814281
return 0;
1426914282
}
1427014283
if( mxWidth<0 ) mxWidth = -mxWidth;
1427114284
if( mxWidth==0 ) mxWidth = 1000000;
14272
- i = j= n = 0;
14285
+ i = j = n = 0;
1427314286
while( n<mxWidth ){
1427414287
if( z[i]>=' ' ){
1427514288
n++;
1427614289
do{ i++; j++; }while( (z[i]&0xc0)==0x80 );
1427714290
continue;
@@ -14279,16 +14292,33 @@
1427914292
if( z[i]=='\t' ){
1428014293
do{
1428114294
n++;
1428214295
j++;
1428314296
}while( (n&7)!=0 && n<mxWidth );
14284
- n += 8;
14285
- n &= ~7;
1428614297
i++;
1428714298
continue;
1428814299
}
1428914300
break;
14301
+ }
14302
+ if( n>=mxWidth && bWordWrap ){
14303
+ /* Perhaps try to back up to a better place to break the line */
14304
+ for(k=i; k>i/2; k--){
14305
+ if( isspace(z[k-1]) ) break;
14306
+ }
14307
+ if( k<=i/2 ){
14308
+ for(k=i; k>i/2; k--){
14309
+ if( isalnum(z[k-1])!=isalnum(z[k]) && (z[k]&0xc0)!=0x80 ) break;
14310
+ }
14311
+ }
14312
+ if( k<=i/2 ){
14313
+ k = i;
14314
+ }else{
14315
+ i = k;
14316
+ while( z[i]==' ' ) i++;
14317
+ }
14318
+ }else{
14319
+ k = i;
1429014320
}
1429114321
if( n>=mxWidth && z[i]>=' ' ){
1429214322
*pzTail = &z[i];
1429314323
}else if( z[i]=='\r' && z[i+1]=='\n' ){
1429414324
*pzTail = z[i+2] ? &z[i+2] : 0;
@@ -14298,11 +14328,11 @@
1429814328
*pzTail = &z[i+1];
1429914329
}
1430014330
zOut = malloc( j+1 );
1430114331
shell_check_oom(zOut);
1430214332
i = j = n = 0;
14303
- while( n<mxWidth ){
14333
+ while( i<k ){
1430414334
if( z[i]>=' ' ){
1430514335
n++;
1430614336
do{ zOut[j++] = z[i++]; }while( (z[i]&0xc0)==0x80 );
1430714337
continue;
1430814338
}
@@ -14380,10 +14410,11 @@
1438014410
const char *colSep = 0;
1438114411
const char *rowSep = 0;
1438214412
const unsigned char **azNextLine = 0;
1438314413
int bNextLine = 0;
1438414414
int bMultiLineRowExists = 0;
14415
+ int bw = p->cmOpts.bWordWrap;
1438514416
1438614417
rc = sqlite3_step(pStmt);
1438714418
if( rc!=SQLITE_ROW ) return;
1438814419
nColumn = sqlite3_column_count(pStmt);
1438914420
nAlloc = nColumn*4;
@@ -14391,11 +14422,11 @@
1439114422
azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
1439214423
shell_check_oom(azData);
1439314424
azNextLine = sqlite3_malloc64( nColumn*sizeof(char*) );
1439414425
shell_check_oom((void*)azNextLine);
1439514426
memset((void*)azNextLine, 0, nColumn*sizeof(char*) );
14396
- if( p->bQuote ){
14427
+ if( p->cmOpts.bQuote ){
1439714428
azQuoted = sqlite3_malloc64( nColumn*sizeof(char*) );
1439814429
shell_check_oom(azQuoted);
1439914430
memset(azQuoted, 0, nColumn*sizeof(char*) );
1440014431
}
1440114432
abRowDiv = sqlite3_malloc64( nAlloc/nColumn );
@@ -14412,11 +14443,18 @@
1441214443
w = p->colWidth[i];
1441314444
if( w<0 ) w = -w;
1441414445
p->actualWidth[i] = w;
1441514446
}
1441614447
for(i=0; i<nColumn; i++){
14417
- azData[i] = strdup(sqlite3_column_name(pStmt,i));
14448
+ const unsigned char *zNotUsed;
14449
+ int wx = p->colWidth[i];
14450
+ if( wx==0 ){
14451
+ wx = p->cmOpts.iWrap;
14452
+ }
14453
+ if( wx<0 ) wx = -wx;
14454
+ uz = (const unsigned char*)sqlite3_column_name(pStmt,i);
14455
+ azData[i] = translateForDisplayAndDup(uz, &zNotUsed, wx, bw);
1441814456
}
1441914457
do{
1442014458
int useNextLine = bNextLine;
1442114459
bNextLine = 0;
1442214460
if( (nRow+2)*nColumn >= nAlloc ){
@@ -14428,21 +14466,25 @@
1442814466
}
1442914467
abRowDiv[nRow] = 1;
1443014468
nRow++;
1443114469
for(i=0; i<nColumn; i++){
1443214470
int wx = p->colWidth[i];
14433
- if( wx==0 ) wx = p->iWrap;
14471
+ if( wx==0 ){
14472
+ wx = p->cmOpts.iWrap;
14473
+ }
14474
+ if( wx<0 ) wx = -wx;
1443414475
if( useNextLine ){
1443514476
uz = azNextLine[i];
14436
- }else if( p->bQuote ){
14477
+ }else if( p->cmOpts.bQuote ){
1443714478
sqlite3_free(azQuoted[i]);
1443814479
azQuoted[i] = quoted_column(pStmt,i);
1443914480
uz = (const unsigned char*)azQuoted[i];
1444014481
}else{
1444114482
uz = (const unsigned char*)sqlite3_column_text(pStmt,i);
1444214483
}
14443
- azData[nRow*nColumn + i] = translateForDisplayAndDup(uz, &azNextLine[i], wx);
14484
+ azData[nRow*nColumn + i]
14485
+ = translateForDisplayAndDup(uz, &azNextLine[i], wx, bw);
1444414486
if( azNextLine[i] ){
1444514487
bNextLine = 1;
1444614488
abRowDiv[nRow-1] = 0;
1444714489
bMultiLineRowExists = 1;
1444814490
}
@@ -14533,10 +14575,12 @@
1453314575
if( bMultiLineRowExists && abRowDiv[i/nColumn-1] && i+1<nTotal ){
1453414576
if( p->cMode==MODE_Table ){
1453514577
print_row_separator(p, nColumn, "+");
1453614578
}else if( p->cMode==MODE_Box ){
1453714579
print_box_row_separator(p, nColumn, BOX_123, BOX_1234, BOX_134);
14580
+ }else if( p->cMode==MODE_Column ){
14581
+ raw_printf(p->out, "\n");
1453814582
}
1453914583
}
1454014584
j = -1;
1454114585
if( seenInterrupt ) goto columnar_end;
1454214586
}else{
@@ -15336,11 +15380,11 @@
1533615380
" fkey-indexes Find missing foreign key indexes",
1533715381
#ifndef SQLITE_OMIT_LOAD_EXTENSION
1533815382
".load FILE ?ENTRY? Load an extension library",
1533915383
#endif
1534015384
".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
15341
- ".mode MODE ?TABLE? ?OPTIONS? Set output mode",
15385
+ ".mode MODE ?OPTIONS? Set output mode",
1534215386
" MODE is one of:",
1534315387
" ascii Columns/rows delimited by 0x1F and 0x1E",
1534415388
" box Tables using unicode box-drawing characters",
1534515389
" csv Comma-separated values",
1534615390
" column Output in columns. (See .width)",
@@ -15353,15 +15397,18 @@
1535315397
" qbox Shorthand for \"box --width 60 --quote\"",
1535415398
" quote Escape answers as for SQL",
1535515399
" table ASCII-art table",
1535615400
" tabs Tab-separated values",
1535715401
" tcl TCL list elements",
15358
- " OPTIONS: (value for columnar modes only):",
15359
- " --wrap N Wrap output lines longer than N character",
15360
- " --quote Quote output text as SQL literals",
15361
- " --noquote Do not quote output text",
15362
- ".nonce STRING Disable safe mode for one command if the nonce matches",
15402
+ " OPTIONS: (for columnar modes or insert mode):",
15403
+ " --wrap N Wrap output lines to no longer than N characters",
15404
+ " --wordwrap B Wrap or not at word boundaries per B (on/off)",
15405
+ " --ww Shorthand for \"--wordwrap 1\"",
15406
+ " --quote Quote output text as SQL literals",
15407
+ " --noquote Do not quote output text",
15408
+ " TABLE The name of SQL table used for \"insert\" mode",
15409
+ ".nonce STRING Suspend safe mode for one command if nonce matches",
1536315410
".nullvalue STRING Use STRING in place of NULL values",
1536415411
".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",
1536515412
" If FILE begins with '|' then open as a pipe",
1536615413
" --bom Put a UTF8 byte-order mark at the beginning",
1536715414
" -e Send output to the system text editor",
@@ -20140,33 +20187,43 @@
2014020187
2014120188
if( c=='m' && strncmp(azArg[0], "mode", n)==0 ){
2014220189
const char *zMode = 0;
2014320190
const char *zTabname = 0;
2014420191
int i, n2;
20145
- int bQuoteChng = 0;
20146
- int bWrapChng = 0;
20192
+ ColModeOpts cmOpts = ColModeOpts_default;
2014720193
for(i=1; i<nArg; i++){
2014820194
const char *z = azArg[i];
2014920195
if( optionMatch(z,"wrap") && i+1<nArg ){
20150
- p->iWrap = integerValue(azArg[++i]);
20151
- bWrapChng = 1;
20196
+ cmOpts.iWrap = integerValue(azArg[++i]);
20197
+ }else if( optionMatch(z,"ww") ){
20198
+ cmOpts.bWordWrap = 1;
20199
+ }else if( optionMatch(z,"wordwrap") && i+1<nArg ){
20200
+ cmOpts.bWordWrap = (u8)booleanValue(azArg[++i]);
2015220201
}else if( optionMatch(z,"quote") ){
20153
- p->bQuote = 1;
20154
- bQuoteChng = 1;
20202
+ cmOpts.bQuote = 1;
2015520203
}else if( optionMatch(z,"noquote") ){
20156
- p->bQuote = 0;
20157
- bQuoteChng = 1;
20204
+ cmOpts.bQuote = 0;
2015820205
}else if( zMode==0 ){
2015920206
zMode = z;
20207
+ /* Apply defaults for qbox pseudo-mods. If that
20208
+ * overwrites already-set values, user was informed of this.
20209
+ */
20210
+ if( strcmp(z, "qbox")==0 ){
20211
+ ColModeOpts cmo = ColModeOpts_default_qbox;
20212
+ zMode = "box";
20213
+ cmOpts = cmo;
20214
+ }
2016020215
}else if( zTabname==0 ){
2016120216
zTabname = z;
2016220217
}else if( z[0]=='-' ){
2016320218
utf8_printf(stderr, "unknown option: %s\n", z);
2016420219
utf8_printf(stderr, "options:\n"
2016520220
" --noquote\n"
2016620221
" --quote\n"
20167
- " --wrap N\n");
20222
+ " --wordwrap on/off\n"
20223
+ " --wrap N\n"
20224
+ " --ww\n");
2016820225
rc = 1;
2016920226
goto meta_command_exit;
2017020227
}else{
2017120228
utf8_printf(stderr, "extra argument: \"%s\"\n", z);
2017220229
rc = 1;
@@ -20175,16 +20232,19 @@
2017520232
}
2017620233
if( zMode==0 ){
2017720234
if( p->mode==MODE_Column
2017820235
|| (p->mode>=MODE_Markdown && p->mode<=MODE_Box)
2017920236
){
20180
- raw_printf(p->out, "current output mode: %s --wrap %d --%squote\n",
20181
- modeDescr[p->mode], p->iWrap, p->bQuote ? "" : "no");
20237
+ raw_printf
20238
+ (p->out,
20239
+ "current output mode: %s --wrap %d --wordwrap %s --%squote\n",
20240
+ modeDescr[p->mode], p->cmOpts.iWrap,
20241
+ p->cmOpts.bWordWrap ? "on" : "off",
20242
+ p->cmOpts.bQuote ? "" : "no");
2018220243
}else{
2018320244
raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
2018420245
}
20185
- bWrapChng = bQuoteChng = 1;
2018620246
zMode = modeDescr[p->mode];
2018720247
}
2018820248
n2 = strlen30(zMode);
2018920249
if( strncmp(zMode,"lines",n2)==0 ){
2019020250
p->mode = MODE_Line;
@@ -20193,12 +20253,11 @@
2019320253
p->mode = MODE_Column;
2019420254
if( (p->shellFlgs & SHFLG_HeaderSet)==0 ){
2019520255
p->showHeader = 1;
2019620256
}
2019720257
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
20198
- if( !bWrapChng ) p->iWrap = 0;
20199
- if( !bQuoteChng ) p->bQuote = 0;
20258
+ p->cmOpts = cmOpts;
2020020259
}else if( strncmp(zMode,"list",n2)==0 ){
2020120260
p->mode = MODE_List;
2020220261
sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Column);
2020320262
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
2020420263
}else if( strncmp(zMode,"html",n2)==0 ){
@@ -20225,24 +20284,17 @@
2022520284
p->mode = MODE_Ascii;
2022620285
sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
2022720286
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
2022820287
}else if( strncmp(zMode,"markdown",n2)==0 ){
2022920288
p->mode = MODE_Markdown;
20230
- if( !bWrapChng ) p->iWrap = 0;
20231
- if( !bQuoteChng ) p->bQuote = 0;
20289
+ p->cmOpts = cmOpts;
2023220290
}else if( strncmp(zMode,"table",n2)==0 ){
2023320291
p->mode = MODE_Table;
20234
- if( !bWrapChng ) p->iWrap = 0;
20235
- if( !bQuoteChng ) p->bQuote = 0;
20292
+ p->cmOpts = cmOpts;
2023620293
}else if( strncmp(zMode,"box",n2)==0 ){
2023720294
p->mode = MODE_Box;
20238
- if( !bWrapChng ) p->iWrap = 0;
20239
- if( !bQuoteChng ) p->bQuote = 0;
20240
- }else if( strcmp(zMode,"qbox")==0 ){
20241
- p->mode = MODE_Box;
20242
- if( !bWrapChng ) p->iWrap = 60;
20243
- if( !bQuoteChng ) p->bQuote = 1;
20295
+ p->cmOpts = cmOpts;
2024420296
}else if( strncmp(zMode,"count",n2)==0 ){
2024520297
p->mode = MODE_Count;
2024620298
}else if( strncmp(zMode,"off",n2)==0 ){
2024720299
p->mode = MODE_Off;
2024820300
}else if( strncmp(zMode,"json",n2)==0 ){
@@ -21399,12 +21451,15 @@
2139921451
p->mode==MODE_Explain ? "on" : p->autoExplain ? "auto" : "off");
2140021452
utf8_printf(p->out,"%12.12s: %s\n","headers", azBool[p->showHeader!=0]);
2140121453
if( p->mode==MODE_Column
2140221454
|| (p->mode>=MODE_Markdown && p->mode<=MODE_Box)
2140321455
){
21404
- utf8_printf(p->out, "%12.12s: %s --wrap %d --%squote\n", "mode",
21405
- modeDescr[p->mode], p->iWrap, p->bQuote ? "" : "no");
21456
+ utf8_printf
21457
+ (p->out, "%12.12s: %s --wrap %d --wordwrap %s --%squote\n", "mode",
21458
+ modeDescr[p->mode], p->cmOpts.iWrap,
21459
+ p->cmOpts.bWordWrap ? "on" : "off",
21460
+ p->cmOpts.bQuote ? "" : "no");
2140621461
}else{
2140721462
utf8_printf(p->out, "%12.12s: %s\n","mode", modeDescr[p->mode]);
2140821463
}
2140921464
utf8_printf(p->out, "%12.12s: ", "nullvalue");
2141021465
output_c_string(p->out, p->nullValue);
2141121466
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -12143,10 +12143,19 @@
12143 EQPGraphRow *pRow; /* Linked list of all rows of the EQP output */
12144 EQPGraphRow *pLast; /* Last element of the pRow list */
12145 char zPrefix[100]; /* Graph prefix */
12146 };
12147
 
 
 
 
 
 
 
 
 
12148 /*
12149 ** State information about the database connection is contained in an
12150 ** instance of the following structure.
12151 */
12152 typedef struct ShellState ShellState;
@@ -12161,12 +12170,11 @@
12161 u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
12162 u8 nEqpLevel; /* Depth of the EQP output graph */
12163 u8 eTraceType; /* SHELL_TRACE_* value for type of trace */
12164 u8 bSafeMode; /* True to prohibit unsafe operations */
12165 u8 bSafeModePersist; /* The long-term value of bSafeMode */
12166 u8 bQuote; /* Quote results for .mode box and table */
12167 int iWrap; /* Wrap lines this long or longer in some output modes */
12168 unsigned statsOn; /* True to display memory stats before each finalize */
12169 unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */
12170 int inputNesting; /* Track nesting level of .read and other redirects */
12171 int outCount; /* Revert to stdout when reaching zero */
12172 int cnt; /* Number of records displayed so far */
@@ -14250,28 +14258,33 @@
14250 ** similar tabular formats. z[] might contain control characters such
14251 ** as \n, \t, \f, or \r.
14252 **
14253 ** Compute characters to display on the first line of z[]. Stop at the
14254 ** first \r, \n, or \f. Expand \t into spaces. Return a copy (obtained
14255 ** from malloc()) of that first line. Write anything to display
14256 ** on the next line into *pzTail. If this is the last line, write a NULL
14257 ** into *pzTail.
14258 */
14259 static char *translateForDisplayAndDup(
14260 const unsigned char *z,
14261 const unsigned char **pzTail,
14262 int mxWidth
 
14263 ){
14264 int i, j, n;
14265 unsigned char *zOut;
 
 
 
 
14266 if( z==0 ){
14267 *pzTail = 0;
14268 return 0;
14269 }
14270 if( mxWidth<0 ) mxWidth = -mxWidth;
14271 if( mxWidth==0 ) mxWidth = 1000000;
14272 i = j= n = 0;
14273 while( n<mxWidth ){
14274 if( z[i]>=' ' ){
14275 n++;
14276 do{ i++; j++; }while( (z[i]&0xc0)==0x80 );
14277 continue;
@@ -14279,16 +14292,33 @@
14279 if( z[i]=='\t' ){
14280 do{
14281 n++;
14282 j++;
14283 }while( (n&7)!=0 && n<mxWidth );
14284 n += 8;
14285 n &= ~7;
14286 i++;
14287 continue;
14288 }
14289 break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14290 }
14291 if( n>=mxWidth && z[i]>=' ' ){
14292 *pzTail = &z[i];
14293 }else if( z[i]=='\r' && z[i+1]=='\n' ){
14294 *pzTail = z[i+2] ? &z[i+2] : 0;
@@ -14298,11 +14328,11 @@
14298 *pzTail = &z[i+1];
14299 }
14300 zOut = malloc( j+1 );
14301 shell_check_oom(zOut);
14302 i = j = n = 0;
14303 while( n<mxWidth ){
14304 if( z[i]>=' ' ){
14305 n++;
14306 do{ zOut[j++] = z[i++]; }while( (z[i]&0xc0)==0x80 );
14307 continue;
14308 }
@@ -14380,10 +14410,11 @@
14380 const char *colSep = 0;
14381 const char *rowSep = 0;
14382 const unsigned char **azNextLine = 0;
14383 int bNextLine = 0;
14384 int bMultiLineRowExists = 0;
 
14385
14386 rc = sqlite3_step(pStmt);
14387 if( rc!=SQLITE_ROW ) return;
14388 nColumn = sqlite3_column_count(pStmt);
14389 nAlloc = nColumn*4;
@@ -14391,11 +14422,11 @@
14391 azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
14392 shell_check_oom(azData);
14393 azNextLine = sqlite3_malloc64( nColumn*sizeof(char*) );
14394 shell_check_oom((void*)azNextLine);
14395 memset((void*)azNextLine, 0, nColumn*sizeof(char*) );
14396 if( p->bQuote ){
14397 azQuoted = sqlite3_malloc64( nColumn*sizeof(char*) );
14398 shell_check_oom(azQuoted);
14399 memset(azQuoted, 0, nColumn*sizeof(char*) );
14400 }
14401 abRowDiv = sqlite3_malloc64( nAlloc/nColumn );
@@ -14412,11 +14443,18 @@
14412 w = p->colWidth[i];
14413 if( w<0 ) w = -w;
14414 p->actualWidth[i] = w;
14415 }
14416 for(i=0; i<nColumn; i++){
14417 azData[i] = strdup(sqlite3_column_name(pStmt,i));
 
 
 
 
 
 
 
14418 }
14419 do{
14420 int useNextLine = bNextLine;
14421 bNextLine = 0;
14422 if( (nRow+2)*nColumn >= nAlloc ){
@@ -14428,21 +14466,25 @@
14428 }
14429 abRowDiv[nRow] = 1;
14430 nRow++;
14431 for(i=0; i<nColumn; i++){
14432 int wx = p->colWidth[i];
14433 if( wx==0 ) wx = p->iWrap;
 
 
 
14434 if( useNextLine ){
14435 uz = azNextLine[i];
14436 }else if( p->bQuote ){
14437 sqlite3_free(azQuoted[i]);
14438 azQuoted[i] = quoted_column(pStmt,i);
14439 uz = (const unsigned char*)azQuoted[i];
14440 }else{
14441 uz = (const unsigned char*)sqlite3_column_text(pStmt,i);
14442 }
14443 azData[nRow*nColumn + i] = translateForDisplayAndDup(uz, &azNextLine[i], wx);
 
14444 if( azNextLine[i] ){
14445 bNextLine = 1;
14446 abRowDiv[nRow-1] = 0;
14447 bMultiLineRowExists = 1;
14448 }
@@ -14533,10 +14575,12 @@
14533 if( bMultiLineRowExists && abRowDiv[i/nColumn-1] && i+1<nTotal ){
14534 if( p->cMode==MODE_Table ){
14535 print_row_separator(p, nColumn, "+");
14536 }else if( p->cMode==MODE_Box ){
14537 print_box_row_separator(p, nColumn, BOX_123, BOX_1234, BOX_134);
 
 
14538 }
14539 }
14540 j = -1;
14541 if( seenInterrupt ) goto columnar_end;
14542 }else{
@@ -15336,11 +15380,11 @@
15336 " fkey-indexes Find missing foreign key indexes",
15337 #ifndef SQLITE_OMIT_LOAD_EXTENSION
15338 ".load FILE ?ENTRY? Load an extension library",
15339 #endif
15340 ".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
15341 ".mode MODE ?TABLE? ?OPTIONS? Set output mode",
15342 " MODE is one of:",
15343 " ascii Columns/rows delimited by 0x1F and 0x1E",
15344 " box Tables using unicode box-drawing characters",
15345 " csv Comma-separated values",
15346 " column Output in columns. (See .width)",
@@ -15353,15 +15397,18 @@
15353 " qbox Shorthand for \"box --width 60 --quote\"",
15354 " quote Escape answers as for SQL",
15355 " table ASCII-art table",
15356 " tabs Tab-separated values",
15357 " tcl TCL list elements",
15358 " OPTIONS: (value for columnar modes only):",
15359 " --wrap N Wrap output lines longer than N character",
15360 " --quote Quote output text as SQL literals",
15361 " --noquote Do not quote output text",
15362 ".nonce STRING Disable safe mode for one command if the nonce matches",
 
 
 
15363 ".nullvalue STRING Use STRING in place of NULL values",
15364 ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",
15365 " If FILE begins with '|' then open as a pipe",
15366 " --bom Put a UTF8 byte-order mark at the beginning",
15367 " -e Send output to the system text editor",
@@ -20140,33 +20187,43 @@
20140
20141 if( c=='m' && strncmp(azArg[0], "mode", n)==0 ){
20142 const char *zMode = 0;
20143 const char *zTabname = 0;
20144 int i, n2;
20145 int bQuoteChng = 0;
20146 int bWrapChng = 0;
20147 for(i=1; i<nArg; i++){
20148 const char *z = azArg[i];
20149 if( optionMatch(z,"wrap") && i+1<nArg ){
20150 p->iWrap = integerValue(azArg[++i]);
20151 bWrapChng = 1;
 
 
 
20152 }else if( optionMatch(z,"quote") ){
20153 p->bQuote = 1;
20154 bQuoteChng = 1;
20155 }else if( optionMatch(z,"noquote") ){
20156 p->bQuote = 0;
20157 bQuoteChng = 1;
20158 }else if( zMode==0 ){
20159 zMode = z;
 
 
 
 
 
 
 
 
20160 }else if( zTabname==0 ){
20161 zTabname = z;
20162 }else if( z[0]=='-' ){
20163 utf8_printf(stderr, "unknown option: %s\n", z);
20164 utf8_printf(stderr, "options:\n"
20165 " --noquote\n"
20166 " --quote\n"
20167 " --wrap N\n");
 
 
20168 rc = 1;
20169 goto meta_command_exit;
20170 }else{
20171 utf8_printf(stderr, "extra argument: \"%s\"\n", z);
20172 rc = 1;
@@ -20175,16 +20232,19 @@
20175 }
20176 if( zMode==0 ){
20177 if( p->mode==MODE_Column
20178 || (p->mode>=MODE_Markdown && p->mode<=MODE_Box)
20179 ){
20180 raw_printf(p->out, "current output mode: %s --wrap %d --%squote\n",
20181 modeDescr[p->mode], p->iWrap, p->bQuote ? "" : "no");
 
 
 
 
20182 }else{
20183 raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
20184 }
20185 bWrapChng = bQuoteChng = 1;
20186 zMode = modeDescr[p->mode];
20187 }
20188 n2 = strlen30(zMode);
20189 if( strncmp(zMode,"lines",n2)==0 ){
20190 p->mode = MODE_Line;
@@ -20193,12 +20253,11 @@
20193 p->mode = MODE_Column;
20194 if( (p->shellFlgs & SHFLG_HeaderSet)==0 ){
20195 p->showHeader = 1;
20196 }
20197 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
20198 if( !bWrapChng ) p->iWrap = 0;
20199 if( !bQuoteChng ) p->bQuote = 0;
20200 }else if( strncmp(zMode,"list",n2)==0 ){
20201 p->mode = MODE_List;
20202 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Column);
20203 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
20204 }else if( strncmp(zMode,"html",n2)==0 ){
@@ -20225,24 +20284,17 @@
20225 p->mode = MODE_Ascii;
20226 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
20227 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
20228 }else if( strncmp(zMode,"markdown",n2)==0 ){
20229 p->mode = MODE_Markdown;
20230 if( !bWrapChng ) p->iWrap = 0;
20231 if( !bQuoteChng ) p->bQuote = 0;
20232 }else if( strncmp(zMode,"table",n2)==0 ){
20233 p->mode = MODE_Table;
20234 if( !bWrapChng ) p->iWrap = 0;
20235 if( !bQuoteChng ) p->bQuote = 0;
20236 }else if( strncmp(zMode,"box",n2)==0 ){
20237 p->mode = MODE_Box;
20238 if( !bWrapChng ) p->iWrap = 0;
20239 if( !bQuoteChng ) p->bQuote = 0;
20240 }else if( strcmp(zMode,"qbox")==0 ){
20241 p->mode = MODE_Box;
20242 if( !bWrapChng ) p->iWrap = 60;
20243 if( !bQuoteChng ) p->bQuote = 1;
20244 }else if( strncmp(zMode,"count",n2)==0 ){
20245 p->mode = MODE_Count;
20246 }else if( strncmp(zMode,"off",n2)==0 ){
20247 p->mode = MODE_Off;
20248 }else if( strncmp(zMode,"json",n2)==0 ){
@@ -21399,12 +21451,15 @@
21399 p->mode==MODE_Explain ? "on" : p->autoExplain ? "auto" : "off");
21400 utf8_printf(p->out,"%12.12s: %s\n","headers", azBool[p->showHeader!=0]);
21401 if( p->mode==MODE_Column
21402 || (p->mode>=MODE_Markdown && p->mode<=MODE_Box)
21403 ){
21404 utf8_printf(p->out, "%12.12s: %s --wrap %d --%squote\n", "mode",
21405 modeDescr[p->mode], p->iWrap, p->bQuote ? "" : "no");
 
 
 
21406 }else{
21407 utf8_printf(p->out, "%12.12s: %s\n","mode", modeDescr[p->mode]);
21408 }
21409 utf8_printf(p->out, "%12.12s: ", "nullvalue");
21410 output_c_string(p->out, p->nullValue);
21411
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -12143,10 +12143,19 @@
12143 EQPGraphRow *pRow; /* Linked list of all rows of the EQP output */
12144 EQPGraphRow *pLast; /* Last element of the pRow list */
12145 char zPrefix[100]; /* Graph prefix */
12146 };
12147
12148 /* Parameters affecting columnar mode result display (defaulting together) */
12149 typedef struct ColModeOpts {
12150 int iWrap; /* In columnar modes, wrap lines reaching this limit */
12151 u8 bQuote; /* Quote results for .mode box and table */
12152 u8 bWordWrap; /* In columnar modes, wrap at word boundaries */
12153 } ColModeOpts;
12154 #define ColModeOpts_default { 60, 0, 0 }
12155 #define ColModeOpts_default_qbox { 60, 1, 0 }
12156
12157 /*
12158 ** State information about the database connection is contained in an
12159 ** instance of the following structure.
12160 */
12161 typedef struct ShellState ShellState;
@@ -12161,12 +12170,11 @@
12170 u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
12171 u8 nEqpLevel; /* Depth of the EQP output graph */
12172 u8 eTraceType; /* SHELL_TRACE_* value for type of trace */
12173 u8 bSafeMode; /* True to prohibit unsafe operations */
12174 u8 bSafeModePersist; /* The long-term value of bSafeMode */
12175 ColModeOpts cmOpts; /* Option values affecting columnar mode output */
 
12176 unsigned statsOn; /* True to display memory stats before each finalize */
12177 unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */
12178 int inputNesting; /* Track nesting level of .read and other redirects */
12179 int outCount; /* Revert to stdout when reaching zero */
12180 int cnt; /* Number of records displayed so far */
@@ -14250,28 +14258,33 @@
14258 ** similar tabular formats. z[] might contain control characters such
14259 ** as \n, \t, \f, or \r.
14260 **
14261 ** Compute characters to display on the first line of z[]. Stop at the
14262 ** first \r, \n, or \f. Expand \t into spaces. Return a copy (obtained
14263 ** from malloc()) of that first line, which caller should free sometime.
14264 ** Write anything to display on the next line into *pzTail. If this is
14265 ** the last line, write a NULL into *pzTail. (*pzTail is not allocated.)
14266 */
14267 static char *translateForDisplayAndDup(
14268 const unsigned char *z, /* Input text to be transformed */
14269 const unsigned char **pzTail, /* OUT: Tail of the input for next line */
14270 int mxWidth, /* Max width. 0 means no limit */
14271 u8 bWordWrap /* If true, avoid breaking mid-word */
14272 ){
14273 int i; /* Input bytes consumed */
14274 int j; /* Output bytes generated */
14275 int k; /* Input bytes to be displayed */
14276 int n; /* Output column number */
14277 unsigned char *zOut; /* Output text */
14278
14279 if( z==0 ){
14280 *pzTail = 0;
14281 return 0;
14282 }
14283 if( mxWidth<0 ) mxWidth = -mxWidth;
14284 if( mxWidth==0 ) mxWidth = 1000000;
14285 i = j = n = 0;
14286 while( n<mxWidth ){
14287 if( z[i]>=' ' ){
14288 n++;
14289 do{ i++; j++; }while( (z[i]&0xc0)==0x80 );
14290 continue;
@@ -14279,16 +14292,33 @@
14292 if( z[i]=='\t' ){
14293 do{
14294 n++;
14295 j++;
14296 }while( (n&7)!=0 && n<mxWidth );
 
 
14297 i++;
14298 continue;
14299 }
14300 break;
14301 }
14302 if( n>=mxWidth && bWordWrap ){
14303 /* Perhaps try to back up to a better place to break the line */
14304 for(k=i; k>i/2; k--){
14305 if( isspace(z[k-1]) ) break;
14306 }
14307 if( k<=i/2 ){
14308 for(k=i; k>i/2; k--){
14309 if( isalnum(z[k-1])!=isalnum(z[k]) && (z[k]&0xc0)!=0x80 ) break;
14310 }
14311 }
14312 if( k<=i/2 ){
14313 k = i;
14314 }else{
14315 i = k;
14316 while( z[i]==' ' ) i++;
14317 }
14318 }else{
14319 k = i;
14320 }
14321 if( n>=mxWidth && z[i]>=' ' ){
14322 *pzTail = &z[i];
14323 }else if( z[i]=='\r' && z[i+1]=='\n' ){
14324 *pzTail = z[i+2] ? &z[i+2] : 0;
@@ -14298,11 +14328,11 @@
14328 *pzTail = &z[i+1];
14329 }
14330 zOut = malloc( j+1 );
14331 shell_check_oom(zOut);
14332 i = j = n = 0;
14333 while( i<k ){
14334 if( z[i]>=' ' ){
14335 n++;
14336 do{ zOut[j++] = z[i++]; }while( (z[i]&0xc0)==0x80 );
14337 continue;
14338 }
@@ -14380,10 +14410,11 @@
14410 const char *colSep = 0;
14411 const char *rowSep = 0;
14412 const unsigned char **azNextLine = 0;
14413 int bNextLine = 0;
14414 int bMultiLineRowExists = 0;
14415 int bw = p->cmOpts.bWordWrap;
14416
14417 rc = sqlite3_step(pStmt);
14418 if( rc!=SQLITE_ROW ) return;
14419 nColumn = sqlite3_column_count(pStmt);
14420 nAlloc = nColumn*4;
@@ -14391,11 +14422,11 @@
14422 azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
14423 shell_check_oom(azData);
14424 azNextLine = sqlite3_malloc64( nColumn*sizeof(char*) );
14425 shell_check_oom((void*)azNextLine);
14426 memset((void*)azNextLine, 0, nColumn*sizeof(char*) );
14427 if( p->cmOpts.bQuote ){
14428 azQuoted = sqlite3_malloc64( nColumn*sizeof(char*) );
14429 shell_check_oom(azQuoted);
14430 memset(azQuoted, 0, nColumn*sizeof(char*) );
14431 }
14432 abRowDiv = sqlite3_malloc64( nAlloc/nColumn );
@@ -14412,11 +14443,18 @@
14443 w = p->colWidth[i];
14444 if( w<0 ) w = -w;
14445 p->actualWidth[i] = w;
14446 }
14447 for(i=0; i<nColumn; i++){
14448 const unsigned char *zNotUsed;
14449 int wx = p->colWidth[i];
14450 if( wx==0 ){
14451 wx = p->cmOpts.iWrap;
14452 }
14453 if( wx<0 ) wx = -wx;
14454 uz = (const unsigned char*)sqlite3_column_name(pStmt,i);
14455 azData[i] = translateForDisplayAndDup(uz, &zNotUsed, wx, bw);
14456 }
14457 do{
14458 int useNextLine = bNextLine;
14459 bNextLine = 0;
14460 if( (nRow+2)*nColumn >= nAlloc ){
@@ -14428,21 +14466,25 @@
14466 }
14467 abRowDiv[nRow] = 1;
14468 nRow++;
14469 for(i=0; i<nColumn; i++){
14470 int wx = p->colWidth[i];
14471 if( wx==0 ){
14472 wx = p->cmOpts.iWrap;
14473 }
14474 if( wx<0 ) wx = -wx;
14475 if( useNextLine ){
14476 uz = azNextLine[i];
14477 }else if( p->cmOpts.bQuote ){
14478 sqlite3_free(azQuoted[i]);
14479 azQuoted[i] = quoted_column(pStmt,i);
14480 uz = (const unsigned char*)azQuoted[i];
14481 }else{
14482 uz = (const unsigned char*)sqlite3_column_text(pStmt,i);
14483 }
14484 azData[nRow*nColumn + i]
14485 = translateForDisplayAndDup(uz, &azNextLine[i], wx, bw);
14486 if( azNextLine[i] ){
14487 bNextLine = 1;
14488 abRowDiv[nRow-1] = 0;
14489 bMultiLineRowExists = 1;
14490 }
@@ -14533,10 +14575,12 @@
14575 if( bMultiLineRowExists && abRowDiv[i/nColumn-1] && i+1<nTotal ){
14576 if( p->cMode==MODE_Table ){
14577 print_row_separator(p, nColumn, "+");
14578 }else if( p->cMode==MODE_Box ){
14579 print_box_row_separator(p, nColumn, BOX_123, BOX_1234, BOX_134);
14580 }else if( p->cMode==MODE_Column ){
14581 raw_printf(p->out, "\n");
14582 }
14583 }
14584 j = -1;
14585 if( seenInterrupt ) goto columnar_end;
14586 }else{
@@ -15336,11 +15380,11 @@
15380 " fkey-indexes Find missing foreign key indexes",
15381 #ifndef SQLITE_OMIT_LOAD_EXTENSION
15382 ".load FILE ?ENTRY? Load an extension library",
15383 #endif
15384 ".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
15385 ".mode MODE ?OPTIONS? Set output mode",
15386 " MODE is one of:",
15387 " ascii Columns/rows delimited by 0x1F and 0x1E",
15388 " box Tables using unicode box-drawing characters",
15389 " csv Comma-separated values",
15390 " column Output in columns. (See .width)",
@@ -15353,15 +15397,18 @@
15397 " qbox Shorthand for \"box --width 60 --quote\"",
15398 " quote Escape answers as for SQL",
15399 " table ASCII-art table",
15400 " tabs Tab-separated values",
15401 " tcl TCL list elements",
15402 " OPTIONS: (for columnar modes or insert mode):",
15403 " --wrap N Wrap output lines to no longer than N characters",
15404 " --wordwrap B Wrap or not at word boundaries per B (on/off)",
15405 " --ww Shorthand for \"--wordwrap 1\"",
15406 " --quote Quote output text as SQL literals",
15407 " --noquote Do not quote output text",
15408 " TABLE The name of SQL table used for \"insert\" mode",
15409 ".nonce STRING Suspend safe mode for one command if nonce matches",
15410 ".nullvalue STRING Use STRING in place of NULL values",
15411 ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",
15412 " If FILE begins with '|' then open as a pipe",
15413 " --bom Put a UTF8 byte-order mark at the beginning",
15414 " -e Send output to the system text editor",
@@ -20140,33 +20187,43 @@
20187
20188 if( c=='m' && strncmp(azArg[0], "mode", n)==0 ){
20189 const char *zMode = 0;
20190 const char *zTabname = 0;
20191 int i, n2;
20192 ColModeOpts cmOpts = ColModeOpts_default;
 
20193 for(i=1; i<nArg; i++){
20194 const char *z = azArg[i];
20195 if( optionMatch(z,"wrap") && i+1<nArg ){
20196 cmOpts.iWrap = integerValue(azArg[++i]);
20197 }else if( optionMatch(z,"ww") ){
20198 cmOpts.bWordWrap = 1;
20199 }else if( optionMatch(z,"wordwrap") && i+1<nArg ){
20200 cmOpts.bWordWrap = (u8)booleanValue(azArg[++i]);
20201 }else if( optionMatch(z,"quote") ){
20202 cmOpts.bQuote = 1;
 
20203 }else if( optionMatch(z,"noquote") ){
20204 cmOpts.bQuote = 0;
 
20205 }else if( zMode==0 ){
20206 zMode = z;
20207 /* Apply defaults for qbox pseudo-mods. If that
20208 * overwrites already-set values, user was informed of this.
20209 */
20210 if( strcmp(z, "qbox")==0 ){
20211 ColModeOpts cmo = ColModeOpts_default_qbox;
20212 zMode = "box";
20213 cmOpts = cmo;
20214 }
20215 }else if( zTabname==0 ){
20216 zTabname = z;
20217 }else if( z[0]=='-' ){
20218 utf8_printf(stderr, "unknown option: %s\n", z);
20219 utf8_printf(stderr, "options:\n"
20220 " --noquote\n"
20221 " --quote\n"
20222 " --wordwrap on/off\n"
20223 " --wrap N\n"
20224 " --ww\n");
20225 rc = 1;
20226 goto meta_command_exit;
20227 }else{
20228 utf8_printf(stderr, "extra argument: \"%s\"\n", z);
20229 rc = 1;
@@ -20175,16 +20232,19 @@
20232 }
20233 if( zMode==0 ){
20234 if( p->mode==MODE_Column
20235 || (p->mode>=MODE_Markdown && p->mode<=MODE_Box)
20236 ){
20237 raw_printf
20238 (p->out,
20239 "current output mode: %s --wrap %d --wordwrap %s --%squote\n",
20240 modeDescr[p->mode], p->cmOpts.iWrap,
20241 p->cmOpts.bWordWrap ? "on" : "off",
20242 p->cmOpts.bQuote ? "" : "no");
20243 }else{
20244 raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
20245 }
 
20246 zMode = modeDescr[p->mode];
20247 }
20248 n2 = strlen30(zMode);
20249 if( strncmp(zMode,"lines",n2)==0 ){
20250 p->mode = MODE_Line;
@@ -20193,12 +20253,11 @@
20253 p->mode = MODE_Column;
20254 if( (p->shellFlgs & SHFLG_HeaderSet)==0 ){
20255 p->showHeader = 1;
20256 }
20257 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
20258 p->cmOpts = cmOpts;
 
20259 }else if( strncmp(zMode,"list",n2)==0 ){
20260 p->mode = MODE_List;
20261 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Column);
20262 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
20263 }else if( strncmp(zMode,"html",n2)==0 ){
@@ -20225,24 +20284,17 @@
20284 p->mode = MODE_Ascii;
20285 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
20286 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
20287 }else if( strncmp(zMode,"markdown",n2)==0 ){
20288 p->mode = MODE_Markdown;
20289 p->cmOpts = cmOpts;
 
20290 }else if( strncmp(zMode,"table",n2)==0 ){
20291 p->mode = MODE_Table;
20292 p->cmOpts = cmOpts;
 
20293 }else if( strncmp(zMode,"box",n2)==0 ){
20294 p->mode = MODE_Box;
20295 p->cmOpts = cmOpts;
 
 
 
 
 
20296 }else if( strncmp(zMode,"count",n2)==0 ){
20297 p->mode = MODE_Count;
20298 }else if( strncmp(zMode,"off",n2)==0 ){
20299 p->mode = MODE_Off;
20300 }else if( strncmp(zMode,"json",n2)==0 ){
@@ -21399,12 +21451,15 @@
21451 p->mode==MODE_Explain ? "on" : p->autoExplain ? "auto" : "off");
21452 utf8_printf(p->out,"%12.12s: %s\n","headers", azBool[p->showHeader!=0]);
21453 if( p->mode==MODE_Column
21454 || (p->mode>=MODE_Markdown && p->mode<=MODE_Box)
21455 ){
21456 utf8_printf
21457 (p->out, "%12.12s: %s --wrap %d --wordwrap %s --%squote\n", "mode",
21458 modeDescr[p->mode], p->cmOpts.iWrap,
21459 p->cmOpts.bWordWrap ? "on" : "off",
21460 p->cmOpts.bQuote ? "" : "no");
21461 }else{
21462 utf8_printf(p->out, "%12.12s: %s\n","mode", modeDescr[p->mode]);
21463 }
21464 utf8_printf(p->out, "%12.12s: ", "nullvalue");
21465 output_c_string(p->out, p->nullValue);
21466
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452452
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453453
** [sqlite_version()] and [sqlite_source_id()].
454454
*/
455455
#define SQLITE_VERSION "3.38.0"
456456
#define SQLITE_VERSION_NUMBER 3038000
457
-#define SQLITE_SOURCE_ID "2022-01-31 16:29:06 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a"
457
+#define SQLITE_SOURCE_ID "2022-02-01 13:17:11 00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200"
458458
459459
/*
460460
** CAPI3REF: Run-Time Library Version Numbers
461461
** KEYWORDS: sqlite3_version sqlite3_sourceid
462462
**
@@ -233819,11 +233819,11 @@
233819233819
int nArg, /* Number of args */
233820233820
sqlite3_value **apUnused /* Function arguments */
233821233821
){
233822233822
assert( nArg==0 );
233823233823
UNUSED_PARAM2(nArg, apUnused);
233824
- sqlite3_result_text(pCtx, "fts5: 2022-01-31 16:29:06 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a", -1, SQLITE_TRANSIENT);
233824
+ sqlite3_result_text(pCtx, "fts5: 2022-02-01 12:28:17 1b528e31f8c62797e0814568b520c0680ff23a2ee877ca6aa70a167d40ebdf80", -1, SQLITE_TRANSIENT);
233825233825
}
233826233826
233827233827
/*
233828233828
** Return true if zName is the extension on one of the shadow tables used
233829233829
** by this module.
233830233830
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.38.0"
456 #define SQLITE_VERSION_NUMBER 3038000
457 #define SQLITE_SOURCE_ID "2022-01-31 16:29:06 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -233819,11 +233819,11 @@
233819 int nArg, /* Number of args */
233820 sqlite3_value **apUnused /* Function arguments */
233821 ){
233822 assert( nArg==0 );
233823 UNUSED_PARAM2(nArg, apUnused);
233824 sqlite3_result_text(pCtx, "fts5: 2022-01-31 16:29:06 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a", -1, SQLITE_TRANSIENT);
233825 }
233826
233827 /*
233828 ** Return true if zName is the extension on one of the shadow tables used
233829 ** by this module.
233830
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.38.0"
456 #define SQLITE_VERSION_NUMBER 3038000
457 #define SQLITE_SOURCE_ID "2022-02-01 13:17:11 00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -233819,11 +233819,11 @@
233819 int nArg, /* Number of args */
233820 sqlite3_value **apUnused /* Function arguments */
233821 ){
233822 assert( nArg==0 );
233823 UNUSED_PARAM2(nArg, apUnused);
233824 sqlite3_result_text(pCtx, "fts5: 2022-02-01 12:28:17 1b528e31f8c62797e0814568b520c0680ff23a2ee877ca6aa70a167d40ebdf80", -1, SQLITE_TRANSIENT);
233825 }
233826
233827 /*
233828 ** Return true if zName is the extension on one of the shadow tables used
233829 ** by this module.
233830
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.38.0"
150150
#define SQLITE_VERSION_NUMBER 3038000
151
-#define SQLITE_SOURCE_ID "2022-01-31 16:29:06 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a"
151
+#define SQLITE_SOURCE_ID "2022-02-01 13:17:11 00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.38.0"
150 #define SQLITE_VERSION_NUMBER 3038000
151 #define SQLITE_SOURCE_ID "2022-01-31 16:29:06 3ec6141c41a71eea0d96a65aa35c828e4d852d60e090513c312b925d0e257f9a"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.38.0"
150 #define SQLITE_VERSION_NUMBER 3038000
151 #define SQLITE_SOURCE_ID "2022-02-01 13:17:11 00b1b7020a564976da3237532434e47ccf17eb5d620e6ac45f3e70b5d5739200"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button