Fossil SCM

Update the built-in SQLite to the latest trunk version so that the "fossil sql" command can take advantage of the new ".mode box" setting.

drh 2020-06-04 18:38 trunk
Commit 363efffe9e27da5c2c14819f22daf07bc7f752241d56b94b466c0ed27b21264d
3 files changed +161 -42 +7 -7 +1 -1
+161 -42
--- src/shell.c
+++ src/shell.c
@@ -9859,10 +9859,11 @@
98599859
#define MODE_Pretty 11 /* Pretty-print schemas */
98609860
#define MODE_EQP 12 /* Converts EXPLAIN QUERY PLAN output into a graph */
98619861
#define MODE_Json 13 /* Output JSON */
98629862
#define MODE_Markdown 14 /* Markdown formatting */
98639863
#define MODE_Table 15 /* MySQL-style table formatting */
9864
+#define MODE_Box 16 /* Unicode box-drawing characters */
98649865
98659866
static const char *modeDescr[] = {
98669867
"line",
98679868
"column",
98689869
"list",
@@ -9876,11 +9877,12 @@
98769877
"ascii",
98779878
"prettyprint",
98789879
"eqp",
98799880
"json",
98809881
"markdown",
9881
- "table"
9882
+ "table",
9883
+ "box"
98829884
};
98839885
98849886
/*
98859887
** These are the column/row/line separators used by the various
98869888
** import/export modes.
@@ -10601,23 +10603,27 @@
1060110603
}
1060210604
raw_printf(out, "%.*s", N, zDash);
1060310605
}
1060410606
1060510607
/*
10606
-** Print a markdown or table-style row separator
10608
+** Print a markdown or table-style row separator using ascii-art
1060710609
*/
1060810610
static void print_row_separator(
1060910611
ShellState *p,
1061010612
int nArg,
1061110613
const char *zSep
1061210614
){
1061310615
int i;
10614
- for(i=0; i<nArg; i++){
10616
+ if( nArg>0 ){
10617
+ fputs(zSep, p->out);
10618
+ print_dashes(p->out, p->actualWidth[0]+2);
10619
+ for(i=1; i<nArg; i++){
10620
+ fputs(zSep, p->out);
10621
+ print_dashes(p->out, p->actualWidth[i]+2);
10622
+ }
1061510623
fputs(zSep, p->out);
10616
- print_dashes(p->out, p->actualWidth[i]+2);
1061710624
}
10618
- fputs(zSep, p->out);
1061910625
fputs("\n", p->out);
1062010626
}
1062110627
1062210628
/*
1062310629
** This is the callback routine that the shell
@@ -11611,14 +11617,81 @@
1161111617
}
1161211618
sqlite3_reset(pQ);
1161311619
}
1161411620
sqlite3_finalize(pQ);
1161511621
}
11622
+
11623
+/*
11624
+** UTF8 box-drawing characters. Imagine box lines like this:
11625
+**
11626
+** 1
11627
+** |
11628
+** 4 --+-- 2
11629
+** |
11630
+** 3
11631
+**
11632
+** Each box characters has between 2 and 4 of the lines leading from
11633
+** the center. The characters are here identified by the numbers of
11634
+** their corresponding lines.
11635
+*/
11636
+#define BOX_24 "\342\224\200" /* U+2500 --- */
11637
+#define BOX_13 "\342\224\202" /* U+2502 | */
11638
+#define BOX_23 "\342\224\214" /* U+250c ,- */
11639
+#define BOX_34 "\342\224\220" /* U+2510 -, */
11640
+#define BOX_12 "\342\224\224" /* U+2514 '- */
11641
+#define BOX_14 "\342\224\230" /* U+2518 -' */
11642
+#define BOX_123 "\342\224\234" /* U+251c |- */
11643
+#define BOX_134 "\342\224\244" /* U+2524 -| */
11644
+#define BOX_234 "\342\224\254" /* U+252c -,- */
11645
+#define BOX_124 "\342\224\264" /* U+2534 -'- */
11646
+#define BOX_1234 "\342\224\274" /* U+253c -|- */
11647
+
11648
+/* Draw horizontal line N characters long using unicode box
11649
+** characters
11650
+*/
11651
+static void print_box_line(FILE *out, int N){
11652
+ const char zDash[] =
11653
+ BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24
11654
+ BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24;
11655
+ const int nDash = sizeof(zDash) - 1;
11656
+ N *= 3;
11657
+ while( N>nDash ){
11658
+ utf8_printf(out, zDash);
11659
+ N -= nDash;
11660
+ }
11661
+ utf8_printf(out, "%.*s", N, zDash);
11662
+}
11663
+
11664
+/*
11665
+** Draw a horizontal separator for a MODE_Box table.
11666
+*/
11667
+static void print_box_row_separator(
11668
+ ShellState *p,
11669
+ int nArg,
11670
+ const char *zSep1,
11671
+ const char *zSep2,
11672
+ const char *zSep3
11673
+){
11674
+ int i;
11675
+ if( nArg>0 ){
11676
+ utf8_printf(p->out, "%s", zSep1);
11677
+ print_box_line(p->out, p->actualWidth[0]+2);
11678
+ for(i=1; i<nArg; i++){
11679
+ utf8_printf(p->out, "%s", zSep2);
11680
+ print_box_line(p->out, p->actualWidth[i]+2);
11681
+ }
11682
+ utf8_printf(p->out, "%s", zSep3);
11683
+ }
11684
+ fputs("\n", p->out);
11685
+}
11686
+
11687
+
1161611688
1161711689
/*
1161811690
** Run a prepared statement and output the result in one of the
11619
-** table-oriented formats: MODE_Column, MODE_Markdown, or MODE_Table.
11691
+** table-oriented formats: MODE_Column, MODE_Markdown, MODE_Table,
11692
+** or MODE_Box.
1162011693
**
1162111694
** This is different from ordinary exec_prepared_stmt() in that
1162211695
** it has to run the entire query and gather the results into memory
1162311696
** first, in order to determine column widths, before providing
1162411697
** any output.
@@ -11632,20 +11705,24 @@
1163211705
char **azData = 0;
1163311706
char *zMsg = 0;
1163411707
const char *z;
1163511708
int rc;
1163611709
int i, j, nTotal, w, n;
11637
- const char *colSep;
11638
- const char *rowSep;
11710
+ const char *colSep = 0;
11711
+ const char *rowSep = 0;
1163911712
1164011713
rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
1164111714
&azData, &nRow, &nColumn, &zMsg);
1164211715
if( rc ){
1164311716
utf8_printf(p->out, "ERROR: %s\n", zMsg);
1164411717
sqlite3_free(zMsg);
1164511718
sqlite3_free_table(azData);
1164611719
return;
11720
+ }
11721
+ if( nRow==0 || nColumn==0 ){
11722
+ sqlite3_free_table(azData);
11723
+ return;
1164711724
}
1164811725
if( nColumn>p->nWidth ){
1164911726
p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
1165011727
if( p->colWidth==0 ) shell_out_of_memory();
1165111728
for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
@@ -11664,54 +11741,91 @@
1166411741
if( z==0 ) z = p->nullValue;
1166511742
n = strlenChar(z);
1166611743
j = i%nColumn;
1166711744
if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
1166811745
}
11669
- if( p->cMode==MODE_Column ){
11670
- colSep = " ";
11671
- rowSep = "\n";
11672
- if( p->showHeader ){
11673
- for(i=0; i<nColumn; i++){
11674
- w = p->actualWidth[i];
11675
- if( p->colWidth[i]<0 ) w = -w;
11676
- utf8_width_print(p->out, w, azData[i]);
11677
- fputs(i==nColumn-1?"\n":" ", p->out);
11678
- }
11679
- for(i=0; i<nColumn; i++){
11680
- print_dashes(p->out, p->actualWidth[i]);
11681
- fputs(i==nColumn-1?"\n":" ", p->out);
11682
- }
11683
- }
11684
- }else{
11685
- colSep = " | ";
11686
- rowSep = " |\n";
11687
- if( p->cMode==MODE_Table ) print_row_separator(p, nColumn, "+");
11688
- fputs("| ", p->out);
11689
- for(i=0; i<nColumn; i++){
11690
- w = p->actualWidth[i];
11691
- n = strlenChar(azData[i]);
11692
- utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11693
- fputs(i==nColumn-1?" |\n":" | ", p->out);
11694
- }
11695
- print_row_separator(p, nColumn, p->cMode==MODE_Table ? "+" : "|");
11746
+ switch( p->cMode ){
11747
+ case MODE_Column: {
11748
+ colSep = " ";
11749
+ rowSep = "\n";
11750
+ if( p->showHeader ){
11751
+ for(i=0; i<nColumn; i++){
11752
+ w = p->actualWidth[i];
11753
+ if( p->colWidth[i]<0 ) w = -w;
11754
+ utf8_width_print(p->out, w, azData[i]);
11755
+ fputs(i==nColumn-1?"\n":" ", p->out);
11756
+ }
11757
+ for(i=0; i<nColumn; i++){
11758
+ print_dashes(p->out, p->actualWidth[i]);
11759
+ fputs(i==nColumn-1?"\n":" ", p->out);
11760
+ }
11761
+ }
11762
+ break;
11763
+ }
11764
+ case MODE_Table: {
11765
+ colSep = " | ";
11766
+ rowSep = " |\n";
11767
+ print_row_separator(p, nColumn, "+");
11768
+ fputs("| ", p->out);
11769
+ for(i=0; i<nColumn; i++){
11770
+ w = p->actualWidth[i];
11771
+ n = strlenChar(azData[i]);
11772
+ utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11773
+ fputs(i==nColumn-1?" |\n":" | ", p->out);
11774
+ }
11775
+ print_row_separator(p, nColumn, "+");
11776
+ break;
11777
+ }
11778
+ case MODE_Markdown: {
11779
+ colSep = " | ";
11780
+ rowSep = " |\n";
11781
+ fputs("| ", p->out);
11782
+ for(i=0; i<nColumn; i++){
11783
+ w = p->actualWidth[i];
11784
+ n = strlenChar(azData[i]);
11785
+ utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11786
+ fputs(i==nColumn-1?" |\n":" | ", p->out);
11787
+ }
11788
+ print_row_separator(p, nColumn, "|");
11789
+ break;
11790
+ }
11791
+ case MODE_Box: {
11792
+ colSep = " " BOX_13 " ";
11793
+ rowSep = " " BOX_13 "\n";
11794
+ print_box_row_separator(p, nColumn, BOX_23, BOX_234, BOX_34);
11795
+ utf8_printf(p->out, BOX_13 " ");
11796
+ for(i=0; i<nColumn; i++){
11797
+ w = p->actualWidth[i];
11798
+ n = strlenChar(azData[i]);
11799
+ utf8_printf(p->out, "%*s%s%*s%s",
11800
+ (w-n)/2, "", azData[i], (w-n+1)/2, "",
11801
+ i==nColumn-1?" "BOX_13"\n":" "BOX_13" ");
11802
+ }
11803
+ print_box_row_separator(p, nColumn, BOX_123, BOX_1234, BOX_134);
11804
+ break;
11805
+ }
1169611806
}
1169711807
for(i=nColumn, j=0; i<nTotal; i++, j++){
11698
- if( j==0 && p->cMode!=MODE_Column ) fputs("| ", p->out);
11808
+ if( j==0 && p->cMode!=MODE_Column ){
11809
+ utf8_printf(p->out, "%s", p->cMode==MODE_Box?BOX_13" ":"| ");
11810
+ }
1169911811
z = azData[i];
1170011812
if( z==0 ) z = p->nullValue;
1170111813
w = p->actualWidth[j];
1170211814
if( p->colWidth[j]<0 ) w = -w;
1170311815
utf8_width_print(p->out, w, z);
1170411816
if( j==nColumn-1 ){
11705
- fputs(rowSep, p->out);
11817
+ utf8_printf(p->out, "%s", rowSep);
1170611818
j = -1;
1170711819
}else{
11708
- fputs(colSep, p->out);
11820
+ utf8_printf(p->out, "%s", colSep);
1170911821
}
1171011822
}
1171111823
if( p->cMode==MODE_Table ){
1171211824
print_row_separator(p, nColumn, "+");
11825
+ }else if( p->cMode==MODE_Box ){
11826
+ print_box_row_separator(p, nColumn, BOX_12, BOX_124, BOX_14);
1171311827
}
1171411828
sqlite3_free_table(azData);
1171511829
}
1171611830
1171711831
/*
@@ -11723,10 +11837,11 @@
1172311837
){
1172411838
int rc;
1172511839
1172611840
if( pArg->cMode==MODE_Column
1172711841
|| pArg->cMode==MODE_Table
11842
+ || pArg->cMode==MODE_Box
1172811843
|| pArg->cMode==MODE_Markdown
1172911844
){
1173011845
exec_prepared_stmt_columnar(pArg, pStmt);
1173111846
return;
1173211847
}
@@ -11776,13 +11891,11 @@
1177611891
rc = sqlite3_step(pStmt);
1177711892
}
1177811893
}
1177911894
} while( SQLITE_ROW == rc );
1178011895
sqlite3_free(pData);
11781
- if( pArg->cMode==MODE_Table ){
11782
- print_row_separator(pArg, nCol, "+");
11783
- }else if( pArg->cMode==MODE_Json ){
11896
+ if( pArg->cMode==MODE_Json ){
1178411897
fputs("]\n", pArg->out);
1178511898
}
1178611899
}
1178711900
}
1178811901
}
@@ -12462,10 +12575,11 @@
1246212575
#endif
1246312576
".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
1246412577
".mode MODE ?TABLE? Set output mode",
1246512578
" MODE is one of:",
1246612579
" ascii Columns/rows delimited by 0x1F and 0x1E",
12580
+ " box Tables using unicode box-drawing characters",
1246712581
" csv Comma-separated values",
1246812582
" column Output in columns. (See .width)",
1246912583
" html HTML <table> code",
1247012584
" insert SQL insert statements for TABLE",
1247112585
" json Results in a JSON array",
@@ -17075,17 +17189,19 @@
1707517189
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
1707617190
}else if( c2=='m' && strncmp(azArg[1],"markdown",n2)==0 ){
1707717191
p->mode = MODE_Markdown;
1707817192
}else if( c2=='t' && strncmp(azArg[1],"table",n2)==0 ){
1707917193
p->mode = MODE_Table;
17194
+ }else if( c2=='b' && strncmp(azArg[1],"box",n2)==0 ){
17195
+ p->mode = MODE_Box;
1708017196
}else if( c2=='j' && strncmp(azArg[1],"json",n2)==0 ){
1708117197
p->mode = MODE_Json;
1708217198
}else if( nArg==1 ){
1708317199
raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
1708417200
}else{
1708517201
raw_printf(stderr, "Error: mode should be one of: "
17086
- "ascii column csv html insert json line list markdown "
17202
+ "ascii box column csv html insert json line list markdown "
1708717203
"quote table tabs tcl\n");
1708817204
rc = 1;
1708917205
}
1709017206
p->cMode = p->mode;
1709117207
}else
@@ -19081,10 +19197,11 @@
1908119197
#endif
1908219198
" -append append the database to the end of the file\n"
1908319199
" -ascii set output mode to 'ascii'\n"
1908419200
" -bail stop after hitting an error\n"
1908519201
" -batch force batch I/O\n"
19202
+ " -box set output mode to 'box'\n"
1908619203
" -column set output mode to 'column'\n"
1908719204
" -cmd COMMAND run \"COMMAND\" before reading stdin\n"
1908819205
" -csv set output mode to 'csv'\n"
1908919206
#if defined(SQLITE_ENABLE_DESERIALIZE)
1909019207
" -deserialize open the database using sqlite3_deserialize()\n"
@@ -19528,10 +19645,12 @@
1952819645
data.mode = MODE_Json;
1952919646
}else if( strcmp(z,"-markdown")==0 ){
1953019647
data.mode = MODE_Markdown;
1953119648
}else if( strcmp(z,"-table")==0 ){
1953219649
data.mode = MODE_Table;
19650
+ }else if( strcmp(z,"-box")==0 ){
19651
+ data.mode = MODE_Box;
1953319652
}else if( strcmp(z,"-csv")==0 ){
1953419653
data.mode = MODE_Csv;
1953519654
memcpy(data.colSeparator,",",2);
1953619655
#ifdef SQLITE_HAVE_ZLIB
1953719656
}else if( strcmp(z,"-zip")==0 ){
1953819657
--- src/shell.c
+++ src/shell.c
@@ -9859,10 +9859,11 @@
9859 #define MODE_Pretty 11 /* Pretty-print schemas */
9860 #define MODE_EQP 12 /* Converts EXPLAIN QUERY PLAN output into a graph */
9861 #define MODE_Json 13 /* Output JSON */
9862 #define MODE_Markdown 14 /* Markdown formatting */
9863 #define MODE_Table 15 /* MySQL-style table formatting */
 
9864
9865 static const char *modeDescr[] = {
9866 "line",
9867 "column",
9868 "list",
@@ -9876,11 +9877,12 @@
9876 "ascii",
9877 "prettyprint",
9878 "eqp",
9879 "json",
9880 "markdown",
9881 "table"
 
9882 };
9883
9884 /*
9885 ** These are the column/row/line separators used by the various
9886 ** import/export modes.
@@ -10601,23 +10603,27 @@
10601 }
10602 raw_printf(out, "%.*s", N, zDash);
10603 }
10604
10605 /*
10606 ** Print a markdown or table-style row separator
10607 */
10608 static void print_row_separator(
10609 ShellState *p,
10610 int nArg,
10611 const char *zSep
10612 ){
10613 int i;
10614 for(i=0; i<nArg; i++){
 
 
 
 
 
 
10615 fputs(zSep, p->out);
10616 print_dashes(p->out, p->actualWidth[i]+2);
10617 }
10618 fputs(zSep, p->out);
10619 fputs("\n", p->out);
10620 }
10621
10622 /*
10623 ** This is the callback routine that the shell
@@ -11611,14 +11617,81 @@
11611 }
11612 sqlite3_reset(pQ);
11613 }
11614 sqlite3_finalize(pQ);
11615 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11616
11617 /*
11618 ** Run a prepared statement and output the result in one of the
11619 ** table-oriented formats: MODE_Column, MODE_Markdown, or MODE_Table.
 
11620 **
11621 ** This is different from ordinary exec_prepared_stmt() in that
11622 ** it has to run the entire query and gather the results into memory
11623 ** first, in order to determine column widths, before providing
11624 ** any output.
@@ -11632,20 +11705,24 @@
11632 char **azData = 0;
11633 char *zMsg = 0;
11634 const char *z;
11635 int rc;
11636 int i, j, nTotal, w, n;
11637 const char *colSep;
11638 const char *rowSep;
11639
11640 rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
11641 &azData, &nRow, &nColumn, &zMsg);
11642 if( rc ){
11643 utf8_printf(p->out, "ERROR: %s\n", zMsg);
11644 sqlite3_free(zMsg);
11645 sqlite3_free_table(azData);
11646 return;
 
 
 
 
11647 }
11648 if( nColumn>p->nWidth ){
11649 p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
11650 if( p->colWidth==0 ) shell_out_of_memory();
11651 for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
@@ -11664,54 +11741,91 @@
11664 if( z==0 ) z = p->nullValue;
11665 n = strlenChar(z);
11666 j = i%nColumn;
11667 if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
11668 }
11669 if( p->cMode==MODE_Column ){
11670 colSep = " ";
11671 rowSep = "\n";
11672 if( p->showHeader ){
11673 for(i=0; i<nColumn; i++){
11674 w = p->actualWidth[i];
11675 if( p->colWidth[i]<0 ) w = -w;
11676 utf8_width_print(p->out, w, azData[i]);
11677 fputs(i==nColumn-1?"\n":" ", p->out);
11678 }
11679 for(i=0; i<nColumn; i++){
11680 print_dashes(p->out, p->actualWidth[i]);
11681 fputs(i==nColumn-1?"\n":" ", p->out);
11682 }
11683 }
11684 }else{
11685 colSep = " | ";
11686 rowSep = " |\n";
11687 if( p->cMode==MODE_Table ) print_row_separator(p, nColumn, "+");
11688 fputs("| ", p->out);
11689 for(i=0; i<nColumn; i++){
11690 w = p->actualWidth[i];
11691 n = strlenChar(azData[i]);
11692 utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11693 fputs(i==nColumn-1?" |\n":" | ", p->out);
11694 }
11695 print_row_separator(p, nColumn, p->cMode==MODE_Table ? "+" : "|");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11696 }
11697 for(i=nColumn, j=0; i<nTotal; i++, j++){
11698 if( j==0 && p->cMode!=MODE_Column ) fputs("| ", p->out);
 
 
11699 z = azData[i];
11700 if( z==0 ) z = p->nullValue;
11701 w = p->actualWidth[j];
11702 if( p->colWidth[j]<0 ) w = -w;
11703 utf8_width_print(p->out, w, z);
11704 if( j==nColumn-1 ){
11705 fputs(rowSep, p->out);
11706 j = -1;
11707 }else{
11708 fputs(colSep, p->out);
11709 }
11710 }
11711 if( p->cMode==MODE_Table ){
11712 print_row_separator(p, nColumn, "+");
 
 
11713 }
11714 sqlite3_free_table(azData);
11715 }
11716
11717 /*
@@ -11723,10 +11837,11 @@
11723 ){
11724 int rc;
11725
11726 if( pArg->cMode==MODE_Column
11727 || pArg->cMode==MODE_Table
 
11728 || pArg->cMode==MODE_Markdown
11729 ){
11730 exec_prepared_stmt_columnar(pArg, pStmt);
11731 return;
11732 }
@@ -11776,13 +11891,11 @@
11776 rc = sqlite3_step(pStmt);
11777 }
11778 }
11779 } while( SQLITE_ROW == rc );
11780 sqlite3_free(pData);
11781 if( pArg->cMode==MODE_Table ){
11782 print_row_separator(pArg, nCol, "+");
11783 }else if( pArg->cMode==MODE_Json ){
11784 fputs("]\n", pArg->out);
11785 }
11786 }
11787 }
11788 }
@@ -12462,10 +12575,11 @@
12462 #endif
12463 ".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
12464 ".mode MODE ?TABLE? Set output mode",
12465 " MODE is one of:",
12466 " ascii Columns/rows delimited by 0x1F and 0x1E",
 
12467 " csv Comma-separated values",
12468 " column Output in columns. (See .width)",
12469 " html HTML <table> code",
12470 " insert SQL insert statements for TABLE",
12471 " json Results in a JSON array",
@@ -17075,17 +17189,19 @@
17075 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
17076 }else if( c2=='m' && strncmp(azArg[1],"markdown",n2)==0 ){
17077 p->mode = MODE_Markdown;
17078 }else if( c2=='t' && strncmp(azArg[1],"table",n2)==0 ){
17079 p->mode = MODE_Table;
 
 
17080 }else if( c2=='j' && strncmp(azArg[1],"json",n2)==0 ){
17081 p->mode = MODE_Json;
17082 }else if( nArg==1 ){
17083 raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
17084 }else{
17085 raw_printf(stderr, "Error: mode should be one of: "
17086 "ascii column csv html insert json line list markdown "
17087 "quote table tabs tcl\n");
17088 rc = 1;
17089 }
17090 p->cMode = p->mode;
17091 }else
@@ -19081,10 +19197,11 @@
19081 #endif
19082 " -append append the database to the end of the file\n"
19083 " -ascii set output mode to 'ascii'\n"
19084 " -bail stop after hitting an error\n"
19085 " -batch force batch I/O\n"
 
19086 " -column set output mode to 'column'\n"
19087 " -cmd COMMAND run \"COMMAND\" before reading stdin\n"
19088 " -csv set output mode to 'csv'\n"
19089 #if defined(SQLITE_ENABLE_DESERIALIZE)
19090 " -deserialize open the database using sqlite3_deserialize()\n"
@@ -19528,10 +19645,12 @@
19528 data.mode = MODE_Json;
19529 }else if( strcmp(z,"-markdown")==0 ){
19530 data.mode = MODE_Markdown;
19531 }else if( strcmp(z,"-table")==0 ){
19532 data.mode = MODE_Table;
 
 
19533 }else if( strcmp(z,"-csv")==0 ){
19534 data.mode = MODE_Csv;
19535 memcpy(data.colSeparator,",",2);
19536 #ifdef SQLITE_HAVE_ZLIB
19537 }else if( strcmp(z,"-zip")==0 ){
19538
--- src/shell.c
+++ src/shell.c
@@ -9859,10 +9859,11 @@
9859 #define MODE_Pretty 11 /* Pretty-print schemas */
9860 #define MODE_EQP 12 /* Converts EXPLAIN QUERY PLAN output into a graph */
9861 #define MODE_Json 13 /* Output JSON */
9862 #define MODE_Markdown 14 /* Markdown formatting */
9863 #define MODE_Table 15 /* MySQL-style table formatting */
9864 #define MODE_Box 16 /* Unicode box-drawing characters */
9865
9866 static const char *modeDescr[] = {
9867 "line",
9868 "column",
9869 "list",
@@ -9876,11 +9877,12 @@
9877 "ascii",
9878 "prettyprint",
9879 "eqp",
9880 "json",
9881 "markdown",
9882 "table",
9883 "box"
9884 };
9885
9886 /*
9887 ** These are the column/row/line separators used by the various
9888 ** import/export modes.
@@ -10601,23 +10603,27 @@
10603 }
10604 raw_printf(out, "%.*s", N, zDash);
10605 }
10606
10607 /*
10608 ** Print a markdown or table-style row separator using ascii-art
10609 */
10610 static void print_row_separator(
10611 ShellState *p,
10612 int nArg,
10613 const char *zSep
10614 ){
10615 int i;
10616 if( nArg>0 ){
10617 fputs(zSep, p->out);
10618 print_dashes(p->out, p->actualWidth[0]+2);
10619 for(i=1; i<nArg; i++){
10620 fputs(zSep, p->out);
10621 print_dashes(p->out, p->actualWidth[i]+2);
10622 }
10623 fputs(zSep, p->out);
 
10624 }
 
10625 fputs("\n", p->out);
10626 }
10627
10628 /*
10629 ** This is the callback routine that the shell
@@ -11611,14 +11617,81 @@
11617 }
11618 sqlite3_reset(pQ);
11619 }
11620 sqlite3_finalize(pQ);
11621 }
11622
11623 /*
11624 ** UTF8 box-drawing characters. Imagine box lines like this:
11625 **
11626 ** 1
11627 ** |
11628 ** 4 --+-- 2
11629 ** |
11630 ** 3
11631 **
11632 ** Each box characters has between 2 and 4 of the lines leading from
11633 ** the center. The characters are here identified by the numbers of
11634 ** their corresponding lines.
11635 */
11636 #define BOX_24 "\342\224\200" /* U+2500 --- */
11637 #define BOX_13 "\342\224\202" /* U+2502 | */
11638 #define BOX_23 "\342\224\214" /* U+250c ,- */
11639 #define BOX_34 "\342\224\220" /* U+2510 -, */
11640 #define BOX_12 "\342\224\224" /* U+2514 '- */
11641 #define BOX_14 "\342\224\230" /* U+2518 -' */
11642 #define BOX_123 "\342\224\234" /* U+251c |- */
11643 #define BOX_134 "\342\224\244" /* U+2524 -| */
11644 #define BOX_234 "\342\224\254" /* U+252c -,- */
11645 #define BOX_124 "\342\224\264" /* U+2534 -'- */
11646 #define BOX_1234 "\342\224\274" /* U+253c -|- */
11647
11648 /* Draw horizontal line N characters long using unicode box
11649 ** characters
11650 */
11651 static void print_box_line(FILE *out, int N){
11652 const char zDash[] =
11653 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24
11654 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24;
11655 const int nDash = sizeof(zDash) - 1;
11656 N *= 3;
11657 while( N>nDash ){
11658 utf8_printf(out, zDash);
11659 N -= nDash;
11660 }
11661 utf8_printf(out, "%.*s", N, zDash);
11662 }
11663
11664 /*
11665 ** Draw a horizontal separator for a MODE_Box table.
11666 */
11667 static void print_box_row_separator(
11668 ShellState *p,
11669 int nArg,
11670 const char *zSep1,
11671 const char *zSep2,
11672 const char *zSep3
11673 ){
11674 int i;
11675 if( nArg>0 ){
11676 utf8_printf(p->out, "%s", zSep1);
11677 print_box_line(p->out, p->actualWidth[0]+2);
11678 for(i=1; i<nArg; i++){
11679 utf8_printf(p->out, "%s", zSep2);
11680 print_box_line(p->out, p->actualWidth[i]+2);
11681 }
11682 utf8_printf(p->out, "%s", zSep3);
11683 }
11684 fputs("\n", p->out);
11685 }
11686
11687
11688
11689 /*
11690 ** Run a prepared statement and output the result in one of the
11691 ** table-oriented formats: MODE_Column, MODE_Markdown, MODE_Table,
11692 ** or MODE_Box.
11693 **
11694 ** This is different from ordinary exec_prepared_stmt() in that
11695 ** it has to run the entire query and gather the results into memory
11696 ** first, in order to determine column widths, before providing
11697 ** any output.
@@ -11632,20 +11705,24 @@
11705 char **azData = 0;
11706 char *zMsg = 0;
11707 const char *z;
11708 int rc;
11709 int i, j, nTotal, w, n;
11710 const char *colSep = 0;
11711 const char *rowSep = 0;
11712
11713 rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
11714 &azData, &nRow, &nColumn, &zMsg);
11715 if( rc ){
11716 utf8_printf(p->out, "ERROR: %s\n", zMsg);
11717 sqlite3_free(zMsg);
11718 sqlite3_free_table(azData);
11719 return;
11720 }
11721 if( nRow==0 || nColumn==0 ){
11722 sqlite3_free_table(azData);
11723 return;
11724 }
11725 if( nColumn>p->nWidth ){
11726 p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
11727 if( p->colWidth==0 ) shell_out_of_memory();
11728 for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
@@ -11664,54 +11741,91 @@
11741 if( z==0 ) z = p->nullValue;
11742 n = strlenChar(z);
11743 j = i%nColumn;
11744 if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
11745 }
11746 switch( p->cMode ){
11747 case MODE_Column: {
11748 colSep = " ";
11749 rowSep = "\n";
11750 if( p->showHeader ){
11751 for(i=0; i<nColumn; i++){
11752 w = p->actualWidth[i];
11753 if( p->colWidth[i]<0 ) w = -w;
11754 utf8_width_print(p->out, w, azData[i]);
11755 fputs(i==nColumn-1?"\n":" ", p->out);
11756 }
11757 for(i=0; i<nColumn; i++){
11758 print_dashes(p->out, p->actualWidth[i]);
11759 fputs(i==nColumn-1?"\n":" ", p->out);
11760 }
11761 }
11762 break;
11763 }
11764 case MODE_Table: {
11765 colSep = " | ";
11766 rowSep = " |\n";
11767 print_row_separator(p, nColumn, "+");
11768 fputs("| ", p->out);
11769 for(i=0; i<nColumn; i++){
11770 w = p->actualWidth[i];
11771 n = strlenChar(azData[i]);
11772 utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11773 fputs(i==nColumn-1?" |\n":" | ", p->out);
11774 }
11775 print_row_separator(p, nColumn, "+");
11776 break;
11777 }
11778 case MODE_Markdown: {
11779 colSep = " | ";
11780 rowSep = " |\n";
11781 fputs("| ", p->out);
11782 for(i=0; i<nColumn; i++){
11783 w = p->actualWidth[i];
11784 n = strlenChar(azData[i]);
11785 utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11786 fputs(i==nColumn-1?" |\n":" | ", p->out);
11787 }
11788 print_row_separator(p, nColumn, "|");
11789 break;
11790 }
11791 case MODE_Box: {
11792 colSep = " " BOX_13 " ";
11793 rowSep = " " BOX_13 "\n";
11794 print_box_row_separator(p, nColumn, BOX_23, BOX_234, BOX_34);
11795 utf8_printf(p->out, BOX_13 " ");
11796 for(i=0; i<nColumn; i++){
11797 w = p->actualWidth[i];
11798 n = strlenChar(azData[i]);
11799 utf8_printf(p->out, "%*s%s%*s%s",
11800 (w-n)/2, "", azData[i], (w-n+1)/2, "",
11801 i==nColumn-1?" "BOX_13"\n":" "BOX_13" ");
11802 }
11803 print_box_row_separator(p, nColumn, BOX_123, BOX_1234, BOX_134);
11804 break;
11805 }
11806 }
11807 for(i=nColumn, j=0; i<nTotal; i++, j++){
11808 if( j==0 && p->cMode!=MODE_Column ){
11809 utf8_printf(p->out, "%s", p->cMode==MODE_Box?BOX_13" ":"| ");
11810 }
11811 z = azData[i];
11812 if( z==0 ) z = p->nullValue;
11813 w = p->actualWidth[j];
11814 if( p->colWidth[j]<0 ) w = -w;
11815 utf8_width_print(p->out, w, z);
11816 if( j==nColumn-1 ){
11817 utf8_printf(p->out, "%s", rowSep);
11818 j = -1;
11819 }else{
11820 utf8_printf(p->out, "%s", colSep);
11821 }
11822 }
11823 if( p->cMode==MODE_Table ){
11824 print_row_separator(p, nColumn, "+");
11825 }else if( p->cMode==MODE_Box ){
11826 print_box_row_separator(p, nColumn, BOX_12, BOX_124, BOX_14);
11827 }
11828 sqlite3_free_table(azData);
11829 }
11830
11831 /*
@@ -11723,10 +11837,11 @@
11837 ){
11838 int rc;
11839
11840 if( pArg->cMode==MODE_Column
11841 || pArg->cMode==MODE_Table
11842 || pArg->cMode==MODE_Box
11843 || pArg->cMode==MODE_Markdown
11844 ){
11845 exec_prepared_stmt_columnar(pArg, pStmt);
11846 return;
11847 }
@@ -11776,13 +11891,11 @@
11891 rc = sqlite3_step(pStmt);
11892 }
11893 }
11894 } while( SQLITE_ROW == rc );
11895 sqlite3_free(pData);
11896 if( pArg->cMode==MODE_Json ){
 
 
11897 fputs("]\n", pArg->out);
11898 }
11899 }
11900 }
11901 }
@@ -12462,10 +12575,11 @@
12575 #endif
12576 ".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
12577 ".mode MODE ?TABLE? Set output mode",
12578 " MODE is one of:",
12579 " ascii Columns/rows delimited by 0x1F and 0x1E",
12580 " box Tables using unicode box-drawing characters",
12581 " csv Comma-separated values",
12582 " column Output in columns. (See .width)",
12583 " html HTML <table> code",
12584 " insert SQL insert statements for TABLE",
12585 " json Results in a JSON array",
@@ -17075,17 +17189,19 @@
17189 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
17190 }else if( c2=='m' && strncmp(azArg[1],"markdown",n2)==0 ){
17191 p->mode = MODE_Markdown;
17192 }else if( c2=='t' && strncmp(azArg[1],"table",n2)==0 ){
17193 p->mode = MODE_Table;
17194 }else if( c2=='b' && strncmp(azArg[1],"box",n2)==0 ){
17195 p->mode = MODE_Box;
17196 }else if( c2=='j' && strncmp(azArg[1],"json",n2)==0 ){
17197 p->mode = MODE_Json;
17198 }else if( nArg==1 ){
17199 raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
17200 }else{
17201 raw_printf(stderr, "Error: mode should be one of: "
17202 "ascii box column csv html insert json line list markdown "
17203 "quote table tabs tcl\n");
17204 rc = 1;
17205 }
17206 p->cMode = p->mode;
17207 }else
@@ -19081,10 +19197,11 @@
19197 #endif
19198 " -append append the database to the end of the file\n"
19199 " -ascii set output mode to 'ascii'\n"
19200 " -bail stop after hitting an error\n"
19201 " -batch force batch I/O\n"
19202 " -box set output mode to 'box'\n"
19203 " -column set output mode to 'column'\n"
19204 " -cmd COMMAND run \"COMMAND\" before reading stdin\n"
19205 " -csv set output mode to 'csv'\n"
19206 #if defined(SQLITE_ENABLE_DESERIALIZE)
19207 " -deserialize open the database using sqlite3_deserialize()\n"
@@ -19528,10 +19645,12 @@
19645 data.mode = MODE_Json;
19646 }else if( strcmp(z,"-markdown")==0 ){
19647 data.mode = MODE_Markdown;
19648 }else if( strcmp(z,"-table")==0 ){
19649 data.mode = MODE_Table;
19650 }else if( strcmp(z,"-box")==0 ){
19651 data.mode = MODE_Box;
19652 }else if( strcmp(z,"-csv")==0 ){
19653 data.mode = MODE_Csv;
19654 memcpy(data.colSeparator,",",2);
19655 #ifdef SQLITE_HAVE_ZLIB
19656 }else if( strcmp(z,"-zip")==0 ){
19657
+7 -7
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
11651165
#define SQLITE_VERSION "3.33.0"
11661166
#define SQLITE_VERSION_NUMBER 3033000
1167
-#define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
1167
+#define SQLITE_SOURCE_ID "2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -13449,14 +13449,14 @@
1344913449
1345013450
/*
1345113451
** WAL mode depends on atomic aligned 32-bit loads and stores in a few
1345213452
** places. The following macros try to make this explicit.
1345313453
*/
13454
-#ifndef __has_feature
13455
-# define __has_feature(x) 0 /* compatibility with non-clang compilers */
13454
+#ifndef __has_extension
13455
+# define __has_extension(x) 0 /* compatibility with non-clang compilers */
1345613456
#endif
13457
-#if GCC_VERSION>=4007000 || __has_feature(c_atomic)
13457
+#if GCC_VERSION>=4007000 || __has_extension(c_atomic)
1345813458
# define AtomicLoad(PTR) __atomic_load_n((PTR),__ATOMIC_RELAXED)
1345913459
# define AtomicStore(PTR,VAL) __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED)
1346013460
#else
1346113461
# define AtomicLoad(PTR) (*(PTR))
1346213462
# define AtomicStore(PTR,VAL) (*(PTR) = (VAL))
@@ -60404,11 +60404,11 @@
6040460404
nCollide = idx;
6040560405
for(iKey=walHash(iPage); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
6040660406
if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT;
6040760407
}
6040860408
sLoc.aPgno[idx] = iPage;
60409
- sLoc.aHash[iKey] = (ht_slot)idx;
60409
+ AtomicStore(&sLoc.aHash[iKey], (ht_slot)idx);
6041060410
6041160411
#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
6041260412
/* Verify that the number of entries in the hash table exactly equals
6041360413
** the number of entries in the mapping region.
6041460414
*/
@@ -224866,11 +224866,11 @@
224866224866
int nArg, /* Number of args */
224867224867
sqlite3_value **apUnused /* Function arguments */
224868224868
){
224869224869
assert( nArg==0 );
224870224870
UNUSED_PARAM2(nArg, apUnused);
224871
- sqlite3_result_text(pCtx, "fts5: 2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6", -1, SQLITE_TRANSIENT);
224871
+ sqlite3_result_text(pCtx, "fts5: 2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72", -1, SQLITE_TRANSIENT);
224872224872
}
224873224873
224874224874
/*
224875224875
** Return true if zName is the extension on one of the shadow tables used
224876224876
** by this module.
@@ -229651,10 +229651,10 @@
229651229651
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229652229652
229653229653
/************** End of stmt.c ************************************************/
229654229654
#if __LINE__!=229654
229655229655
#undef SQLITE_SOURCE_ID
229656
-#define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80dalt2"
229656
+#define SQLITE_SOURCE_ID "2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680alt2"
229657229657
#endif
229658229658
/* Return the source-id for this library */
229659229659
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229660229660
/************************** End of sqlite3.c ******************************/
229661229661
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -13449,14 +13449,14 @@
13449
13450 /*
13451 ** WAL mode depends on atomic aligned 32-bit loads and stores in a few
13452 ** places. The following macros try to make this explicit.
13453 */
13454 #ifndef __has_feature
13455 # define __has_feature(x) 0 /* compatibility with non-clang compilers */
13456 #endif
13457 #if GCC_VERSION>=4007000 || __has_feature(c_atomic)
13458 # define AtomicLoad(PTR) __atomic_load_n((PTR),__ATOMIC_RELAXED)
13459 # define AtomicStore(PTR,VAL) __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED)
13460 #else
13461 # define AtomicLoad(PTR) (*(PTR))
13462 # define AtomicStore(PTR,VAL) (*(PTR) = (VAL))
@@ -60404,11 +60404,11 @@
60404 nCollide = idx;
60405 for(iKey=walHash(iPage); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
60406 if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT;
60407 }
60408 sLoc.aPgno[idx] = iPage;
60409 sLoc.aHash[iKey] = (ht_slot)idx;
60410
60411 #ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
60412 /* Verify that the number of entries in the hash table exactly equals
60413 ** the number of entries in the mapping region.
60414 */
@@ -224866,11 +224866,11 @@
224866 int nArg, /* Number of args */
224867 sqlite3_value **apUnused /* Function arguments */
224868 ){
224869 assert( nArg==0 );
224870 UNUSED_PARAM2(nArg, apUnused);
224871 sqlite3_result_text(pCtx, "fts5: 2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6", -1, SQLITE_TRANSIENT);
224872 }
224873
224874 /*
224875 ** Return true if zName is the extension on one of the shadow tables used
224876 ** by this module.
@@ -229651,10 +229651,10 @@
229651 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229652
229653 /************** End of stmt.c ************************************************/
229654 #if __LINE__!=229654
229655 #undef SQLITE_SOURCE_ID
229656 #define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80dalt2"
229657 #endif
229658 /* Return the source-id for this library */
229659 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229660 /************************** End of sqlite3.c ******************************/
229661
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -13449,14 +13449,14 @@
13449
13450 /*
13451 ** WAL mode depends on atomic aligned 32-bit loads and stores in a few
13452 ** places. The following macros try to make this explicit.
13453 */
13454 #ifndef __has_extension
13455 # define __has_extension(x) 0 /* compatibility with non-clang compilers */
13456 #endif
13457 #if GCC_VERSION>=4007000 || __has_extension(c_atomic)
13458 # define AtomicLoad(PTR) __atomic_load_n((PTR),__ATOMIC_RELAXED)
13459 # define AtomicStore(PTR,VAL) __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED)
13460 #else
13461 # define AtomicLoad(PTR) (*(PTR))
13462 # define AtomicStore(PTR,VAL) (*(PTR) = (VAL))
@@ -60404,11 +60404,11 @@
60404 nCollide = idx;
60405 for(iKey=walHash(iPage); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
60406 if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT;
60407 }
60408 sLoc.aPgno[idx] = iPage;
60409 AtomicStore(&sLoc.aHash[iKey], (ht_slot)idx);
60410
60411 #ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
60412 /* Verify that the number of entries in the hash table exactly equals
60413 ** the number of entries in the mapping region.
60414 */
@@ -224866,11 +224866,11 @@
224866 int nArg, /* Number of args */
224867 sqlite3_value **apUnused /* Function arguments */
224868 ){
224869 assert( nArg==0 );
224870 UNUSED_PARAM2(nArg, apUnused);
224871 sqlite3_result_text(pCtx, "fts5: 2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72", -1, SQLITE_TRANSIENT);
224872 }
224873
224874 /*
224875 ** Return true if zName is the extension on one of the shadow tables used
224876 ** by this module.
@@ -229651,10 +229651,10 @@
229651 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229652
229653 /************** End of stmt.c ************************************************/
229654 #if __LINE__!=229654
229655 #undef SQLITE_SOURCE_ID
229656 #define SQLITE_SOURCE_ID "2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680alt2"
229657 #endif
229658 /* Return the source-id for this library */
229659 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229660 /************************** End of sqlite3.c ******************************/
229661
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.33.0"
127127
#define SQLITE_VERSION_NUMBER 3033000
128
-#define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
128
+#define SQLITE_SOURCE_ID "2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-06-04 18:05:39 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134

Keyboard Shortcuts

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