Fossil SCM

Update the built-in SQLite to the latest trunk code that includes the new ".mode table" command for formatting output from the CLI.

drh 2020-05-29 16:46 trunk
Commit f6a99292c97582459af3a33bba50b954dd1ebde297970361a0b6a99de5b8561a
--- src/main.mk
+++ src/main.mk
@@ -608,11 +608,10 @@
608608
-DSQLITE_DEFAULT_MEMSTATUS=0 \
609609
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
610610
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
611611
-DSQLITE_OMIT_DECLTYPE \
612612
-DSQLITE_OMIT_DEPRECATED \
613
- -DSQLITE_OMIT_GET_TABLE \
614613
-DSQLITE_OMIT_PROGRESS_CALLBACK \
615614
-DSQLITE_OMIT_SHARED_CACHE \
616615
-DSQLITE_OMIT_LOAD_EXTENSION \
617616
-DSQLITE_MAX_EXPR_DEPTH=0 \
618617
-DSQLITE_USE_ALLOCA \
@@ -636,11 +635,10 @@
636635
-DSQLITE_DEFAULT_MEMSTATUS=0 \
637636
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
638637
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
639638
-DSQLITE_OMIT_DECLTYPE \
640639
-DSQLITE_OMIT_DEPRECATED \
641
- -DSQLITE_OMIT_GET_TABLE \
642640
-DSQLITE_OMIT_PROGRESS_CALLBACK \
643641
-DSQLITE_OMIT_SHARED_CACHE \
644642
-DSQLITE_OMIT_LOAD_EXTENSION \
645643
-DSQLITE_MAX_EXPR_DEPTH=0 \
646644
-DSQLITE_USE_ALLOCA \
647645
--- src/main.mk
+++ src/main.mk
@@ -608,11 +608,10 @@
608 -DSQLITE_DEFAULT_MEMSTATUS=0 \
609 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
610 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
611 -DSQLITE_OMIT_DECLTYPE \
612 -DSQLITE_OMIT_DEPRECATED \
613 -DSQLITE_OMIT_GET_TABLE \
614 -DSQLITE_OMIT_PROGRESS_CALLBACK \
615 -DSQLITE_OMIT_SHARED_CACHE \
616 -DSQLITE_OMIT_LOAD_EXTENSION \
617 -DSQLITE_MAX_EXPR_DEPTH=0 \
618 -DSQLITE_USE_ALLOCA \
@@ -636,11 +635,10 @@
636 -DSQLITE_DEFAULT_MEMSTATUS=0 \
637 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
638 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
639 -DSQLITE_OMIT_DECLTYPE \
640 -DSQLITE_OMIT_DEPRECATED \
641 -DSQLITE_OMIT_GET_TABLE \
642 -DSQLITE_OMIT_PROGRESS_CALLBACK \
643 -DSQLITE_OMIT_SHARED_CACHE \
644 -DSQLITE_OMIT_LOAD_EXTENSION \
645 -DSQLITE_MAX_EXPR_DEPTH=0 \
646 -DSQLITE_USE_ALLOCA \
647
--- src/main.mk
+++ src/main.mk
@@ -608,11 +608,10 @@
608 -DSQLITE_DEFAULT_MEMSTATUS=0 \
609 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
610 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
611 -DSQLITE_OMIT_DECLTYPE \
612 -DSQLITE_OMIT_DEPRECATED \
 
613 -DSQLITE_OMIT_PROGRESS_CALLBACK \
614 -DSQLITE_OMIT_SHARED_CACHE \
615 -DSQLITE_OMIT_LOAD_EXTENSION \
616 -DSQLITE_MAX_EXPR_DEPTH=0 \
617 -DSQLITE_USE_ALLOCA \
@@ -636,11 +635,10 @@
635 -DSQLITE_DEFAULT_MEMSTATUS=0 \
636 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
637 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
638 -DSQLITE_OMIT_DECLTYPE \
639 -DSQLITE_OMIT_DEPRECATED \
 
640 -DSQLITE_OMIT_PROGRESS_CALLBACK \
641 -DSQLITE_OMIT_SHARED_CACHE \
642 -DSQLITE_OMIT_LOAD_EXTENSION \
643 -DSQLITE_MAX_EXPR_DEPTH=0 \
644 -DSQLITE_USE_ALLOCA \
645
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -192,11 +192,10 @@
192192
-DSQLITE_DEFAULT_MEMSTATUS=0
193193
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
194194
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS
195195
-DSQLITE_OMIT_DECLTYPE
196196
-DSQLITE_OMIT_DEPRECATED
197
- -DSQLITE_OMIT_GET_TABLE
198197
-DSQLITE_OMIT_PROGRESS_CALLBACK
199198
-DSQLITE_OMIT_SHARED_CACHE
200199
-DSQLITE_OMIT_LOAD_EXTENSION
201200
-DSQLITE_MAX_EXPR_DEPTH=0
202201
-DSQLITE_USE_ALLOCA
203202
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -192,11 +192,10 @@
192 -DSQLITE_DEFAULT_MEMSTATUS=0
193 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
194 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
195 -DSQLITE_OMIT_DECLTYPE
196 -DSQLITE_OMIT_DEPRECATED
197 -DSQLITE_OMIT_GET_TABLE
198 -DSQLITE_OMIT_PROGRESS_CALLBACK
199 -DSQLITE_OMIT_SHARED_CACHE
200 -DSQLITE_OMIT_LOAD_EXTENSION
201 -DSQLITE_MAX_EXPR_DEPTH=0
202 -DSQLITE_USE_ALLOCA
203
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -192,11 +192,10 @@
192 -DSQLITE_DEFAULT_MEMSTATUS=0
193 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
194 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
195 -DSQLITE_OMIT_DECLTYPE
196 -DSQLITE_OMIT_DEPRECATED
 
197 -DSQLITE_OMIT_PROGRESS_CALLBACK
198 -DSQLITE_OMIT_SHARED_CACHE
199 -DSQLITE_OMIT_LOAD_EXTENSION
200 -DSQLITE_MAX_EXPR_DEPTH=0
201 -DSQLITE_USE_ALLOCA
202
+270 -82
--- src/shell.c
+++ src/shell.c
@@ -9700,22 +9700,10 @@
97009700
char **azFilter; /* Array of xFilter rejection GLOB patterns */
97019701
sqlite3_session *p; /* The open session */
97029702
};
97039703
#endif
97049704
9705
-/*
9706
-** Shell output mode information from before ".explain on",
9707
-** saved so that it can be restored by ".explain off"
9708
-*/
9709
-typedef struct SavedModeInfo SavedModeInfo;
9710
-struct SavedModeInfo {
9711
- int valid; /* Is there legit data in here? */
9712
- int mode; /* Mode prior to ".explain on" */
9713
- int showHeader; /* The ".header" setting prior to ".explain on" */
9714
- int colWidth[100]; /* Column widths prior to ".explain on" */
9715
-};
9716
-
97179705
typedef struct ExpertInfo ExpertInfo;
97189706
struct ExpertInfo {
97199707
sqlite3expert *pExpert;
97209708
int bVerbose;
97219709
};
@@ -9781,12 +9769,13 @@
97819769
char zTestcase[30]; /* Name of current test case */
97829770
char colSeparator[20]; /* Column separator character for several modes */
97839771
char rowSeparator[20]; /* Row separator character for MODE_Ascii */
97849772
char colSepPrior[20]; /* Saved column separator */
97859773
char rowSepPrior[20]; /* Saved row separator */
9786
- int colWidth[100]; /* Requested width of each column when in column mode*/
9787
- int actualWidth[100]; /* Actual width of each column */
9774
+ int *colWidth; /* Requested width of each column in columnar modes */
9775
+ int *actualWidth; /* Actual width of each column */
9776
+ int nWidth; /* Number of slots in colWidth[] and actualWidth[] */
97889777
char nullValue[20]; /* The text to print when a NULL comes back from
97899778
** the database */
97909779
char outfile[FILENAME_MAX]; /* Filename for *out */
97919780
const char *zDbFilename; /* name of the database file */
97929781
char *zFreeOnClose; /* Filename to free when closing */
@@ -9867,10 +9856,13 @@
98679856
#define MODE_Csv 8 /* Quote strings, numbers are plain */
98689857
#define MODE_Explain 9 /* Like MODE_Column, but do not truncate data */
98699858
#define MODE_Ascii 10 /* Use ASCII unit and record separators (0x1F/0x1E) */
98709859
#define MODE_Pretty 11 /* Pretty-print schemas */
98719860
#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 */
98729864
98739865
static const char *modeDescr[] = {
98749866
"line",
98759867
"column",
98769868
"list",
@@ -9881,11 +9873,14 @@
98819873
"tcl",
98829874
"csv",
98839875
"explain",
98849876
"ascii",
98859877
"prettyprint",
9886
- "eqp"
9878
+ "eqp",
9879
+ "json",
9880
+ "markdown",
9881
+ "table"
98879882
};
98889883
98899884
/*
98909885
** These are the column/row/line separators used by the various
98919886
** import/export modes.
@@ -10248,10 +10243,44 @@
1024810243
fputc(c, out);
1024910244
}
1025010245
}
1025110246
fputc('"', out);
1025210247
}
10248
+
10249
+/*
10250
+** Output the given string as a quoted according to JSON quoting rules.
10251
+*/
10252
+static void output_json_string(FILE *out, const char *z, int n){
10253
+ unsigned int c;
10254
+ if( n<0 ) n = (int)strlen(z);
10255
+ fputc('"', out);
10256
+ while( n-- ){
10257
+ c = *(z++);
10258
+ if( c=='\\' || c=='"' ){
10259
+ fputc('\\', out);
10260
+ fputc(c, out);
10261
+ }else if( c<=0x1f ){
10262
+ fputc('\\', out);
10263
+ if( c=='\b' ){
10264
+ fputc('b', out);
10265
+ }else if( c=='\f' ){
10266
+ fputc('f', out);
10267
+ }else if( c=='\n' ){
10268
+ fputc('n', out);
10269
+ }else if( c=='\r' ){
10270
+ fputc('r', out);
10271
+ }else if( c=='\t' ){
10272
+ fputc('t', out);
10273
+ }else{
10274
+ raw_printf(out, "u%04x",c);
10275
+ }
10276
+ }else{
10277
+ fputc(c, out);
10278
+ }
10279
+ }
10280
+ fputc('"', out);
10281
+}
1025310282
1025410283
/*
1025510284
** Output the given string with characters that are special to
1025610285
** HTML escaped.
1025710286
*/
@@ -10557,10 +10586,40 @@
1055710586
raw_printf(p->out, "Progress %u\n", p->nProgress);
1055810587
}
1055910588
return 0;
1056010589
}
1056110590
#endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
10591
+
10592
+/*
10593
+** Print N dashes
10594
+*/
10595
+static void print_dashes(FILE *out, int N){
10596
+ const char zDash[] = "--------------------------------------------------";
10597
+ const int nDash = sizeof(zDash) - 1;
10598
+ while( N>nDash ){
10599
+ fputs(zDash, out);
10600
+ N -= nDash;
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
+}
1056210621
1056310622
/*
1056410623
** This is the callback routine that the shell
1056510624
** invokes for each row of a query result.
1056610625
*/
@@ -10567,11 +10626,11 @@
1056710626
static int shell_callback(
1056810627
void *pArg,
1056910628
int nArg, /* Number of result columns */
1057010629
char **azArg, /* Text of each result column */
1057110630
char **azCol, /* Column names */
10572
- int *aiType /* Column types */
10631
+ int *aiType /* Column types. Might be NULL */
1057310632
){
1057410633
int i;
1057510634
ShellState *p = (ShellState*)pArg;
1057610635
1057710636
if( azArg==0 ) return 0;
@@ -10588,85 +10647,36 @@
1058810647
utf8_printf(p->out,"%*s = %s%s", w, azCol[i],
1058910648
azArg[i] ? azArg[i] : p->nullValue, p->rowSeparator);
1059010649
}
1059110650
break;
1059210651
}
10593
- case MODE_Explain:
10594
- case MODE_Column: {
10595
- static const int aExplainWidths[] = {4, 13, 4, 4, 4, 13, 2, 13};
10596
- const int *colWidth;
10597
- int showHdr;
10598
- char *rowSep;
10599
- int nWidth;
10600
- if( p->cMode==MODE_Column ){
10601
- colWidth = p->colWidth;
10602
- nWidth = ArraySize(p->colWidth);
10603
- showHdr = p->showHeader;
10604
- rowSep = p->rowSeparator;
10605
- }else{
10606
- colWidth = aExplainWidths;
10607
- nWidth = ArraySize(aExplainWidths);
10608
- showHdr = 1;
10609
- rowSep = SEP_Row;
10652
+ case MODE_Explain: {
10653
+ static const int aExplainWidth[] = {4, 13, 4, 4, 4, 13, 2, 13};
10654
+ if( nArg>ArraySize(aExplainWidth) ){
10655
+ nArg = ArraySize(aExplainWidth);
1061010656
}
1061110657
if( p->cnt++==0 ){
1061210658
for(i=0; i<nArg; i++){
10613
- int w, n;
10614
- if( i<nWidth ){
10615
- w = colWidth[i];
10616
- }else{
10617
- w = 0;
10618
- }
10619
- if( w==0 ){
10620
- w = strlenChar(azCol[i] ? azCol[i] : "");
10621
- if( w<10 ) w = 10;
10622
- n = strlenChar(azArg && azArg[i] ? azArg[i] : p->nullValue);
10623
- if( w<n ) w = n;
10624
- }
10625
- if( i<ArraySize(p->actualWidth) ){
10626
- p->actualWidth[i] = w;
10627
- }
10628
- if( showHdr ){
10629
- utf8_width_print(p->out, w, azCol[i]);
10630
- utf8_printf(p->out, "%s", i==nArg-1 ? rowSep : " ");
10631
- }
10632
- }
10633
- if( showHdr ){
10634
- for(i=0; i<nArg; i++){
10635
- int w;
10636
- if( i<ArraySize(p->actualWidth) ){
10637
- w = p->actualWidth[i];
10638
- if( w<0 ) w = -w;
10639
- }else{
10640
- w = 10;
10641
- }
10642
- utf8_printf(p->out,"%-*.*s%s",w,w,
10643
- "----------------------------------------------------------"
10644
- "----------------------------------------------------------",
10645
- i==nArg-1 ? rowSep : " ");
10646
- }
10659
+ int w = aExplainWidth[i];
10660
+ utf8_width_print(p->out, w, azCol[i]);
10661
+ fputs(i==nArg-1 ? "\n" : " ", p->out);
1064710662
}
1064810663
}
1064910664
if( azArg==0 ) break;
1065010665
for(i=0; i<nArg; i++){
10651
- int w;
10652
- if( i<ArraySize(p->actualWidth) ){
10653
- w = p->actualWidth[i];
10654
- }else{
10655
- w = 10;
10656
- }
10657
- if( p->cMode==MODE_Explain && azArg[i] && strlenChar(azArg[i])>w ){
10666
+ int w = aExplainWidth[i];
10667
+ if( azArg[i] && strlenChar(azArg[i])>w ){
1065810668
w = strlenChar(azArg[i]);
1065910669
}
1066010670
if( i==1 && p->aiIndent && p->pStmt ){
1066110671
if( p->iIndent<p->nIndent ){
1066210672
utf8_printf(p->out, "%*.s", p->aiIndent[p->iIndent], "");
1066310673
}
1066410674
p->iIndent++;
1066510675
}
1066610676
utf8_width_print(p->out, w, azArg[i] ? azArg[i] : p->nullValue);
10667
- utf8_printf(p->out, "%s", i==nArg-1 ? rowSep : " ");
10677
+ fputs(i==nArg-1 ? "\n" : " ", p->out);
1066810678
}
1066910679
break;
1067010680
}
1067110681
case MODE_Semi: { /* .schema and .fullschema output */
1067210682
printSchemaLine(p->out, azArg[0], ";\n");
@@ -10865,23 +10875,65 @@
1086510875
output_quoted_escaped_string(p->out, azArg[i]);
1086610876
}
1086710877
}
1086810878
raw_printf(p->out,");\n");
1086910879
break;
10880
+ }
10881
+ case MODE_Json: {
10882
+ if( azArg==0 ) break;
10883
+ if( p->cnt==0 ){
10884
+ fputs("[{", p->out);
10885
+ }else{
10886
+ fputs(",\n{", p->out);
10887
+ }
10888
+ p->cnt++;
10889
+ for(i=0; i<nArg; i++){
10890
+ output_json_string(p->out, azCol[i], -1);
10891
+ putc(':', p->out);
10892
+ if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
10893
+ fputs("null",p->out);
10894
+ }else if( aiType && aiType[i]==SQLITE_FLOAT ){
10895
+ char z[50];
10896
+ double r = sqlite3_column_double(p->pStmt, i);
10897
+ sqlite3_uint64 ur;
10898
+ memcpy(&ur,&r,sizeof(r));
10899
+ if( ur==0x7ff0000000000000LL ){
10900
+ raw_printf(p->out, "1e999");
10901
+ }else if( ur==0xfff0000000000000LL ){
10902
+ raw_printf(p->out, "-1e999");
10903
+ }else{
10904
+ sqlite3_snprintf(50,z,"%!.20g", r);
10905
+ raw_printf(p->out, "%s", z);
10906
+ }
10907
+ }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
10908
+ const void *pBlob = sqlite3_column_blob(p->pStmt, i);
10909
+ int nBlob = sqlite3_column_bytes(p->pStmt, i);
10910
+ output_json_string(p->out, pBlob, nBlob);
10911
+ }else if( aiType && aiType[i]==SQLITE_TEXT ){
10912
+ output_json_string(p->out, azArg[i], -1);
10913
+ }else{
10914
+ utf8_printf(p->out,"%s", azArg[i]);
10915
+ }
10916
+ if( i<nArg-1 ){
10917
+ putc(',', p->out);
10918
+ }
10919
+ }
10920
+ putc('}', p->out);
10921
+ break;
1087010922
}
1087110923
case MODE_Quote: {
1087210924
if( azArg==0 ) break;
1087310925
if( p->cnt==0 && p->showHeader ){
1087410926
for(i=0; i<nArg; i++){
10875
- if( i>0 ) raw_printf(p->out, ",");
10927
+ if( i>0 ) fputs(p->colSeparator, p->out);
1087610928
output_quoted_string(p->out, azCol[i]);
1087710929
}
10878
- raw_printf(p->out,"\n");
10930
+ fputs(p->rowSeparator, p->out);
1087910931
}
1088010932
p->cnt++;
1088110933
for(i=0; i<nArg; i++){
10882
- if( i>0 ) raw_printf(p->out, ",");
10934
+ if( i>0 ) fputs(p->colSeparator, p->out);
1088310935
if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
1088410936
utf8_printf(p->out,"NULL");
1088510937
}else if( aiType && aiType[i]==SQLITE_TEXT ){
1088610938
output_quoted_string(p->out, azArg[i]);
1088710939
}else if( aiType && aiType[i]==SQLITE_INTEGER ){
@@ -10899,11 +10951,11 @@
1089910951
utf8_printf(p->out,"%s", azArg[i]);
1090010952
}else{
1090110953
output_quoted_string(p->out, azArg[i]);
1090210954
}
1090310955
}
10904
- raw_printf(p->out,"\n");
10956
+ fputs(p->rowSeparator, p->out);
1090510957
break;
1090610958
}
1090710959
case MODE_Ascii: {
1090810960
if( p->cnt++==0 && p->showHeader ){
1090910961
for(i=0; i<nArg; i++){
@@ -11554,19 +11606,127 @@
1155411606
}
1155511607
sqlite3_reset(pQ);
1155611608
}
1155711609
sqlite3_finalize(pQ);
1155811610
}
11611
+
11612
+/*
11613
+** Run a prepared statement and output the result in one of the
11614
+** table-oriented formats: MODE_Column, MODE_Markdown, or MODE_Table.
11615
+**
11616
+** This is different from ordinary exec_prepared_stmt() in that
11617
+** it has to run the entire query and gather the results into memory
11618
+** first, in order to determine column widths, before providing
11619
+** any output.
11620
+*/
11621
+static void exec_prepared_stmt_columnar(
11622
+ ShellState *p, /* Pointer to ShellState */
11623
+ sqlite3_stmt *pStmt /* Statment to run */
11624
+){
11625
+ int nRow = 0;
11626
+ int nColumn = 0;
11627
+ char **azData = 0;
11628
+ char *zMsg = 0;
11629
+ const char *z;
11630
+ int rc;
11631
+ int i, j, nTotal, w, n;
11632
+ const char *colSep;
11633
+ const char *rowSep;
11634
+
11635
+ rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
11636
+ &azData, &nRow, &nColumn, &zMsg);
11637
+ if( rc ){
11638
+ utf8_printf(p->out, "ERROR: %s\n", zMsg);
11639
+ sqlite3_free(zMsg);
11640
+ sqlite3_free_table(azData);
11641
+ return;
11642
+ }
11643
+ if( nColumn>p->nWidth ){
11644
+ p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
11645
+ if( p->colWidth==0 ) shell_out_of_memory();
11646
+ for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
11647
+ p->nWidth = nColumn;
11648
+ p->actualWidth = &p->colWidth[nColumn];
11649
+ }
11650
+ memset(p->actualWidth, 0, nColumn*sizeof(int));
11651
+ for(i=0; i<nColumn; i++){
11652
+ w = p->colWidth[i];
11653
+ if( w<0 ) w = -w;
11654
+ p->actualWidth[i] = w;
11655
+ }
11656
+ nTotal = nColumn*(nRow+1);
11657
+ for(i=0; i<nTotal; i++){
11658
+ z = azData[i];
11659
+ if( z==0 ) z = p->nullValue;
11660
+ n = strlenChar(z);
11661
+ j = i%nColumn;
11662
+ if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
11663
+ }
11664
+ if( p->cMode==MODE_Column ){
11665
+ colSep = " ";
11666
+ rowSep = "\n";
11667
+ if( p->showHeader ){
11668
+ for(i=0; i<nColumn; i++){
11669
+ w = p->actualWidth[i];
11670
+ if( p->colWidth[i]<0 ) w = -w;
11671
+ utf8_width_print(p->out, w, azData[i]);
11672
+ fputs(i==nColumn-1?"\n":" ", p->out);
11673
+ }
11674
+ for(i=0; i<nColumn; i++){
11675
+ print_dashes(p->out, p->actualWidth[i]);
11676
+ fputs(i==nColumn-1?"\n":" ", p->out);
11677
+ }
11678
+ }
11679
+ }else{
11680
+ colSep = " | ";
11681
+ rowSep = " |\n";
11682
+ if( p->cMode==MODE_Table ) print_row_separator(p, nColumn, "+");
11683
+ fputs("| ", p->out);
11684
+ for(i=0; i<nColumn; i++){
11685
+ w = p->actualWidth[i];
11686
+ n = strlenChar(azData[i]);
11687
+ utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11688
+ fputs(i==nColumn-1?" |\n":" | ", p->out);
11689
+ }
11690
+ print_row_separator(p, nColumn, p->cMode==MODE_Table ? "+" : "|");
11691
+ }
11692
+ for(i=nColumn, j=0; i<nTotal; i++, j++){
11693
+ if( j==0 && p->cMode!=MODE_Column ) fputs("| ", p->out);
11694
+ z = azData[i];
11695
+ if( z==0 ) z = p->nullValue;
11696
+ w = p->actualWidth[j];
11697
+ if( p->colWidth[j]<0 ) w = -w;
11698
+ utf8_width_print(p->out, w, z);
11699
+ if( j==nColumn-1 ){
11700
+ fputs(rowSep, p->out);
11701
+ j = -1;
11702
+ }else{
11703
+ fputs(colSep, p->out);
11704
+ }
11705
+ }
11706
+ if( p->cMode==MODE_Table ){
11707
+ print_row_separator(p, nColumn, "+");
11708
+ }
11709
+ sqlite3_free_table(azData);
11710
+}
1155911711
1156011712
/*
1156111713
** Run a prepared statement
1156211714
*/
1156311715
static void exec_prepared_stmt(
1156411716
ShellState *pArg, /* Pointer to ShellState */
1156511717
sqlite3_stmt *pStmt /* Statment to run */
1156611718
){
1156711719
int rc;
11720
+
11721
+ if( pArg->cMode==MODE_Column
11722
+ || pArg->cMode==MODE_Table
11723
+ || pArg->cMode==MODE_Markdown
11724
+ ){
11725
+ exec_prepared_stmt_columnar(pArg, pStmt);
11726
+ return;
11727
+ }
1156811728
1156911729
/* perform the first step. this will tell us if we
1157011730
** have a result set or not and how wide it is.
1157111731
*/
1157211732
rc = sqlite3_step(pStmt);
@@ -11611,10 +11771,15 @@
1161111771
rc = sqlite3_step(pStmt);
1161211772
}
1161311773
}
1161411774
} while( SQLITE_ROW == rc );
1161511775
sqlite3_free(pData);
11776
+ if( pArg->cMode==MODE_Table ){
11777
+ print_row_separator(pArg, nCol, "+");
11778
+ }else if( pArg->cMode==MODE_Json ){
11779
+ fputs("]\n", pArg->out);
11780
+ }
1161611781
}
1161711782
}
1161811783
}
1161911784
1162011785
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -16883,19 +17048,28 @@
1688317048
}else if( c2=='i' && strncmp(azArg[1],"insert",n2)==0 ){
1688417049
p->mode = MODE_Insert;
1688517050
set_table_name(p, nArg>=3 ? azArg[2] : "table");
1688617051
}else if( c2=='q' && strncmp(azArg[1],"quote",n2)==0 ){
1688717052
p->mode = MODE_Quote;
17053
+ sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma);
17054
+ sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
1688817055
}else if( c2=='a' && strncmp(azArg[1],"ascii",n2)==0 ){
1688917056
p->mode = MODE_Ascii;
1689017057
sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
1689117058
sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
17059
+ }else if( c2=='m' && strncmp(azArg[1],"markdown",n2)==0 ){
17060
+ p->mode = MODE_Markdown;
17061
+ }else if( c2=='t' && strncmp(azArg[1],"table",n2)==0 ){
17062
+ p->mode = MODE_Table;
17063
+ }else if( c2=='j' && strncmp(azArg[1],"json",n2)==0 ){
17064
+ p->mode = MODE_Json;
1689217065
}else if( nArg==1 ){
1689317066
raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
1689417067
}else{
1689517068
raw_printf(stderr, "Error: mode should be one of: "
16896
- "ascii column csv html insert line list quote tabs tcl\n");
17069
+ "ascii column csv html insert json line list markdown "
17070
+ "quote table tabs tcl\n");
1689717071
rc = 1;
1689817072
}
1689917073
p->cMode = p->mode;
1690017074
}else
1690117075
@@ -17992,11 +18166,11 @@
1799218166
utf8_printf(p->out,"%12.12s: ", "rowseparator");
1799318167
output_c_string(p->out, p->rowSeparator);
1799418168
raw_printf(p->out, "\n");
1799518169
utf8_printf(p->out, "%12.12s: %s\n","stats", azBool[p->statsOn!=0]);
1799618170
utf8_printf(p->out, "%12.12s: ", "width");
17997
- for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) {
18171
+ for (i=0;i<p->nWidth;i++) {
1799818172
raw_printf(p->out, "%d ", p->colWidth[i]);
1799918173
}
1800018174
raw_printf(p->out, "\n");
1800118175
utf8_printf(p->out, "%12.12s: %s\n", "filename",
1800218176
p->zDbFilename ? p->zDbFilename : "");
@@ -18541,11 +18715,15 @@
1854118715
#endif
1854218716
1854318717
if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
1854418718
int j;
1854518719
assert( nArg<=ArraySize(azArg) );
18546
- for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){
18720
+ p->nWidth = nArg-1;
18721
+ p->colWidth = realloc(p->colWidth, p->nWidth*sizeof(int)*2);
18722
+ if( p->colWidth==0 && p->nWidth>0 ) shell_out_of_memory();
18723
+ if( p->nWidth ) p->actualWidth = &p->colWidth[p->nWidth];
18724
+ for(j=1; j<nArg; j++){
1854718725
p->colWidth[j-1] = (int)integerValue(azArg[j]);
1854818726
}
1854918727
}else
1855018728
1855118729
{
@@ -18901,13 +19079,15 @@
1890119079
" -heap SIZE Size of heap for memsys3 or memsys5\n"
1890219080
#endif
1890319081
" -help show this message\n"
1890419082
" -html set output mode to HTML\n"
1890519083
" -interactive force interactive I/O\n"
19084
+ " -json set output mode to 'json'\n"
1890619085
" -line set output mode to 'line'\n"
1890719086
" -list set output mode to 'list'\n"
1890819087
" -lookaside SIZE N use N entries of SZ bytes for lookaside memory\n"
19088
+ " -markdown set output mode to 'markdown'\n"
1890919089
#if defined(SQLITE_ENABLE_DESERIALIZE)
1891019090
" -maxsize N maximum size for a --deserialize database\n"
1891119091
#endif
1891219092
" -memtrace trace all memory allocations and deallocations\n"
1891319093
" -mmap N default mmap size set to N\n"
@@ -18923,10 +19103,11 @@
1892319103
" -separator SEP set output column separator. Default: '|'\n"
1892419104
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
1892519105
" -sorterref SIZE sorter references threshold size\n"
1892619106
#endif
1892719107
" -stats print memory stats before each finalize\n"
19108
+ " -table set output mode to 'table'\n"
1892819109
" -version show SQLite version\n"
1892919110
" -vfs NAME use NAME as the default VFS\n"
1893019111
#ifdef SQLITE_ENABLE_VFSTRACE
1893119112
" -vfstrace enable tracing of all VFS calls\n"
1893219113
#endif
@@ -19324,10 +19505,16 @@
1932419505
data.mode = MODE_Quote;
1932519506
}else if( strcmp(z,"-line")==0 ){
1932619507
data.mode = MODE_Line;
1932719508
}else if( strcmp(z,"-column")==0 ){
1932819509
data.mode = MODE_Column;
19510
+ }else if( strcmp(z,"-json")==0 ){
19511
+ data.mode = MODE_Json;
19512
+ }else if( strcmp(z,"-markdown")==0 ){
19513
+ data.mode = MODE_Markdown;
19514
+ }else if( strcmp(z,"-table")==0 ){
19515
+ data.mode = MODE_Table;
1932919516
}else if( strcmp(z,"-csv")==0 ){
1933019517
data.mode = MODE_Csv;
1933119518
memcpy(data.colSeparator,",",2);
1933219519
#ifdef SQLITE_HAVE_ZLIB
1933319520
}else if( strcmp(z,"-zip")==0 ){
@@ -19541,10 +19728,11 @@
1954119728
clearTempFile(&data);
1954219729
#if !SQLITE_SHELL_IS_UTF8
1954319730
for(i=0; i<argcToFree; i++) free(argvToFree[i]);
1954419731
free(argvToFree);
1954519732
#endif
19733
+ free(data.colWidth);
1954619734
/* Clear the global data structure so that valgrind will detect memory
1954719735
** leaks */
1954819736
memset(&data, 0, sizeof(data));
1954919737
return rc;
1955019738
}
1955119739
--- src/shell.c
+++ src/shell.c
@@ -9700,22 +9700,10 @@
9700 char **azFilter; /* Array of xFilter rejection GLOB patterns */
9701 sqlite3_session *p; /* The open session */
9702 };
9703 #endif
9704
9705 /*
9706 ** Shell output mode information from before ".explain on",
9707 ** saved so that it can be restored by ".explain off"
9708 */
9709 typedef struct SavedModeInfo SavedModeInfo;
9710 struct SavedModeInfo {
9711 int valid; /* Is there legit data in here? */
9712 int mode; /* Mode prior to ".explain on" */
9713 int showHeader; /* The ".header" setting prior to ".explain on" */
9714 int colWidth[100]; /* Column widths prior to ".explain on" */
9715 };
9716
9717 typedef struct ExpertInfo ExpertInfo;
9718 struct ExpertInfo {
9719 sqlite3expert *pExpert;
9720 int bVerbose;
9721 };
@@ -9781,12 +9769,13 @@
9781 char zTestcase[30]; /* Name of current test case */
9782 char colSeparator[20]; /* Column separator character for several modes */
9783 char rowSeparator[20]; /* Row separator character for MODE_Ascii */
9784 char colSepPrior[20]; /* Saved column separator */
9785 char rowSepPrior[20]; /* Saved row separator */
9786 int colWidth[100]; /* Requested width of each column when in column mode*/
9787 int actualWidth[100]; /* Actual width of each column */
 
9788 char nullValue[20]; /* The text to print when a NULL comes back from
9789 ** the database */
9790 char outfile[FILENAME_MAX]; /* Filename for *out */
9791 const char *zDbFilename; /* name of the database file */
9792 char *zFreeOnClose; /* Filename to free when closing */
@@ -9867,10 +9856,13 @@
9867 #define MODE_Csv 8 /* Quote strings, numbers are plain */
9868 #define MODE_Explain 9 /* Like MODE_Column, but do not truncate data */
9869 #define MODE_Ascii 10 /* Use ASCII unit and record separators (0x1F/0x1E) */
9870 #define MODE_Pretty 11 /* Pretty-print schemas */
9871 #define MODE_EQP 12 /* Converts EXPLAIN QUERY PLAN output into a graph */
 
 
 
9872
9873 static const char *modeDescr[] = {
9874 "line",
9875 "column",
9876 "list",
@@ -9881,11 +9873,14 @@
9881 "tcl",
9882 "csv",
9883 "explain",
9884 "ascii",
9885 "prettyprint",
9886 "eqp"
 
 
 
9887 };
9888
9889 /*
9890 ** These are the column/row/line separators used by the various
9891 ** import/export modes.
@@ -10248,10 +10243,44 @@
10248 fputc(c, out);
10249 }
10250 }
10251 fputc('"', out);
10252 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10253
10254 /*
10255 ** Output the given string with characters that are special to
10256 ** HTML escaped.
10257 */
@@ -10557,10 +10586,40 @@
10557 raw_printf(p->out, "Progress %u\n", p->nProgress);
10558 }
10559 return 0;
10560 }
10561 #endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10562
10563 /*
10564 ** This is the callback routine that the shell
10565 ** invokes for each row of a query result.
10566 */
@@ -10567,11 +10626,11 @@
10567 static int shell_callback(
10568 void *pArg,
10569 int nArg, /* Number of result columns */
10570 char **azArg, /* Text of each result column */
10571 char **azCol, /* Column names */
10572 int *aiType /* Column types */
10573 ){
10574 int i;
10575 ShellState *p = (ShellState*)pArg;
10576
10577 if( azArg==0 ) return 0;
@@ -10588,85 +10647,36 @@
10588 utf8_printf(p->out,"%*s = %s%s", w, azCol[i],
10589 azArg[i] ? azArg[i] : p->nullValue, p->rowSeparator);
10590 }
10591 break;
10592 }
10593 case MODE_Explain:
10594 case MODE_Column: {
10595 static const int aExplainWidths[] = {4, 13, 4, 4, 4, 13, 2, 13};
10596 const int *colWidth;
10597 int showHdr;
10598 char *rowSep;
10599 int nWidth;
10600 if( p->cMode==MODE_Column ){
10601 colWidth = p->colWidth;
10602 nWidth = ArraySize(p->colWidth);
10603 showHdr = p->showHeader;
10604 rowSep = p->rowSeparator;
10605 }else{
10606 colWidth = aExplainWidths;
10607 nWidth = ArraySize(aExplainWidths);
10608 showHdr = 1;
10609 rowSep = SEP_Row;
10610 }
10611 if( p->cnt++==0 ){
10612 for(i=0; i<nArg; i++){
10613 int w, n;
10614 if( i<nWidth ){
10615 w = colWidth[i];
10616 }else{
10617 w = 0;
10618 }
10619 if( w==0 ){
10620 w = strlenChar(azCol[i] ? azCol[i] : "");
10621 if( w<10 ) w = 10;
10622 n = strlenChar(azArg && azArg[i] ? azArg[i] : p->nullValue);
10623 if( w<n ) w = n;
10624 }
10625 if( i<ArraySize(p->actualWidth) ){
10626 p->actualWidth[i] = w;
10627 }
10628 if( showHdr ){
10629 utf8_width_print(p->out, w, azCol[i]);
10630 utf8_printf(p->out, "%s", i==nArg-1 ? rowSep : " ");
10631 }
10632 }
10633 if( showHdr ){
10634 for(i=0; i<nArg; i++){
10635 int w;
10636 if( i<ArraySize(p->actualWidth) ){
10637 w = p->actualWidth[i];
10638 if( w<0 ) w = -w;
10639 }else{
10640 w = 10;
10641 }
10642 utf8_printf(p->out,"%-*.*s%s",w,w,
10643 "----------------------------------------------------------"
10644 "----------------------------------------------------------",
10645 i==nArg-1 ? rowSep : " ");
10646 }
10647 }
10648 }
10649 if( azArg==0 ) break;
10650 for(i=0; i<nArg; i++){
10651 int w;
10652 if( i<ArraySize(p->actualWidth) ){
10653 w = p->actualWidth[i];
10654 }else{
10655 w = 10;
10656 }
10657 if( p->cMode==MODE_Explain && azArg[i] && strlenChar(azArg[i])>w ){
10658 w = strlenChar(azArg[i]);
10659 }
10660 if( i==1 && p->aiIndent && p->pStmt ){
10661 if( p->iIndent<p->nIndent ){
10662 utf8_printf(p->out, "%*.s", p->aiIndent[p->iIndent], "");
10663 }
10664 p->iIndent++;
10665 }
10666 utf8_width_print(p->out, w, azArg[i] ? azArg[i] : p->nullValue);
10667 utf8_printf(p->out, "%s", i==nArg-1 ? rowSep : " ");
10668 }
10669 break;
10670 }
10671 case MODE_Semi: { /* .schema and .fullschema output */
10672 printSchemaLine(p->out, azArg[0], ";\n");
@@ -10865,23 +10875,65 @@
10865 output_quoted_escaped_string(p->out, azArg[i]);
10866 }
10867 }
10868 raw_printf(p->out,");\n");
10869 break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10870 }
10871 case MODE_Quote: {
10872 if( azArg==0 ) break;
10873 if( p->cnt==0 && p->showHeader ){
10874 for(i=0; i<nArg; i++){
10875 if( i>0 ) raw_printf(p->out, ",");
10876 output_quoted_string(p->out, azCol[i]);
10877 }
10878 raw_printf(p->out,"\n");
10879 }
10880 p->cnt++;
10881 for(i=0; i<nArg; i++){
10882 if( i>0 ) raw_printf(p->out, ",");
10883 if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
10884 utf8_printf(p->out,"NULL");
10885 }else if( aiType && aiType[i]==SQLITE_TEXT ){
10886 output_quoted_string(p->out, azArg[i]);
10887 }else if( aiType && aiType[i]==SQLITE_INTEGER ){
@@ -10899,11 +10951,11 @@
10899 utf8_printf(p->out,"%s", azArg[i]);
10900 }else{
10901 output_quoted_string(p->out, azArg[i]);
10902 }
10903 }
10904 raw_printf(p->out,"\n");
10905 break;
10906 }
10907 case MODE_Ascii: {
10908 if( p->cnt++==0 && p->showHeader ){
10909 for(i=0; i<nArg; i++){
@@ -11554,19 +11606,127 @@
11554 }
11555 sqlite3_reset(pQ);
11556 }
11557 sqlite3_finalize(pQ);
11558 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11559
11560 /*
11561 ** Run a prepared statement
11562 */
11563 static void exec_prepared_stmt(
11564 ShellState *pArg, /* Pointer to ShellState */
11565 sqlite3_stmt *pStmt /* Statment to run */
11566 ){
11567 int rc;
 
 
 
 
 
 
 
 
11568
11569 /* perform the first step. this will tell us if we
11570 ** have a result set or not and how wide it is.
11571 */
11572 rc = sqlite3_step(pStmt);
@@ -11611,10 +11771,15 @@
11611 rc = sqlite3_step(pStmt);
11612 }
11613 }
11614 } while( SQLITE_ROW == rc );
11615 sqlite3_free(pData);
 
 
 
 
 
11616 }
11617 }
11618 }
11619
11620 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -16883,19 +17048,28 @@
16883 }else if( c2=='i' && strncmp(azArg[1],"insert",n2)==0 ){
16884 p->mode = MODE_Insert;
16885 set_table_name(p, nArg>=3 ? azArg[2] : "table");
16886 }else if( c2=='q' && strncmp(azArg[1],"quote",n2)==0 ){
16887 p->mode = MODE_Quote;
 
 
16888 }else if( c2=='a' && strncmp(azArg[1],"ascii",n2)==0 ){
16889 p->mode = MODE_Ascii;
16890 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
16891 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
 
 
 
 
 
 
16892 }else if( nArg==1 ){
16893 raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
16894 }else{
16895 raw_printf(stderr, "Error: mode should be one of: "
16896 "ascii column csv html insert line list quote tabs tcl\n");
 
16897 rc = 1;
16898 }
16899 p->cMode = p->mode;
16900 }else
16901
@@ -17992,11 +18166,11 @@
17992 utf8_printf(p->out,"%12.12s: ", "rowseparator");
17993 output_c_string(p->out, p->rowSeparator);
17994 raw_printf(p->out, "\n");
17995 utf8_printf(p->out, "%12.12s: %s\n","stats", azBool[p->statsOn!=0]);
17996 utf8_printf(p->out, "%12.12s: ", "width");
17997 for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) {
17998 raw_printf(p->out, "%d ", p->colWidth[i]);
17999 }
18000 raw_printf(p->out, "\n");
18001 utf8_printf(p->out, "%12.12s: %s\n", "filename",
18002 p->zDbFilename ? p->zDbFilename : "");
@@ -18541,11 +18715,15 @@
18541 #endif
18542
18543 if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
18544 int j;
18545 assert( nArg<=ArraySize(azArg) );
18546 for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){
 
 
 
 
18547 p->colWidth[j-1] = (int)integerValue(azArg[j]);
18548 }
18549 }else
18550
18551 {
@@ -18901,13 +19079,15 @@
18901 " -heap SIZE Size of heap for memsys3 or memsys5\n"
18902 #endif
18903 " -help show this message\n"
18904 " -html set output mode to HTML\n"
18905 " -interactive force interactive I/O\n"
 
18906 " -line set output mode to 'line'\n"
18907 " -list set output mode to 'list'\n"
18908 " -lookaside SIZE N use N entries of SZ bytes for lookaside memory\n"
 
18909 #if defined(SQLITE_ENABLE_DESERIALIZE)
18910 " -maxsize N maximum size for a --deserialize database\n"
18911 #endif
18912 " -memtrace trace all memory allocations and deallocations\n"
18913 " -mmap N default mmap size set to N\n"
@@ -18923,10 +19103,11 @@
18923 " -separator SEP set output column separator. Default: '|'\n"
18924 #ifdef SQLITE_ENABLE_SORTER_REFERENCES
18925 " -sorterref SIZE sorter references threshold size\n"
18926 #endif
18927 " -stats print memory stats before each finalize\n"
 
18928 " -version show SQLite version\n"
18929 " -vfs NAME use NAME as the default VFS\n"
18930 #ifdef SQLITE_ENABLE_VFSTRACE
18931 " -vfstrace enable tracing of all VFS calls\n"
18932 #endif
@@ -19324,10 +19505,16 @@
19324 data.mode = MODE_Quote;
19325 }else if( strcmp(z,"-line")==0 ){
19326 data.mode = MODE_Line;
19327 }else if( strcmp(z,"-column")==0 ){
19328 data.mode = MODE_Column;
 
 
 
 
 
 
19329 }else if( strcmp(z,"-csv")==0 ){
19330 data.mode = MODE_Csv;
19331 memcpy(data.colSeparator,",",2);
19332 #ifdef SQLITE_HAVE_ZLIB
19333 }else if( strcmp(z,"-zip")==0 ){
@@ -19541,10 +19728,11 @@
19541 clearTempFile(&data);
19542 #if !SQLITE_SHELL_IS_UTF8
19543 for(i=0; i<argcToFree; i++) free(argvToFree[i]);
19544 free(argvToFree);
19545 #endif
 
19546 /* Clear the global data structure so that valgrind will detect memory
19547 ** leaks */
19548 memset(&data, 0, sizeof(data));
19549 return rc;
19550 }
19551
--- src/shell.c
+++ src/shell.c
@@ -9700,22 +9700,10 @@
9700 char **azFilter; /* Array of xFilter rejection GLOB patterns */
9701 sqlite3_session *p; /* The open session */
9702 };
9703 #endif
9704
 
 
 
 
 
 
 
 
 
 
 
 
9705 typedef struct ExpertInfo ExpertInfo;
9706 struct ExpertInfo {
9707 sqlite3expert *pExpert;
9708 int bVerbose;
9709 };
@@ -9781,12 +9769,13 @@
9769 char zTestcase[30]; /* Name of current test case */
9770 char colSeparator[20]; /* Column separator character for several modes */
9771 char rowSeparator[20]; /* Row separator character for MODE_Ascii */
9772 char colSepPrior[20]; /* Saved column separator */
9773 char rowSepPrior[20]; /* Saved row separator */
9774 int *colWidth; /* Requested width of each column in columnar modes */
9775 int *actualWidth; /* Actual width of each column */
9776 int nWidth; /* Number of slots in colWidth[] and actualWidth[] */
9777 char nullValue[20]; /* The text to print when a NULL comes back from
9778 ** the database */
9779 char outfile[FILENAME_MAX]; /* Filename for *out */
9780 const char *zDbFilename; /* name of the database file */
9781 char *zFreeOnClose; /* Filename to free when closing */
@@ -9867,10 +9856,13 @@
9856 #define MODE_Csv 8 /* Quote strings, numbers are plain */
9857 #define MODE_Explain 9 /* Like MODE_Column, but do not truncate data */
9858 #define MODE_Ascii 10 /* Use ASCII unit and record separators (0x1F/0x1E) */
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",
@@ -9881,11 +9873,14 @@
9873 "tcl",
9874 "csv",
9875 "explain",
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.
@@ -10248,10 +10243,44 @@
10243 fputc(c, out);
10244 }
10245 }
10246 fputc('"', out);
10247 }
10248
10249 /*
10250 ** Output the given string as a quoted according to JSON quoting rules.
10251 */
10252 static void output_json_string(FILE *out, const char *z, int n){
10253 unsigned int c;
10254 if( n<0 ) n = (int)strlen(z);
10255 fputc('"', out);
10256 while( n-- ){
10257 c = *(z++);
10258 if( c=='\\' || c=='"' ){
10259 fputc('\\', out);
10260 fputc(c, out);
10261 }else if( c<=0x1f ){
10262 fputc('\\', out);
10263 if( c=='\b' ){
10264 fputc('b', out);
10265 }else if( c=='\f' ){
10266 fputc('f', out);
10267 }else if( c=='\n' ){
10268 fputc('n', out);
10269 }else if( c=='\r' ){
10270 fputc('r', out);
10271 }else if( c=='\t' ){
10272 fputc('t', out);
10273 }else{
10274 raw_printf(out, "u%04x",c);
10275 }
10276 }else{
10277 fputc(c, out);
10278 }
10279 }
10280 fputc('"', out);
10281 }
10282
10283 /*
10284 ** Output the given string with characters that are special to
10285 ** HTML escaped.
10286 */
@@ -10557,10 +10586,40 @@
10586 raw_printf(p->out, "Progress %u\n", p->nProgress);
10587 }
10588 return 0;
10589 }
10590 #endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
10591
10592 /*
10593 ** Print N dashes
10594 */
10595 static void print_dashes(FILE *out, int N){
10596 const char zDash[] = "--------------------------------------------------";
10597 const int nDash = sizeof(zDash) - 1;
10598 while( N>nDash ){
10599 fputs(zDash, out);
10600 N -= nDash;
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
10624 ** invokes for each row of a query result.
10625 */
@@ -10567,11 +10626,11 @@
10626 static int shell_callback(
10627 void *pArg,
10628 int nArg, /* Number of result columns */
10629 char **azArg, /* Text of each result column */
10630 char **azCol, /* Column names */
10631 int *aiType /* Column types. Might be NULL */
10632 ){
10633 int i;
10634 ShellState *p = (ShellState*)pArg;
10635
10636 if( azArg==0 ) return 0;
@@ -10588,85 +10647,36 @@
10647 utf8_printf(p->out,"%*s = %s%s", w, azCol[i],
10648 azArg[i] ? azArg[i] : p->nullValue, p->rowSeparator);
10649 }
10650 break;
10651 }
10652 case MODE_Explain: {
10653 static const int aExplainWidth[] = {4, 13, 4, 4, 4, 13, 2, 13};
10654 if( nArg>ArraySize(aExplainWidth) ){
10655 nArg = ArraySize(aExplainWidth);
 
 
 
 
 
 
 
 
 
 
 
 
 
10656 }
10657 if( p->cnt++==0 ){
10658 for(i=0; i<nArg; i++){
10659 int w = aExplainWidth[i];
10660 utf8_width_print(p->out, w, azCol[i]);
10661 fputs(i==nArg-1 ? "\n" : " ", p->out);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10662 }
10663 }
10664 if( azArg==0 ) break;
10665 for(i=0; i<nArg; i++){
10666 int w = aExplainWidth[i];
10667 if( azArg[i] && strlenChar(azArg[i])>w ){
 
 
 
 
 
10668 w = strlenChar(azArg[i]);
10669 }
10670 if( i==1 && p->aiIndent && p->pStmt ){
10671 if( p->iIndent<p->nIndent ){
10672 utf8_printf(p->out, "%*.s", p->aiIndent[p->iIndent], "");
10673 }
10674 p->iIndent++;
10675 }
10676 utf8_width_print(p->out, w, azArg[i] ? azArg[i] : p->nullValue);
10677 fputs(i==nArg-1 ? "\n" : " ", p->out);
10678 }
10679 break;
10680 }
10681 case MODE_Semi: { /* .schema and .fullschema output */
10682 printSchemaLine(p->out, azArg[0], ";\n");
@@ -10865,23 +10875,65 @@
10875 output_quoted_escaped_string(p->out, azArg[i]);
10876 }
10877 }
10878 raw_printf(p->out,");\n");
10879 break;
10880 }
10881 case MODE_Json: {
10882 if( azArg==0 ) break;
10883 if( p->cnt==0 ){
10884 fputs("[{", p->out);
10885 }else{
10886 fputs(",\n{", p->out);
10887 }
10888 p->cnt++;
10889 for(i=0; i<nArg; i++){
10890 output_json_string(p->out, azCol[i], -1);
10891 putc(':', p->out);
10892 if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
10893 fputs("null",p->out);
10894 }else if( aiType && aiType[i]==SQLITE_FLOAT ){
10895 char z[50];
10896 double r = sqlite3_column_double(p->pStmt, i);
10897 sqlite3_uint64 ur;
10898 memcpy(&ur,&r,sizeof(r));
10899 if( ur==0x7ff0000000000000LL ){
10900 raw_printf(p->out, "1e999");
10901 }else if( ur==0xfff0000000000000LL ){
10902 raw_printf(p->out, "-1e999");
10903 }else{
10904 sqlite3_snprintf(50,z,"%!.20g", r);
10905 raw_printf(p->out, "%s", z);
10906 }
10907 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
10908 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
10909 int nBlob = sqlite3_column_bytes(p->pStmt, i);
10910 output_json_string(p->out, pBlob, nBlob);
10911 }else if( aiType && aiType[i]==SQLITE_TEXT ){
10912 output_json_string(p->out, azArg[i], -1);
10913 }else{
10914 utf8_printf(p->out,"%s", azArg[i]);
10915 }
10916 if( i<nArg-1 ){
10917 putc(',', p->out);
10918 }
10919 }
10920 putc('}', p->out);
10921 break;
10922 }
10923 case MODE_Quote: {
10924 if( azArg==0 ) break;
10925 if( p->cnt==0 && p->showHeader ){
10926 for(i=0; i<nArg; i++){
10927 if( i>0 ) fputs(p->colSeparator, p->out);
10928 output_quoted_string(p->out, azCol[i]);
10929 }
10930 fputs(p->rowSeparator, p->out);
10931 }
10932 p->cnt++;
10933 for(i=0; i<nArg; i++){
10934 if( i>0 ) fputs(p->colSeparator, p->out);
10935 if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
10936 utf8_printf(p->out,"NULL");
10937 }else if( aiType && aiType[i]==SQLITE_TEXT ){
10938 output_quoted_string(p->out, azArg[i]);
10939 }else if( aiType && aiType[i]==SQLITE_INTEGER ){
@@ -10899,11 +10951,11 @@
10951 utf8_printf(p->out,"%s", azArg[i]);
10952 }else{
10953 output_quoted_string(p->out, azArg[i]);
10954 }
10955 }
10956 fputs(p->rowSeparator, p->out);
10957 break;
10958 }
10959 case MODE_Ascii: {
10960 if( p->cnt++==0 && p->showHeader ){
10961 for(i=0; i<nArg; i++){
@@ -11554,19 +11606,127 @@
11606 }
11607 sqlite3_reset(pQ);
11608 }
11609 sqlite3_finalize(pQ);
11610 }
11611
11612 /*
11613 ** Run a prepared statement and output the result in one of the
11614 ** table-oriented formats: MODE_Column, MODE_Markdown, or MODE_Table.
11615 **
11616 ** This is different from ordinary exec_prepared_stmt() in that
11617 ** it has to run the entire query and gather the results into memory
11618 ** first, in order to determine column widths, before providing
11619 ** any output.
11620 */
11621 static void exec_prepared_stmt_columnar(
11622 ShellState *p, /* Pointer to ShellState */
11623 sqlite3_stmt *pStmt /* Statment to run */
11624 ){
11625 int nRow = 0;
11626 int nColumn = 0;
11627 char **azData = 0;
11628 char *zMsg = 0;
11629 const char *z;
11630 int rc;
11631 int i, j, nTotal, w, n;
11632 const char *colSep;
11633 const char *rowSep;
11634
11635 rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
11636 &azData, &nRow, &nColumn, &zMsg);
11637 if( rc ){
11638 utf8_printf(p->out, "ERROR: %s\n", zMsg);
11639 sqlite3_free(zMsg);
11640 sqlite3_free_table(azData);
11641 return;
11642 }
11643 if( nColumn>p->nWidth ){
11644 p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
11645 if( p->colWidth==0 ) shell_out_of_memory();
11646 for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
11647 p->nWidth = nColumn;
11648 p->actualWidth = &p->colWidth[nColumn];
11649 }
11650 memset(p->actualWidth, 0, nColumn*sizeof(int));
11651 for(i=0; i<nColumn; i++){
11652 w = p->colWidth[i];
11653 if( w<0 ) w = -w;
11654 p->actualWidth[i] = w;
11655 }
11656 nTotal = nColumn*(nRow+1);
11657 for(i=0; i<nTotal; i++){
11658 z = azData[i];
11659 if( z==0 ) z = p->nullValue;
11660 n = strlenChar(z);
11661 j = i%nColumn;
11662 if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
11663 }
11664 if( p->cMode==MODE_Column ){
11665 colSep = " ";
11666 rowSep = "\n";
11667 if( p->showHeader ){
11668 for(i=0; i<nColumn; i++){
11669 w = p->actualWidth[i];
11670 if( p->colWidth[i]<0 ) w = -w;
11671 utf8_width_print(p->out, w, azData[i]);
11672 fputs(i==nColumn-1?"\n":" ", p->out);
11673 }
11674 for(i=0; i<nColumn; i++){
11675 print_dashes(p->out, p->actualWidth[i]);
11676 fputs(i==nColumn-1?"\n":" ", p->out);
11677 }
11678 }
11679 }else{
11680 colSep = " | ";
11681 rowSep = " |\n";
11682 if( p->cMode==MODE_Table ) print_row_separator(p, nColumn, "+");
11683 fputs("| ", p->out);
11684 for(i=0; i<nColumn; i++){
11685 w = p->actualWidth[i];
11686 n = strlenChar(azData[i]);
11687 utf8_printf(p->out, "%*s%s%*s", (w-n)/2, "", azData[i], (w-n+1)/2, "");
11688 fputs(i==nColumn-1?" |\n":" | ", p->out);
11689 }
11690 print_row_separator(p, nColumn, p->cMode==MODE_Table ? "+" : "|");
11691 }
11692 for(i=nColumn, j=0; i<nTotal; i++, j++){
11693 if( j==0 && p->cMode!=MODE_Column ) fputs("| ", p->out);
11694 z = azData[i];
11695 if( z==0 ) z = p->nullValue;
11696 w = p->actualWidth[j];
11697 if( p->colWidth[j]<0 ) w = -w;
11698 utf8_width_print(p->out, w, z);
11699 if( j==nColumn-1 ){
11700 fputs(rowSep, p->out);
11701 j = -1;
11702 }else{
11703 fputs(colSep, p->out);
11704 }
11705 }
11706 if( p->cMode==MODE_Table ){
11707 print_row_separator(p, nColumn, "+");
11708 }
11709 sqlite3_free_table(azData);
11710 }
11711
11712 /*
11713 ** Run a prepared statement
11714 */
11715 static void exec_prepared_stmt(
11716 ShellState *pArg, /* Pointer to ShellState */
11717 sqlite3_stmt *pStmt /* Statment to run */
11718 ){
11719 int rc;
11720
11721 if( pArg->cMode==MODE_Column
11722 || pArg->cMode==MODE_Table
11723 || pArg->cMode==MODE_Markdown
11724 ){
11725 exec_prepared_stmt_columnar(pArg, pStmt);
11726 return;
11727 }
11728
11729 /* perform the first step. this will tell us if we
11730 ** have a result set or not and how wide it is.
11731 */
11732 rc = sqlite3_step(pStmt);
@@ -11611,10 +11771,15 @@
11771 rc = sqlite3_step(pStmt);
11772 }
11773 }
11774 } while( SQLITE_ROW == rc );
11775 sqlite3_free(pData);
11776 if( pArg->cMode==MODE_Table ){
11777 print_row_separator(pArg, nCol, "+");
11778 }else if( pArg->cMode==MODE_Json ){
11779 fputs("]\n", pArg->out);
11780 }
11781 }
11782 }
11783 }
11784
11785 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -16883,19 +17048,28 @@
17048 }else if( c2=='i' && strncmp(azArg[1],"insert",n2)==0 ){
17049 p->mode = MODE_Insert;
17050 set_table_name(p, nArg>=3 ? azArg[2] : "table");
17051 }else if( c2=='q' && strncmp(azArg[1],"quote",n2)==0 ){
17052 p->mode = MODE_Quote;
17053 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Comma);
17054 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Row);
17055 }else if( c2=='a' && strncmp(azArg[1],"ascii",n2)==0 ){
17056 p->mode = MODE_Ascii;
17057 sqlite3_snprintf(sizeof(p->colSeparator), p->colSeparator, SEP_Unit);
17058 sqlite3_snprintf(sizeof(p->rowSeparator), p->rowSeparator, SEP_Record);
17059 }else if( c2=='m' && strncmp(azArg[1],"markdown",n2)==0 ){
17060 p->mode = MODE_Markdown;
17061 }else if( c2=='t' && strncmp(azArg[1],"table",n2)==0 ){
17062 p->mode = MODE_Table;
17063 }else if( c2=='j' && strncmp(azArg[1],"json",n2)==0 ){
17064 p->mode = MODE_Json;
17065 }else if( nArg==1 ){
17066 raw_printf(p->out, "current output mode: %s\n", modeDescr[p->mode]);
17067 }else{
17068 raw_printf(stderr, "Error: mode should be one of: "
17069 "ascii column csv html insert json line list markdown "
17070 "quote table tabs tcl\n");
17071 rc = 1;
17072 }
17073 p->cMode = p->mode;
17074 }else
17075
@@ -17992,11 +18166,11 @@
18166 utf8_printf(p->out,"%12.12s: ", "rowseparator");
18167 output_c_string(p->out, p->rowSeparator);
18168 raw_printf(p->out, "\n");
18169 utf8_printf(p->out, "%12.12s: %s\n","stats", azBool[p->statsOn!=0]);
18170 utf8_printf(p->out, "%12.12s: ", "width");
18171 for (i=0;i<p->nWidth;i++) {
18172 raw_printf(p->out, "%d ", p->colWidth[i]);
18173 }
18174 raw_printf(p->out, "\n");
18175 utf8_printf(p->out, "%12.12s: %s\n", "filename",
18176 p->zDbFilename ? p->zDbFilename : "");
@@ -18541,11 +18715,15 @@
18715 #endif
18716
18717 if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
18718 int j;
18719 assert( nArg<=ArraySize(azArg) );
18720 p->nWidth = nArg-1;
18721 p->colWidth = realloc(p->colWidth, p->nWidth*sizeof(int)*2);
18722 if( p->colWidth==0 && p->nWidth>0 ) shell_out_of_memory();
18723 if( p->nWidth ) p->actualWidth = &p->colWidth[p->nWidth];
18724 for(j=1; j<nArg; j++){
18725 p->colWidth[j-1] = (int)integerValue(azArg[j]);
18726 }
18727 }else
18728
18729 {
@@ -18901,13 +19079,15 @@
19079 " -heap SIZE Size of heap for memsys3 or memsys5\n"
19080 #endif
19081 " -help show this message\n"
19082 " -html set output mode to HTML\n"
19083 " -interactive force interactive I/O\n"
19084 " -json set output mode to 'json'\n"
19085 " -line set output mode to 'line'\n"
19086 " -list set output mode to 'list'\n"
19087 " -lookaside SIZE N use N entries of SZ bytes for lookaside memory\n"
19088 " -markdown set output mode to 'markdown'\n"
19089 #if defined(SQLITE_ENABLE_DESERIALIZE)
19090 " -maxsize N maximum size for a --deserialize database\n"
19091 #endif
19092 " -memtrace trace all memory allocations and deallocations\n"
19093 " -mmap N default mmap size set to N\n"
@@ -18923,10 +19103,11 @@
19103 " -separator SEP set output column separator. Default: '|'\n"
19104 #ifdef SQLITE_ENABLE_SORTER_REFERENCES
19105 " -sorterref SIZE sorter references threshold size\n"
19106 #endif
19107 " -stats print memory stats before each finalize\n"
19108 " -table set output mode to 'table'\n"
19109 " -version show SQLite version\n"
19110 " -vfs NAME use NAME as the default VFS\n"
19111 #ifdef SQLITE_ENABLE_VFSTRACE
19112 " -vfstrace enable tracing of all VFS calls\n"
19113 #endif
@@ -19324,10 +19505,16 @@
19505 data.mode = MODE_Quote;
19506 }else if( strcmp(z,"-line")==0 ){
19507 data.mode = MODE_Line;
19508 }else if( strcmp(z,"-column")==0 ){
19509 data.mode = MODE_Column;
19510 }else if( strcmp(z,"-json")==0 ){
19511 data.mode = MODE_Json;
19512 }else if( strcmp(z,"-markdown")==0 ){
19513 data.mode = MODE_Markdown;
19514 }else if( strcmp(z,"-table")==0 ){
19515 data.mode = MODE_Table;
19516 }else if( strcmp(z,"-csv")==0 ){
19517 data.mode = MODE_Csv;
19518 memcpy(data.colSeparator,",",2);
19519 #ifdef SQLITE_HAVE_ZLIB
19520 }else if( strcmp(z,"-zip")==0 ){
@@ -19541,10 +19728,11 @@
19728 clearTempFile(&data);
19729 #if !SQLITE_SHELL_IS_UTF8
19730 for(i=0; i<argcToFree; i++) free(argvToFree[i]);
19731 free(argvToFree);
19732 #endif
19733 free(data.colWidth);
19734 /* Clear the global data structure so that valgrind will detect memory
19735 ** leaks */
19736 memset(&data, 0, sizeof(data));
19737 return rc;
19738 }
19739
+54 -34
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.32.1. By combining all the individual C code files into this
3
+** version 3.33.0. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -1160,13 +1160,13 @@
11601160
**
11611161
** See also: [sqlite3_libversion()],
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
1165
-#define SQLITE_VERSION "3.32.1"
1166
-#define SQLITE_VERSION_NUMBER 3032001
1167
-#define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350"
1165
+#define SQLITE_VERSION "3.33.0"
1166
+#define SQLITE_VERSION_NUMBER 3033000
1167
+#define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -38285,11 +38285,14 @@
3828538285
** 2. Write lock (ofst==0).
3828638286
** 3. Read locks (ofst>=3 && ofst<SQLITE_SHM_NLOCK).
3828738287
**
3828838288
** In other words, if this is a blocking lock, none of the locks that
3828938289
** occur later in the above list than the lock being obtained may be
38290
- ** held. */
38290
+ ** held.
38291
+ **
38292
+ ** It is not permitted to block on the RECOVER lock.
38293
+ */
3829138294
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
3829238295
assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || (
3829338296
(ofst!=2) /* not RECOVER */
3829438297
&& (ofst!=1 || (p->exclMask|p->sharedMask)==0)
3829538298
&& (ofst!=0 || (p->exclMask|p->sharedMask)<3)
@@ -80835,11 +80838,15 @@
8083580838
** if the VDBE has just been set to run but has not actually executed any
8083680839
** instructions yet, leave the main database error information unchanged.
8083780840
*/
8083880841
if( p->pc>=0 ){
8083980842
vdbeInvokeSqllog(p);
80840
- sqlite3VdbeTransferError(p);
80843
+ if( db->pErr || p->zErrMsg ){
80844
+ sqlite3VdbeTransferError(p);
80845
+ }else{
80846
+ db->errCode = p->rc;
80847
+ }
8084180848
if( p->runOnlyOnce ) p->expired = 1;
8084280849
}else if( p->rc && p->expired ){
8084380850
/* The expired flag was set on the VDBE before the first call
8084480851
** to sqlite3_step(). For consistency (since sqlite3_step() was
8084580852
** called), set the database error in this case as well.
@@ -80855,12 +80862,14 @@
8085580862
if( p->apCsr ) for(i=0; i<p->nCursor; i++) assert( p->apCsr[i]==0 );
8085680863
if( p->aMem ){
8085780864
for(i=0; i<p->nMem; i++) assert( p->aMem[i].flags==MEM_Undefined );
8085880865
}
8085980866
#endif
80860
- sqlite3DbFree(db, p->zErrMsg);
80861
- p->zErrMsg = 0;
80867
+ if( p->zErrMsg ){
80868
+ sqlite3DbFree(db, p->zErrMsg);
80869
+ p->zErrMsg = 0;
80870
+ }
8086280871
p->pResultSet = 0;
8086380872
#ifdef SQLITE_DEBUG
8086480873
p->nWrite = 0;
8086580874
#endif
8086680875
@@ -102032,11 +102041,11 @@
102032102041
** satisfy the query. This is preferable to generating a new
102033102042
** ephemeral table. */
102034102043
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){
102035102044
sqlite3 *db = pParse->db; /* Database connection */
102036102045
Table *pTab; /* Table <table>. */
102037
- i16 iDb; /* Database idx for pTab */
102046
+ int iDb; /* Database idx for pTab */
102038102047
ExprList *pEList = p->pEList;
102039102048
int nExpr = pEList->nExpr;
102040102049
102041102050
assert( p->pEList!=0 ); /* Because of isCandidateForInOpt(p) */
102042102051
assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
@@ -102043,10 +102052,11 @@
102043102052
assert( p->pSrc!=0 ); /* Because of isCandidateForInOpt(p) */
102044102053
pTab = p->pSrc->a[0].pTab;
102045102054
102046102055
/* Code an OP_Transaction and OP_TableLock for <table>. */
102047102056
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
102057
+ assert( iDb>=0 && iDb<SQLITE_MAX_ATTACHED );
102048102058
sqlite3CodeVerifySchema(pParse, iDb);
102049102059
sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
102050102060
102051102061
assert(v); /* sqlite3GetVdbe() has always been previously called */
102052102062
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
@@ -103276,14 +103286,11 @@
103276103286
int r1, r2; /* Various register numbers */
103277103287
Expr tempX; /* Temporary expression node */
103278103288
int p5 = 0;
103279103289
103280103290
assert( target>0 && target<=pParse->nMem );
103281
- if( v==0 ){
103282
- assert( pParse->db->mallocFailed );
103283
- return 0;
103284
- }
103291
+ assert( v!=0 );
103285103292
103286103293
expr_code_doover:
103287103294
if( pExpr==0 ){
103288103295
op = TK_NULL;
103289103296
}else{
@@ -104109,13 +104116,14 @@
104109104116
SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){
104110104117
int inReg;
104111104118
104112104119
assert( pExpr==0 || !ExprHasVVAProperty(pExpr,EP_Immutable) );
104113104120
assert( target>0 && target<=pParse->nMem );
104114
- inReg = sqlite3ExprCodeTarget(pParse, pExpr, target);
104115104121
assert( pParse->pVdbe!=0 || pParse->db->mallocFailed );
104116
- if( inReg!=target && pParse->pVdbe ){
104122
+ if( pParse->pVdbe==0 ) return;
104123
+ inReg = sqlite3ExprCodeTarget(pParse, pExpr, target);
104124
+ if( inReg!=target ){
104117104125
u8 op;
104118104126
if( ExprHasProperty(pExpr,EP_Subquery) ){
104119104127
op = OP_Copy;
104120104128
}else{
104121104129
op = OP_SCopy;
@@ -114091,25 +114099,37 @@
114091114099
** Apart from that, we have little to go on besides intuition as to
114092114100
** how aiRowEst[] should be initialized. The numbers generated here
114093114101
** are based on typical values found in actual indices.
114094114102
*/
114095114103
SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
114096
- /* 10, 9, 8, 7, 6 */
114097
- LogEst aVal[] = { 33, 32, 30, 28, 26 };
114104
+ /* 10, 9, 8, 7, 6 */
114105
+ static const LogEst aVal[] = { 33, 32, 30, 28, 26 };
114098114106
LogEst *a = pIdx->aiRowLogEst;
114107
+ LogEst x;
114099114108
int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol);
114100114109
int i;
114101114110
114102114111
/* Indexes with default row estimates should not have stat1 data */
114103114112
assert( !pIdx->hasStat1 );
114104114113
114105114114
/* Set the first entry (number of rows in the index) to the estimated
114106114115
** number of rows in the table, or half the number of rows in the table
114107
- ** for a partial index. But do not let the estimate drop below 10. */
114108
- a[0] = pIdx->pTable->nRowLogEst;
114109
- if( pIdx->pPartIdxWhere!=0 ) a[0] -= 10; assert( 10==sqlite3LogEst(2) );
114110
- if( a[0]<33 ) a[0] = 33; assert( 33==sqlite3LogEst(10) );
114116
+ ** for a partial index.
114117
+ **
114118
+ ** 2020-05-27: If some of the stat data is coming from the sqlite_stat1
114119
+ ** table but other parts we are having to guess at, then do not let the
114120
+ ** estimated number of rows in the table be less than 1000 (LogEst 99).
114121
+ ** Failure to do this can cause the indexes for which we do not have
114122
+ ** stat1 data to be ignored by the query planner. tag-20200527-1
114123
+ */
114124
+ x = pIdx->pTable->nRowLogEst;
114125
+ assert( 99==sqlite3LogEst(1000) );
114126
+ if( x<99 ){
114127
+ pIdx->pTable->nRowLogEst = x = 99;
114128
+ }
114129
+ if( pIdx->pPartIdxWhere!=0 ) x -= 10; assert( 10==sqlite3LogEst(2) );
114130
+ a[0] = x;
114111114131
114112114132
/* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is
114113114133
** 6 and each subsequent value (if any) is 5. */
114114114134
memcpy(&a[1], aVal, nCopy*sizeof(LogEst));
114115114135
for(i=nCopy+1; i<=pIdx->nKeyCol; i++){
@@ -128405,21 +128425,22 @@
128405128425
**
128406128426
** If the same database is attached more than once, the first
128407128427
** attached database is returned.
128408128428
*/
128409128429
SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
128410
- int i = -1000000;
128430
+ int i = -32768;
128411128431
128412
- /* If pSchema is NULL, then return -1000000. This happens when code in
128432
+ /* If pSchema is NULL, then return -32768. This happens when code in
128413128433
** expr.c is trying to resolve a reference to a transient table (i.e. one
128414128434
** created by a sub-select). In this case the return value of this
128415128435
** function should never be used.
128416128436
**
128417
- ** We return -1000000 instead of the more usual -1 simply because using
128418
- ** -1000000 as the incorrect index into db->aDb[] is much
128437
+ ** We return -32768 instead of the more usual -1 simply because using
128438
+ ** -32768 as the incorrect index into db->aDb[] is much
128419128439
** more likely to cause a segfault than -1 (of course there are assert()
128420
- ** statements too, but it never hurts to play the odds).
128440
+ ** statements too, but it never hurts to play the odds) and
128441
+ ** -32768 will still fit into a 16-bit signed integer.
128421128442
*/
128422128443
assert( sqlite3_mutex_held(db->mutex) );
128423128444
if( pSchema ){
128424128445
for(i=0; 1; i++){
128425128446
assert( i<db->nDb );
@@ -128970,13 +128991,13 @@
128970128991
Expr *pHaving, /* the HAVING clause */
128971128992
ExprList *pOrderBy, /* the ORDER BY clause */
128972128993
u32 selFlags, /* Flag parameters, such as SF_Distinct */
128973128994
Expr *pLimit /* LIMIT value. NULL means not used */
128974128995
){
128975
- Select *pNew;
128996
+ Select *pNew, *pAllocated;
128976128997
Select standin;
128977
- pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
128998
+ pAllocated = pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
128978128999
if( pNew==0 ){
128979129000
assert( pParse->db->mallocFailed );
128980129001
pNew = &standin;
128981129002
}
128982129003
if( pEList==0 ){
@@ -129006,16 +129027,15 @@
129006129027
pNew->pWin = 0;
129007129028
pNew->pWinDefn = 0;
129008129029
#endif
129009129030
if( pParse->db->mallocFailed ) {
129010129031
clearSelect(pParse->db, pNew, pNew!=&standin);
129011
- pNew = 0;
129032
+ pAllocated = 0;
129012129033
}else{
129013129034
assert( pNew->pSrc!=0 || pParse->nErr>0 );
129014129035
}
129015
- assert( pNew!=&standin );
129016
- return pNew;
129036
+ return pAllocated;
129017129037
}
129018129038
129019129039
129020129040
/*
129021129041
** Delete the given Select structure and all of its substructures.
@@ -224820,11 +224840,11 @@
224820224840
int nArg, /* Number of args */
224821224841
sqlite3_value **apUnused /* Function arguments */
224822224842
){
224823224843
assert( nArg==0 );
224824224844
UNUSED_PARAM2(nArg, apUnused);
224825
- sqlite3_result_text(pCtx, "fts5: 2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350", -1, SQLITE_TRANSIENT);
224845
+ sqlite3_result_text(pCtx, "fts5: 2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82", -1, SQLITE_TRANSIENT);
224826224846
}
224827224847
224828224848
/*
224829224849
** Return true if zName is the extension on one of the shadow tables used
224830224850
** by this module.
@@ -229603,12 +229623,12 @@
229603229623
}
229604229624
#endif /* SQLITE_CORE */
229605229625
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229606229626
229607229627
/************** End of stmt.c ************************************************/
229608
-#if __LINE__!=229608
229628
+#if __LINE__!=229628
229609229629
#undef SQLITE_SOURCE_ID
229610
-#define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba8alt2"
229630
+#define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9falt2"
229611229631
#endif
229612229632
/* Return the source-id for this library */
229613229633
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229614229634
/************************** End of sqlite3.c ******************************/
229615229635
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.32.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1160,13 +1160,13 @@
1160 **
1161 ** See also: [sqlite3_libversion()],
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.32.1"
1166 #define SQLITE_VERSION_NUMBER 3032001
1167 #define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -38285,11 +38285,14 @@
38285 ** 2. Write lock (ofst==0).
38286 ** 3. Read locks (ofst>=3 && ofst<SQLITE_SHM_NLOCK).
38287 **
38288 ** In other words, if this is a blocking lock, none of the locks that
38289 ** occur later in the above list than the lock being obtained may be
38290 ** held. */
 
 
 
38291 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
38292 assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || (
38293 (ofst!=2) /* not RECOVER */
38294 && (ofst!=1 || (p->exclMask|p->sharedMask)==0)
38295 && (ofst!=0 || (p->exclMask|p->sharedMask)<3)
@@ -80835,11 +80838,15 @@
80835 ** if the VDBE has just been set to run but has not actually executed any
80836 ** instructions yet, leave the main database error information unchanged.
80837 */
80838 if( p->pc>=0 ){
80839 vdbeInvokeSqllog(p);
80840 sqlite3VdbeTransferError(p);
 
 
 
 
80841 if( p->runOnlyOnce ) p->expired = 1;
80842 }else if( p->rc && p->expired ){
80843 /* The expired flag was set on the VDBE before the first call
80844 ** to sqlite3_step(). For consistency (since sqlite3_step() was
80845 ** called), set the database error in this case as well.
@@ -80855,12 +80862,14 @@
80855 if( p->apCsr ) for(i=0; i<p->nCursor; i++) assert( p->apCsr[i]==0 );
80856 if( p->aMem ){
80857 for(i=0; i<p->nMem; i++) assert( p->aMem[i].flags==MEM_Undefined );
80858 }
80859 #endif
80860 sqlite3DbFree(db, p->zErrMsg);
80861 p->zErrMsg = 0;
 
 
80862 p->pResultSet = 0;
80863 #ifdef SQLITE_DEBUG
80864 p->nWrite = 0;
80865 #endif
80866
@@ -102032,11 +102041,11 @@
102032 ** satisfy the query. This is preferable to generating a new
102033 ** ephemeral table. */
102034 if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){
102035 sqlite3 *db = pParse->db; /* Database connection */
102036 Table *pTab; /* Table <table>. */
102037 i16 iDb; /* Database idx for pTab */
102038 ExprList *pEList = p->pEList;
102039 int nExpr = pEList->nExpr;
102040
102041 assert( p->pEList!=0 ); /* Because of isCandidateForInOpt(p) */
102042 assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
@@ -102043,10 +102052,11 @@
102043 assert( p->pSrc!=0 ); /* Because of isCandidateForInOpt(p) */
102044 pTab = p->pSrc->a[0].pTab;
102045
102046 /* Code an OP_Transaction and OP_TableLock for <table>. */
102047 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
 
102048 sqlite3CodeVerifySchema(pParse, iDb);
102049 sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
102050
102051 assert(v); /* sqlite3GetVdbe() has always been previously called */
102052 if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
@@ -103276,14 +103286,11 @@
103276 int r1, r2; /* Various register numbers */
103277 Expr tempX; /* Temporary expression node */
103278 int p5 = 0;
103279
103280 assert( target>0 && target<=pParse->nMem );
103281 if( v==0 ){
103282 assert( pParse->db->mallocFailed );
103283 return 0;
103284 }
103285
103286 expr_code_doover:
103287 if( pExpr==0 ){
103288 op = TK_NULL;
103289 }else{
@@ -104109,13 +104116,14 @@
104109 SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){
104110 int inReg;
104111
104112 assert( pExpr==0 || !ExprHasVVAProperty(pExpr,EP_Immutable) );
104113 assert( target>0 && target<=pParse->nMem );
104114 inReg = sqlite3ExprCodeTarget(pParse, pExpr, target);
104115 assert( pParse->pVdbe!=0 || pParse->db->mallocFailed );
104116 if( inReg!=target && pParse->pVdbe ){
 
 
104117 u8 op;
104118 if( ExprHasProperty(pExpr,EP_Subquery) ){
104119 op = OP_Copy;
104120 }else{
104121 op = OP_SCopy;
@@ -114091,25 +114099,37 @@
114091 ** Apart from that, we have little to go on besides intuition as to
114092 ** how aiRowEst[] should be initialized. The numbers generated here
114093 ** are based on typical values found in actual indices.
114094 */
114095 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
114096 /* 10, 9, 8, 7, 6 */
114097 LogEst aVal[] = { 33, 32, 30, 28, 26 };
114098 LogEst *a = pIdx->aiRowLogEst;
 
114099 int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol);
114100 int i;
114101
114102 /* Indexes with default row estimates should not have stat1 data */
114103 assert( !pIdx->hasStat1 );
114104
114105 /* Set the first entry (number of rows in the index) to the estimated
114106 ** number of rows in the table, or half the number of rows in the table
114107 ** for a partial index. But do not let the estimate drop below 10. */
114108 a[0] = pIdx->pTable->nRowLogEst;
114109 if( pIdx->pPartIdxWhere!=0 ) a[0] -= 10; assert( 10==sqlite3LogEst(2) );
114110 if( a[0]<33 ) a[0] = 33; assert( 33==sqlite3LogEst(10) );
 
 
 
 
 
 
 
 
 
 
 
114111
114112 /* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is
114113 ** 6 and each subsequent value (if any) is 5. */
114114 memcpy(&a[1], aVal, nCopy*sizeof(LogEst));
114115 for(i=nCopy+1; i<=pIdx->nKeyCol; i++){
@@ -128405,21 +128425,22 @@
128405 **
128406 ** If the same database is attached more than once, the first
128407 ** attached database is returned.
128408 */
128409 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
128410 int i = -1000000;
128411
128412 /* If pSchema is NULL, then return -1000000. This happens when code in
128413 ** expr.c is trying to resolve a reference to a transient table (i.e. one
128414 ** created by a sub-select). In this case the return value of this
128415 ** function should never be used.
128416 **
128417 ** We return -1000000 instead of the more usual -1 simply because using
128418 ** -1000000 as the incorrect index into db->aDb[] is much
128419 ** more likely to cause a segfault than -1 (of course there are assert()
128420 ** statements too, but it never hurts to play the odds).
 
128421 */
128422 assert( sqlite3_mutex_held(db->mutex) );
128423 if( pSchema ){
128424 for(i=0; 1; i++){
128425 assert( i<db->nDb );
@@ -128970,13 +128991,13 @@
128970 Expr *pHaving, /* the HAVING clause */
128971 ExprList *pOrderBy, /* the ORDER BY clause */
128972 u32 selFlags, /* Flag parameters, such as SF_Distinct */
128973 Expr *pLimit /* LIMIT value. NULL means not used */
128974 ){
128975 Select *pNew;
128976 Select standin;
128977 pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
128978 if( pNew==0 ){
128979 assert( pParse->db->mallocFailed );
128980 pNew = &standin;
128981 }
128982 if( pEList==0 ){
@@ -129006,16 +129027,15 @@
129006 pNew->pWin = 0;
129007 pNew->pWinDefn = 0;
129008 #endif
129009 if( pParse->db->mallocFailed ) {
129010 clearSelect(pParse->db, pNew, pNew!=&standin);
129011 pNew = 0;
129012 }else{
129013 assert( pNew->pSrc!=0 || pParse->nErr>0 );
129014 }
129015 assert( pNew!=&standin );
129016 return pNew;
129017 }
129018
129019
129020 /*
129021 ** Delete the given Select structure and all of its substructures.
@@ -224820,11 +224840,11 @@
224820 int nArg, /* Number of args */
224821 sqlite3_value **apUnused /* Function arguments */
224822 ){
224823 assert( nArg==0 );
224824 UNUSED_PARAM2(nArg, apUnused);
224825 sqlite3_result_text(pCtx, "fts5: 2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350", -1, SQLITE_TRANSIENT);
224826 }
224827
224828 /*
224829 ** Return true if zName is the extension on one of the shadow tables used
224830 ** by this module.
@@ -229603,12 +229623,12 @@
229603 }
229604 #endif /* SQLITE_CORE */
229605 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229606
229607 /************** End of stmt.c ************************************************/
229608 #if __LINE__!=229608
229609 #undef SQLITE_SOURCE_ID
229610 #define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba8alt2"
229611 #endif
229612 /* Return the source-id for this library */
229613 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229614 /************************** End of sqlite3.c ******************************/
229615
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.33.0. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1160,13 +1160,13 @@
1160 **
1161 ** See also: [sqlite3_libversion()],
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-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -38285,11 +38285,14 @@
38285 ** 2. Write lock (ofst==0).
38286 ** 3. Read locks (ofst>=3 && ofst<SQLITE_SHM_NLOCK).
38287 **
38288 ** In other words, if this is a blocking lock, none of the locks that
38289 ** occur later in the above list than the lock being obtained may be
38290 ** held.
38291 **
38292 ** It is not permitted to block on the RECOVER lock.
38293 */
38294 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
38295 assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || (
38296 (ofst!=2) /* not RECOVER */
38297 && (ofst!=1 || (p->exclMask|p->sharedMask)==0)
38298 && (ofst!=0 || (p->exclMask|p->sharedMask)<3)
@@ -80835,11 +80838,15 @@
80838 ** if the VDBE has just been set to run but has not actually executed any
80839 ** instructions yet, leave the main database error information unchanged.
80840 */
80841 if( p->pc>=0 ){
80842 vdbeInvokeSqllog(p);
80843 if( db->pErr || p->zErrMsg ){
80844 sqlite3VdbeTransferError(p);
80845 }else{
80846 db->errCode = p->rc;
80847 }
80848 if( p->runOnlyOnce ) p->expired = 1;
80849 }else if( p->rc && p->expired ){
80850 /* The expired flag was set on the VDBE before the first call
80851 ** to sqlite3_step(). For consistency (since sqlite3_step() was
80852 ** called), set the database error in this case as well.
@@ -80855,12 +80862,14 @@
80862 if( p->apCsr ) for(i=0; i<p->nCursor; i++) assert( p->apCsr[i]==0 );
80863 if( p->aMem ){
80864 for(i=0; i<p->nMem; i++) assert( p->aMem[i].flags==MEM_Undefined );
80865 }
80866 #endif
80867 if( p->zErrMsg ){
80868 sqlite3DbFree(db, p->zErrMsg);
80869 p->zErrMsg = 0;
80870 }
80871 p->pResultSet = 0;
80872 #ifdef SQLITE_DEBUG
80873 p->nWrite = 0;
80874 #endif
80875
@@ -102032,11 +102041,11 @@
102041 ** satisfy the query. This is preferable to generating a new
102042 ** ephemeral table. */
102043 if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){
102044 sqlite3 *db = pParse->db; /* Database connection */
102045 Table *pTab; /* Table <table>. */
102046 int iDb; /* Database idx for pTab */
102047 ExprList *pEList = p->pEList;
102048 int nExpr = pEList->nExpr;
102049
102050 assert( p->pEList!=0 ); /* Because of isCandidateForInOpt(p) */
102051 assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
@@ -102043,10 +102052,11 @@
102052 assert( p->pSrc!=0 ); /* Because of isCandidateForInOpt(p) */
102053 pTab = p->pSrc->a[0].pTab;
102054
102055 /* Code an OP_Transaction and OP_TableLock for <table>. */
102056 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
102057 assert( iDb>=0 && iDb<SQLITE_MAX_ATTACHED );
102058 sqlite3CodeVerifySchema(pParse, iDb);
102059 sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
102060
102061 assert(v); /* sqlite3GetVdbe() has always been previously called */
102062 if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
@@ -103276,14 +103286,11 @@
103286 int r1, r2; /* Various register numbers */
103287 Expr tempX; /* Temporary expression node */
103288 int p5 = 0;
103289
103290 assert( target>0 && target<=pParse->nMem );
103291 assert( v!=0 );
 
 
 
103292
103293 expr_code_doover:
103294 if( pExpr==0 ){
103295 op = TK_NULL;
103296 }else{
@@ -104109,13 +104116,14 @@
104116 SQLITE_PRIVATE void sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){
104117 int inReg;
104118
104119 assert( pExpr==0 || !ExprHasVVAProperty(pExpr,EP_Immutable) );
104120 assert( target>0 && target<=pParse->nMem );
 
104121 assert( pParse->pVdbe!=0 || pParse->db->mallocFailed );
104122 if( pParse->pVdbe==0 ) return;
104123 inReg = sqlite3ExprCodeTarget(pParse, pExpr, target);
104124 if( inReg!=target ){
104125 u8 op;
104126 if( ExprHasProperty(pExpr,EP_Subquery) ){
104127 op = OP_Copy;
104128 }else{
104129 op = OP_SCopy;
@@ -114091,25 +114099,37 @@
114099 ** Apart from that, we have little to go on besides intuition as to
114100 ** how aiRowEst[] should be initialized. The numbers generated here
114101 ** are based on typical values found in actual indices.
114102 */
114103 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
114104 /* 10, 9, 8, 7, 6 */
114105 static const LogEst aVal[] = { 33, 32, 30, 28, 26 };
114106 LogEst *a = pIdx->aiRowLogEst;
114107 LogEst x;
114108 int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol);
114109 int i;
114110
114111 /* Indexes with default row estimates should not have stat1 data */
114112 assert( !pIdx->hasStat1 );
114113
114114 /* Set the first entry (number of rows in the index) to the estimated
114115 ** number of rows in the table, or half the number of rows in the table
114116 ** for a partial index.
114117 **
114118 ** 2020-05-27: If some of the stat data is coming from the sqlite_stat1
114119 ** table but other parts we are having to guess at, then do not let the
114120 ** estimated number of rows in the table be less than 1000 (LogEst 99).
114121 ** Failure to do this can cause the indexes for which we do not have
114122 ** stat1 data to be ignored by the query planner. tag-20200527-1
114123 */
114124 x = pIdx->pTable->nRowLogEst;
114125 assert( 99==sqlite3LogEst(1000) );
114126 if( x<99 ){
114127 pIdx->pTable->nRowLogEst = x = 99;
114128 }
114129 if( pIdx->pPartIdxWhere!=0 ) x -= 10; assert( 10==sqlite3LogEst(2) );
114130 a[0] = x;
114131
114132 /* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is
114133 ** 6 and each subsequent value (if any) is 5. */
114134 memcpy(&a[1], aVal, nCopy*sizeof(LogEst));
114135 for(i=nCopy+1; i<=pIdx->nKeyCol; i++){
@@ -128405,21 +128425,22 @@
128425 **
128426 ** If the same database is attached more than once, the first
128427 ** attached database is returned.
128428 */
128429 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
128430 int i = -32768;
128431
128432 /* If pSchema is NULL, then return -32768. This happens when code in
128433 ** expr.c is trying to resolve a reference to a transient table (i.e. one
128434 ** created by a sub-select). In this case the return value of this
128435 ** function should never be used.
128436 **
128437 ** We return -32768 instead of the more usual -1 simply because using
128438 ** -32768 as the incorrect index into db->aDb[] is much
128439 ** more likely to cause a segfault than -1 (of course there are assert()
128440 ** statements too, but it never hurts to play the odds) and
128441 ** -32768 will still fit into a 16-bit signed integer.
128442 */
128443 assert( sqlite3_mutex_held(db->mutex) );
128444 if( pSchema ){
128445 for(i=0; 1; i++){
128446 assert( i<db->nDb );
@@ -128970,13 +128991,13 @@
128991 Expr *pHaving, /* the HAVING clause */
128992 ExprList *pOrderBy, /* the ORDER BY clause */
128993 u32 selFlags, /* Flag parameters, such as SF_Distinct */
128994 Expr *pLimit /* LIMIT value. NULL means not used */
128995 ){
128996 Select *pNew, *pAllocated;
128997 Select standin;
128998 pAllocated = pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
128999 if( pNew==0 ){
129000 assert( pParse->db->mallocFailed );
129001 pNew = &standin;
129002 }
129003 if( pEList==0 ){
@@ -129006,16 +129027,15 @@
129027 pNew->pWin = 0;
129028 pNew->pWinDefn = 0;
129029 #endif
129030 if( pParse->db->mallocFailed ) {
129031 clearSelect(pParse->db, pNew, pNew!=&standin);
129032 pAllocated = 0;
129033 }else{
129034 assert( pNew->pSrc!=0 || pParse->nErr>0 );
129035 }
129036 return pAllocated;
 
129037 }
129038
129039
129040 /*
129041 ** Delete the given Select structure and all of its substructures.
@@ -224820,11 +224840,11 @@
224840 int nArg, /* Number of args */
224841 sqlite3_value **apUnused /* Function arguments */
224842 ){
224843 assert( nArg==0 );
224844 UNUSED_PARAM2(nArg, apUnused);
224845 sqlite3_result_text(pCtx, "fts5: 2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82", -1, SQLITE_TRANSIENT);
224846 }
224847
224848 /*
224849 ** Return true if zName is the extension on one of the shadow tables used
224850 ** by this module.
@@ -229603,12 +229623,12 @@
229623 }
229624 #endif /* SQLITE_CORE */
229625 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229626
229627 /************** End of stmt.c ************************************************/
229628 #if __LINE__!=229628
229629 #undef SQLITE_SOURCE_ID
229630 #define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9falt2"
229631 #endif
229632 /* Return the source-id for this library */
229633 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229634 /************************** End of sqlite3.c ******************************/
229635
+3 -3
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121121
**
122122
** See also: [sqlite3_libversion()],
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126
-#define SQLITE_VERSION "3.32.1"
127
-#define SQLITE_VERSION_NUMBER 3032001
128
-#define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350"
126
+#define SQLITE_VERSION "3.33.0"
127
+#define SQLITE_VERSION_NUMBER 3033000
128
+#define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.32.1"
127 #define SQLITE_VERSION_NUMBER 3032001
128 #define SQLITE_SOURCE_ID "2020-05-25 16:19:56 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
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-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,17 +83,17 @@
8383
8484
# define the SQLite files, which need special flags on compile
8585
SQLITESRC=sqlite3.c
8686
ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
8787
SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
88
-SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DSQLITE_WIN32_NO_ANSI
88
+SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DSQLITE_WIN32_NO_ANSI
8989
9090
# define the SQLite shell files, which need special flags on compile
9191
SQLITESHELLSRC=shell.c
9292
ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
9393
SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94
-SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
94
+SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
9595
9696
# define the th scripting files, which need special flags on compile
9797
THSRC=th.c th_lang.c
9898
ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
9999
THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100100
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,17 +83,17 @@
83
84 # define the SQLite files, which need special flags on compile
85 SQLITESRC=sqlite3.c
86 ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
87 SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
88 SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DSQLITE_WIN32_NO_ANSI
89
90 # define the SQLite shell files, which need special flags on compile
91 SQLITESHELLSRC=shell.c
92 ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
93 SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94 SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
95
96 # define the th scripting files, which need special flags on compile
97 THSRC=th.c th_lang.c
98 ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,17 +83,17 @@
83
84 # define the SQLite files, which need special flags on compile
85 SQLITESRC=sqlite3.c
86 ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
87 SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
88 SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DSQLITE_WIN32_NO_ANSI
89
90 # define the SQLite shell files, which need special flags on compile
91 SQLITESHELLSRC=shell.c
92 ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
93 SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94 SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
95
96 # define the th scripting files, which need special flags on compile
97 THSRC=th.c th_lang.c
98 ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,13 +24,13 @@
2424
CFLAGS = -o
2525
BCC = $(DMDIR)\bin\dmc $(CFLAGS)
2626
TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
2727
LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
2828
29
-SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
29
+SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
3030
31
-SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
31
+SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3232
3333
SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
3434
3535
OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
3636
3737
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,13 +24,13 @@
24 CFLAGS = -o
25 BCC = $(DMDIR)\bin\dmc $(CFLAGS)
26 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
27 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,13 +24,13 @@
24 CFLAGS = -o
25 BCC = $(DMDIR)\bin\dmc $(CFLAGS)
26 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
27 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c webmail_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\webmail$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -2485,11 +2485,10 @@
24852485
-DSQLITE_DEFAULT_MEMSTATUS=0 \
24862486
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
24872487
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
24882488
-DSQLITE_OMIT_DECLTYPE \
24892489
-DSQLITE_OMIT_DEPRECATED \
2490
- -DSQLITE_OMIT_GET_TABLE \
24912490
-DSQLITE_OMIT_PROGRESS_CALLBACK \
24922491
-DSQLITE_OMIT_SHARED_CACHE \
24932492
-DSQLITE_OMIT_LOAD_EXTENSION \
24942493
-DSQLITE_MAX_EXPR_DEPTH=0 \
24952494
-DSQLITE_USE_ALLOCA \
@@ -2516,11 +2515,10 @@
25162515
-DSQLITE_DEFAULT_MEMSTATUS=0 \
25172516
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
25182517
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
25192518
-DSQLITE_OMIT_DECLTYPE \
25202519
-DSQLITE_OMIT_DEPRECATED \
2521
- -DSQLITE_OMIT_GET_TABLE \
25222520
-DSQLITE_OMIT_PROGRESS_CALLBACK \
25232521
-DSQLITE_OMIT_SHARED_CACHE \
25242522
-DSQLITE_OMIT_LOAD_EXTENSION \
25252523
-DSQLITE_MAX_EXPR_DEPTH=0 \
25262524
-DSQLITE_USE_ALLOCA \
25272525
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -2485,11 +2485,10 @@
2485 -DSQLITE_DEFAULT_MEMSTATUS=0 \
2486 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
2487 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
2488 -DSQLITE_OMIT_DECLTYPE \
2489 -DSQLITE_OMIT_DEPRECATED \
2490 -DSQLITE_OMIT_GET_TABLE \
2491 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2492 -DSQLITE_OMIT_SHARED_CACHE \
2493 -DSQLITE_OMIT_LOAD_EXTENSION \
2494 -DSQLITE_MAX_EXPR_DEPTH=0 \
2495 -DSQLITE_USE_ALLOCA \
@@ -2516,11 +2515,10 @@
2516 -DSQLITE_DEFAULT_MEMSTATUS=0 \
2517 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
2518 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
2519 -DSQLITE_OMIT_DECLTYPE \
2520 -DSQLITE_OMIT_DEPRECATED \
2521 -DSQLITE_OMIT_GET_TABLE \
2522 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2523 -DSQLITE_OMIT_SHARED_CACHE \
2524 -DSQLITE_OMIT_LOAD_EXTENSION \
2525 -DSQLITE_MAX_EXPR_DEPTH=0 \
2526 -DSQLITE_USE_ALLOCA \
2527
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -2485,11 +2485,10 @@
2485 -DSQLITE_DEFAULT_MEMSTATUS=0 \
2486 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
2487 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
2488 -DSQLITE_OMIT_DECLTYPE \
2489 -DSQLITE_OMIT_DEPRECATED \
 
2490 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2491 -DSQLITE_OMIT_SHARED_CACHE \
2492 -DSQLITE_OMIT_LOAD_EXTENSION \
2493 -DSQLITE_MAX_EXPR_DEPTH=0 \
2494 -DSQLITE_USE_ALLOCA \
@@ -2516,11 +2515,10 @@
2515 -DSQLITE_DEFAULT_MEMSTATUS=0 \
2516 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
2517 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
2518 -DSQLITE_OMIT_DECLTYPE \
2519 -DSQLITE_OMIT_DEPRECATED \
 
2520 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2521 -DSQLITE_OMIT_SHARED_CACHE \
2522 -DSQLITE_OMIT_LOAD_EXTENSION \
2523 -DSQLITE_MAX_EXPR_DEPTH=0 \
2524 -DSQLITE_USE_ALLOCA \
2525
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -283,11 +283,10 @@
283283
/DSQLITE_DEFAULT_MEMSTATUS=0 \
284284
/DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
285285
/DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
286286
/DSQLITE_OMIT_DECLTYPE \
287287
/DSQLITE_OMIT_DEPRECATED \
288
- /DSQLITE_OMIT_GET_TABLE \
289288
/DSQLITE_OMIT_PROGRESS_CALLBACK \
290289
/DSQLITE_OMIT_SHARED_CACHE \
291290
/DSQLITE_OMIT_LOAD_EXTENSION \
292291
/DSQLITE_MAX_EXPR_DEPTH=0 \
293292
/DSQLITE_USE_ALLOCA \
@@ -311,11 +310,10 @@
311310
/DSQLITE_DEFAULT_MEMSTATUS=0 \
312311
/DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
313312
/DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
314313
/DSQLITE_OMIT_DECLTYPE \
315314
/DSQLITE_OMIT_DEPRECATED \
316
- /DSQLITE_OMIT_GET_TABLE \
317315
/DSQLITE_OMIT_PROGRESS_CALLBACK \
318316
/DSQLITE_OMIT_SHARED_CACHE \
319317
/DSQLITE_OMIT_LOAD_EXTENSION \
320318
/DSQLITE_MAX_EXPR_DEPTH=0 \
321319
/DSQLITE_USE_ALLOCA \
322320
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -283,11 +283,10 @@
283 /DSQLITE_DEFAULT_MEMSTATUS=0 \
284 /DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
285 /DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
286 /DSQLITE_OMIT_DECLTYPE \
287 /DSQLITE_OMIT_DEPRECATED \
288 /DSQLITE_OMIT_GET_TABLE \
289 /DSQLITE_OMIT_PROGRESS_CALLBACK \
290 /DSQLITE_OMIT_SHARED_CACHE \
291 /DSQLITE_OMIT_LOAD_EXTENSION \
292 /DSQLITE_MAX_EXPR_DEPTH=0 \
293 /DSQLITE_USE_ALLOCA \
@@ -311,11 +310,10 @@
311 /DSQLITE_DEFAULT_MEMSTATUS=0 \
312 /DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
313 /DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
314 /DSQLITE_OMIT_DECLTYPE \
315 /DSQLITE_OMIT_DEPRECATED \
316 /DSQLITE_OMIT_GET_TABLE \
317 /DSQLITE_OMIT_PROGRESS_CALLBACK \
318 /DSQLITE_OMIT_SHARED_CACHE \
319 /DSQLITE_OMIT_LOAD_EXTENSION \
320 /DSQLITE_MAX_EXPR_DEPTH=0 \
321 /DSQLITE_USE_ALLOCA \
322
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -283,11 +283,10 @@
283 /DSQLITE_DEFAULT_MEMSTATUS=0 \
284 /DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
285 /DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
286 /DSQLITE_OMIT_DECLTYPE \
287 /DSQLITE_OMIT_DEPRECATED \
 
288 /DSQLITE_OMIT_PROGRESS_CALLBACK \
289 /DSQLITE_OMIT_SHARED_CACHE \
290 /DSQLITE_OMIT_LOAD_EXTENSION \
291 /DSQLITE_MAX_EXPR_DEPTH=0 \
292 /DSQLITE_USE_ALLOCA \
@@ -311,11 +310,10 @@
310 /DSQLITE_DEFAULT_MEMSTATUS=0 \
311 /DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
312 /DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
313 /DSQLITE_OMIT_DECLTYPE \
314 /DSQLITE_OMIT_DEPRECATED \
 
315 /DSQLITE_OMIT_PROGRESS_CALLBACK \
316 /DSQLITE_OMIT_SHARED_CACHE \
317 /DSQLITE_OMIT_LOAD_EXTENSION \
318 /DSQLITE_MAX_EXPR_DEPTH=0 \
319 /DSQLITE_USE_ALLOCA \
320

Keyboard Shortcuts

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