Fossil SCM

Update the built-in SQLite to the latest trunk version that includes the COMMIT patch for 3.32.2 plus the new ".mode table" and ".mode json" features of the CLI.

drh 2020-06-04 14:10 trunk
Commit 991879177b644f4a4ecd07c1a33b8fbf48f5c42076227e7f1311756d6b843bb0
3 files changed +41 -24 +38 -12 +1 -1
+41 -24
--- src/shell.c
+++ src/shell.c
@@ -10658,10 +10658,15 @@
1065810658
for(i=0; i<nArg; i++){
1065910659
int w = aExplainWidth[i];
1066010660
utf8_width_print(p->out, w, azCol[i]);
1066110661
fputs(i==nArg-1 ? "\n" : " ", p->out);
1066210662
}
10663
+ for(i=0; i<nArg; i++){
10664
+ int w = aExplainWidth[i];
10665
+ print_dashes(p->out, w);
10666
+ fputs(i==nArg-1 ? "\n" : " ", p->out);
10667
+ }
1066310668
}
1066410669
if( azArg==0 ) break;
1066510670
for(i=0; i<nArg; i++){
1066610671
int w = aExplainWidth[i];
1066710672
if( azArg[i] && strlenChar(azArg[i])>w ){
@@ -12456,20 +12461,23 @@
1245612461
".load FILE ?ENTRY? Load an extension library",
1245712462
#endif
1245812463
".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
1245912464
".mode MODE ?TABLE? Set output mode",
1246012465
" MODE is one of:",
12461
- " ascii Columns/rows delimited by 0x1F and 0x1E",
12462
- " csv Comma-separated values",
12463
- " column Left-aligned columns. (See .width)",
12464
- " html HTML <table> code",
12465
- " insert SQL insert statements for TABLE",
12466
- " line One value per line",
12467
- " list Values delimited by \"|\"",
12468
- " quote Escape answers as for SQL",
12469
- " tabs Tab-separated values",
12470
- " tcl TCL list elements",
12466
+ " ascii Columns/rows delimited by 0x1F and 0x1E",
12467
+ " csv Comma-separated values",
12468
+ " column Output in columns. (See .width)",
12469
+ " html HTML <table> code",
12470
+ " insert SQL insert statements for TABLE",
12471
+ " json Results in a JSON array",
12472
+ " line One value per line",
12473
+ " list Values delimited by \"|\"",
12474
+ " markdown Markdown table format",
12475
+ " quote Escape answers as for SQL",
12476
+ " table ASCII-art table",
12477
+ " tabs Tab-separated values",
12478
+ " tcl TCL list elements",
1247112479
".nullvalue STRING Use STRING in place of NULL values",
1247212480
".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",
1247312481
" If FILE begins with '|' then open as a pipe",
1247412482
" --bom Put a UTF8 byte-order mark at the beginning",
1247512483
" -e Send output to the system text editor",
@@ -12590,11 +12598,11 @@
1259012598
" --allexcept Unregister everything except those named",
1259112599
#endif
1259212600
".vfsinfo ?AUX? Information about the top-level VFS",
1259312601
".vfslist List all available VFSes",
1259412602
".vfsname ?AUX? Print the name of the VFS stack",
12595
- ".width NUM1 NUM2 ... Set column widths for \"column\" mode",
12603
+ ".width NUM1 NUM2 ... Set minimum column widths for columnar output",
1259612604
" Negative values right-justify",
1259712605
};
1259812606
1259912607
/*
1260012608
** Output help text.
@@ -13427,10 +13435,11 @@
1342713435
*/
1342813436
typedef struct ImportCtx ImportCtx;
1342913437
struct ImportCtx {
1343013438
const char *zFile; /* Name of the input file */
1343113439
FILE *in; /* Read the CSV text from this input stream */
13440
+ int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close in */
1343213441
char *z; /* Accumulated text for a field */
1343313442
int n; /* Number of bytes in z */
1343413443
int nAlloc; /* Space allocated for z[] */
1343513444
int nLine; /* Current line number */
1343613445
int nRow; /* Number of rows imported */
@@ -13438,10 +13447,20 @@
1343813447
int bNotFirst; /* True if one or more bytes already read */
1343913448
int cTerm; /* Character that terminated the most recent field */
1344013449
int cColSep; /* The column separator character. (Usually ",") */
1344113450
int cRowSep; /* The row separator character. (Usually "\n") */
1344213451
};
13452
+
13453
+/* Clean up resourced used by an ImportCtx */
13454
+static void import_cleanup(ImportCtx *p){
13455
+ if( p->in!=0 && p->xCloser!=0 ){
13456
+ p->xCloser(p->in);
13457
+ p->in = 0;
13458
+ }
13459
+ sqlite3_free(p->z);
13460
+ p->z = 0;
13461
+}
1344313462
1344413463
/* Append a single byte to z[] */
1344513464
static void import_append_char(ImportCtx *p, int c){
1344613465
if( p->n+1>=p->nAlloc ){
1344713466
p->nAlloc += p->nAlloc + 100;
@@ -16160,10 +16179,11 @@
1616016179
if( strcmp(z,"preserve-rowids")==0 ){
1616116180
#ifdef SQLITE_OMIT_VIRTUALTABLE
1616216181
raw_printf(stderr, "The --preserve-rowids option is not compatible"
1616316182
" with SQLITE_OMIT_VIRTUALTABLE\n");
1616416183
rc = 1;
16184
+ sqlite3_free(zLike);
1616516185
goto meta_command_exit;
1616616186
#else
1616716187
ShellSetFlag(p, SHFLG_PreserveRowid);
1616816188
#endif
1616916189
}else
@@ -16171,10 +16191,11 @@
1617116191
ShellSetFlag(p, SHFLG_Newlines);
1617216192
}else
1617316193
{
1617416194
raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
1617516195
rc = 1;
16196
+ sqlite3_free(zLike);
1617616197
goto meta_command_exit;
1617716198
}
1617816199
}else if( zLike ){
1617916200
zLike = sqlite3_mprintf("%z OR name LIKE %Q ESCAPE '\\'",
1618016201
zLike, azArg[i]);
@@ -16528,11 +16549,10 @@
1652816549
int needCommit; /* True to COMMIT or ROLLBACK at end */
1652916550
int nSep; /* Number of bytes in p->colSeparator[] */
1653016551
char *zSql; /* An SQL statement */
1653116552
ImportCtx sCtx; /* Reader context */
1653216553
char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */
16533
- int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close file */
1653416554
int eVerbose = 0; /* Larger for more console output */
1653516555
int nSkip = 0; /* Initial lines to skip */
1653616556
int useOutputMode = 1; /* Use output mode to determine separators */
1653716557
1653816558
memset(&sCtx, 0, sizeof(sCtx));
@@ -16634,15 +16654,15 @@
1663416654
rc = 1;
1663516655
goto meta_command_exit;
1663616656
#else
1663716657
sCtx.in = popen(sCtx.zFile+1, "r");
1663816658
sCtx.zFile = "<pipe>";
16639
- xCloser = pclose;
16659
+ sCtx.xCloser = pclose;
1664016660
#endif
1664116661
}else{
1664216662
sCtx.in = fopen(sCtx.zFile, "rb");
16643
- xCloser = fclose;
16663
+ sCtx.xCloser = fclose;
1664416664
}
1664516665
if( sCtx.in==0 ){
1664616666
utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile);
1664716667
rc = 1;
1664816668
goto meta_command_exit;
@@ -16662,11 +16682,11 @@
1666216682
while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
1666316683
sCtx.nLine++;
1666416684
}
1666516685
zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
1666616686
if( zSql==0 ){
16667
- xCloser(sCtx.in);
16687
+ import_cleanup(&sCtx);
1666816688
shell_out_of_memory();
1666916689
}
1667016690
nByte = strlen30(zSql);
1667116691
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
1667216692
import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
@@ -16678,12 +16698,11 @@
1667816698
cSep = ',';
1667916699
if( sCtx.cTerm!=sCtx.cColSep ) break;
1668016700
}
1668116701
if( cSep=='(' ){
1668216702
sqlite3_free(zCreate);
16683
- sqlite3_free(sCtx.z);
16684
- xCloser(sCtx.in);
16703
+ import_cleanup(&sCtx);
1668516704
utf8_printf(stderr,"%s: empty file\n", sCtx.zFile);
1668616705
rc = 1;
1668716706
goto meta_command_exit;
1668816707
}
1668916708
zCreate = sqlite3_mprintf("%z\n)", zCreate);
@@ -16693,32 +16712,31 @@
1669316712
rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
1669416713
sqlite3_free(zCreate);
1669516714
if( rc ){
1669616715
utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
1669716716
sqlite3_errmsg(p->db));
16698
- sqlite3_free(sCtx.z);
16699
- xCloser(sCtx.in);
16717
+ import_cleanup(&sCtx);
1670016718
rc = 1;
1670116719
goto meta_command_exit;
1670216720
}
1670316721
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
1670416722
}
1670516723
sqlite3_free(zSql);
1670616724
if( rc ){
1670716725
if (pStmt) sqlite3_finalize(pStmt);
1670816726
utf8_printf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
16709
- xCloser(sCtx.in);
16727
+ import_cleanup(&sCtx);
1671016728
rc = 1;
1671116729
goto meta_command_exit;
1671216730
}
1671316731
nCol = sqlite3_column_count(pStmt);
1671416732
sqlite3_finalize(pStmt);
1671516733
pStmt = 0;
1671616734
if( nCol==0 ) return 0; /* no columns, no error */
1671716735
zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 );
1671816736
if( zSql==0 ){
16719
- xCloser(sCtx.in);
16737
+ import_cleanup(&sCtx);
1672016738
shell_out_of_memory();
1672116739
}
1672216740
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
1672316741
j = strlen30(zSql);
1672416742
for(i=1; i<nCol; i++){
@@ -16733,11 +16751,11 @@
1673316751
rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
1673416752
sqlite3_free(zSql);
1673516753
if( rc ){
1673616754
utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
1673716755
if (pStmt) sqlite3_finalize(pStmt);
16738
- xCloser(sCtx.in);
16756
+ import_cleanup(&sCtx);
1673916757
rc = 1;
1674016758
goto meta_command_exit;
1674116759
}
1674216760
needCommit = sqlite3_get_autocommit(p->db);
1674316761
if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
@@ -16785,12 +16803,11 @@
1678516803
sCtx.nRow++;
1678616804
}
1678716805
}
1678816806
}while( sCtx.cTerm!=EOF );
1678916807
16790
- xCloser(sCtx.in);
16791
- sqlite3_free(sCtx.z);
16808
+ import_cleanup(&sCtx);
1679216809
sqlite3_finalize(pStmt);
1679316810
if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
1679416811
if( eVerbose>0 ){
1679516812
utf8_printf(p->out,
1679616813
"Added %d rows with %d errors using %d lines of input\n",
1679716814
--- src/shell.c
+++ src/shell.c
@@ -10658,10 +10658,15 @@
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 ){
@@ -12456,20 +12461,23 @@
12456 ".load FILE ?ENTRY? Load an extension library",
12457 #endif
12458 ".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
12459 ".mode MODE ?TABLE? Set output mode",
12460 " MODE is one of:",
12461 " ascii Columns/rows delimited by 0x1F and 0x1E",
12462 " csv Comma-separated values",
12463 " column Left-aligned columns. (See .width)",
12464 " html HTML <table> code",
12465 " insert SQL insert statements for TABLE",
12466 " line One value per line",
12467 " list Values delimited by \"|\"",
12468 " quote Escape answers as for SQL",
12469 " tabs Tab-separated values",
12470 " tcl TCL list elements",
 
 
 
12471 ".nullvalue STRING Use STRING in place of NULL values",
12472 ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",
12473 " If FILE begins with '|' then open as a pipe",
12474 " --bom Put a UTF8 byte-order mark at the beginning",
12475 " -e Send output to the system text editor",
@@ -12590,11 +12598,11 @@
12590 " --allexcept Unregister everything except those named",
12591 #endif
12592 ".vfsinfo ?AUX? Information about the top-level VFS",
12593 ".vfslist List all available VFSes",
12594 ".vfsname ?AUX? Print the name of the VFS stack",
12595 ".width NUM1 NUM2 ... Set column widths for \"column\" mode",
12596 " Negative values right-justify",
12597 };
12598
12599 /*
12600 ** Output help text.
@@ -13427,10 +13435,11 @@
13427 */
13428 typedef struct ImportCtx ImportCtx;
13429 struct ImportCtx {
13430 const char *zFile; /* Name of the input file */
13431 FILE *in; /* Read the CSV text from this input stream */
 
13432 char *z; /* Accumulated text for a field */
13433 int n; /* Number of bytes in z */
13434 int nAlloc; /* Space allocated for z[] */
13435 int nLine; /* Current line number */
13436 int nRow; /* Number of rows imported */
@@ -13438,10 +13447,20 @@
13438 int bNotFirst; /* True if one or more bytes already read */
13439 int cTerm; /* Character that terminated the most recent field */
13440 int cColSep; /* The column separator character. (Usually ",") */
13441 int cRowSep; /* The row separator character. (Usually "\n") */
13442 };
 
 
 
 
 
 
 
 
 
 
13443
13444 /* Append a single byte to z[] */
13445 static void import_append_char(ImportCtx *p, int c){
13446 if( p->n+1>=p->nAlloc ){
13447 p->nAlloc += p->nAlloc + 100;
@@ -16160,10 +16179,11 @@
16160 if( strcmp(z,"preserve-rowids")==0 ){
16161 #ifdef SQLITE_OMIT_VIRTUALTABLE
16162 raw_printf(stderr, "The --preserve-rowids option is not compatible"
16163 " with SQLITE_OMIT_VIRTUALTABLE\n");
16164 rc = 1;
 
16165 goto meta_command_exit;
16166 #else
16167 ShellSetFlag(p, SHFLG_PreserveRowid);
16168 #endif
16169 }else
@@ -16171,10 +16191,11 @@
16171 ShellSetFlag(p, SHFLG_Newlines);
16172 }else
16173 {
16174 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
16175 rc = 1;
 
16176 goto meta_command_exit;
16177 }
16178 }else if( zLike ){
16179 zLike = sqlite3_mprintf("%z OR name LIKE %Q ESCAPE '\\'",
16180 zLike, azArg[i]);
@@ -16528,11 +16549,10 @@
16528 int needCommit; /* True to COMMIT or ROLLBACK at end */
16529 int nSep; /* Number of bytes in p->colSeparator[] */
16530 char *zSql; /* An SQL statement */
16531 ImportCtx sCtx; /* Reader context */
16532 char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */
16533 int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close file */
16534 int eVerbose = 0; /* Larger for more console output */
16535 int nSkip = 0; /* Initial lines to skip */
16536 int useOutputMode = 1; /* Use output mode to determine separators */
16537
16538 memset(&sCtx, 0, sizeof(sCtx));
@@ -16634,15 +16654,15 @@
16634 rc = 1;
16635 goto meta_command_exit;
16636 #else
16637 sCtx.in = popen(sCtx.zFile+1, "r");
16638 sCtx.zFile = "<pipe>";
16639 xCloser = pclose;
16640 #endif
16641 }else{
16642 sCtx.in = fopen(sCtx.zFile, "rb");
16643 xCloser = fclose;
16644 }
16645 if( sCtx.in==0 ){
16646 utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile);
16647 rc = 1;
16648 goto meta_command_exit;
@@ -16662,11 +16682,11 @@
16662 while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
16663 sCtx.nLine++;
16664 }
16665 zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
16666 if( zSql==0 ){
16667 xCloser(sCtx.in);
16668 shell_out_of_memory();
16669 }
16670 nByte = strlen30(zSql);
16671 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16672 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
@@ -16678,12 +16698,11 @@
16678 cSep = ',';
16679 if( sCtx.cTerm!=sCtx.cColSep ) break;
16680 }
16681 if( cSep=='(' ){
16682 sqlite3_free(zCreate);
16683 sqlite3_free(sCtx.z);
16684 xCloser(sCtx.in);
16685 utf8_printf(stderr,"%s: empty file\n", sCtx.zFile);
16686 rc = 1;
16687 goto meta_command_exit;
16688 }
16689 zCreate = sqlite3_mprintf("%z\n)", zCreate);
@@ -16693,32 +16712,31 @@
16693 rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
16694 sqlite3_free(zCreate);
16695 if( rc ){
16696 utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
16697 sqlite3_errmsg(p->db));
16698 sqlite3_free(sCtx.z);
16699 xCloser(sCtx.in);
16700 rc = 1;
16701 goto meta_command_exit;
16702 }
16703 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16704 }
16705 sqlite3_free(zSql);
16706 if( rc ){
16707 if (pStmt) sqlite3_finalize(pStmt);
16708 utf8_printf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
16709 xCloser(sCtx.in);
16710 rc = 1;
16711 goto meta_command_exit;
16712 }
16713 nCol = sqlite3_column_count(pStmt);
16714 sqlite3_finalize(pStmt);
16715 pStmt = 0;
16716 if( nCol==0 ) return 0; /* no columns, no error */
16717 zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 );
16718 if( zSql==0 ){
16719 xCloser(sCtx.in);
16720 shell_out_of_memory();
16721 }
16722 sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
16723 j = strlen30(zSql);
16724 for(i=1; i<nCol; i++){
@@ -16733,11 +16751,11 @@
16733 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16734 sqlite3_free(zSql);
16735 if( rc ){
16736 utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
16737 if (pStmt) sqlite3_finalize(pStmt);
16738 xCloser(sCtx.in);
16739 rc = 1;
16740 goto meta_command_exit;
16741 }
16742 needCommit = sqlite3_get_autocommit(p->db);
16743 if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
@@ -16785,12 +16803,11 @@
16785 sCtx.nRow++;
16786 }
16787 }
16788 }while( sCtx.cTerm!=EOF );
16789
16790 xCloser(sCtx.in);
16791 sqlite3_free(sCtx.z);
16792 sqlite3_finalize(pStmt);
16793 if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
16794 if( eVerbose>0 ){
16795 utf8_printf(p->out,
16796 "Added %d rows with %d errors using %d lines of input\n",
16797
--- src/shell.c
+++ src/shell.c
@@ -10658,10 +10658,15 @@
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 for(i=0; i<nArg; i++){
10664 int w = aExplainWidth[i];
10665 print_dashes(p->out, w);
10666 fputs(i==nArg-1 ? "\n" : " ", p->out);
10667 }
10668 }
10669 if( azArg==0 ) break;
10670 for(i=0; i<nArg; i++){
10671 int w = aExplainWidth[i];
10672 if( azArg[i] && strlenChar(azArg[i])>w ){
@@ -12456,20 +12461,23 @@
12461 ".load FILE ?ENTRY? Load an extension library",
12462 #endif
12463 ".log FILE|off Turn logging on or off. FILE can be stderr/stdout",
12464 ".mode MODE ?TABLE? Set output mode",
12465 " MODE is one of:",
12466 " ascii Columns/rows delimited by 0x1F and 0x1E",
12467 " csv Comma-separated values",
12468 " column Output in columns. (See .width)",
12469 " html HTML <table> code",
12470 " insert SQL insert statements for TABLE",
12471 " json Results in a JSON array",
12472 " line One value per line",
12473 " list Values delimited by \"|\"",
12474 " markdown Markdown table format",
12475 " quote Escape answers as for SQL",
12476 " table ASCII-art table",
12477 " tabs Tab-separated values",
12478 " tcl TCL list elements",
12479 ".nullvalue STRING Use STRING in place of NULL values",
12480 ".once ?OPTIONS? ?FILE? Output for the next SQL command only to FILE",
12481 " If FILE begins with '|' then open as a pipe",
12482 " --bom Put a UTF8 byte-order mark at the beginning",
12483 " -e Send output to the system text editor",
@@ -12590,11 +12598,11 @@
12598 " --allexcept Unregister everything except those named",
12599 #endif
12600 ".vfsinfo ?AUX? Information about the top-level VFS",
12601 ".vfslist List all available VFSes",
12602 ".vfsname ?AUX? Print the name of the VFS stack",
12603 ".width NUM1 NUM2 ... Set minimum column widths for columnar output",
12604 " Negative values right-justify",
12605 };
12606
12607 /*
12608 ** Output help text.
@@ -13427,10 +13435,11 @@
13435 */
13436 typedef struct ImportCtx ImportCtx;
13437 struct ImportCtx {
13438 const char *zFile; /* Name of the input file */
13439 FILE *in; /* Read the CSV text from this input stream */
13440 int (SQLITE_CDECL *xCloser)(FILE*); /* Func to close in */
13441 char *z; /* Accumulated text for a field */
13442 int n; /* Number of bytes in z */
13443 int nAlloc; /* Space allocated for z[] */
13444 int nLine; /* Current line number */
13445 int nRow; /* Number of rows imported */
@@ -13438,10 +13447,20 @@
13447 int bNotFirst; /* True if one or more bytes already read */
13448 int cTerm; /* Character that terminated the most recent field */
13449 int cColSep; /* The column separator character. (Usually ",") */
13450 int cRowSep; /* The row separator character. (Usually "\n") */
13451 };
13452
13453 /* Clean up resourced used by an ImportCtx */
13454 static void import_cleanup(ImportCtx *p){
13455 if( p->in!=0 && p->xCloser!=0 ){
13456 p->xCloser(p->in);
13457 p->in = 0;
13458 }
13459 sqlite3_free(p->z);
13460 p->z = 0;
13461 }
13462
13463 /* Append a single byte to z[] */
13464 static void import_append_char(ImportCtx *p, int c){
13465 if( p->n+1>=p->nAlloc ){
13466 p->nAlloc += p->nAlloc + 100;
@@ -16160,10 +16179,11 @@
16179 if( strcmp(z,"preserve-rowids")==0 ){
16180 #ifdef SQLITE_OMIT_VIRTUALTABLE
16181 raw_printf(stderr, "The --preserve-rowids option is not compatible"
16182 " with SQLITE_OMIT_VIRTUALTABLE\n");
16183 rc = 1;
16184 sqlite3_free(zLike);
16185 goto meta_command_exit;
16186 #else
16187 ShellSetFlag(p, SHFLG_PreserveRowid);
16188 #endif
16189 }else
@@ -16171,10 +16191,11 @@
16191 ShellSetFlag(p, SHFLG_Newlines);
16192 }else
16193 {
16194 raw_printf(stderr, "Unknown option \"%s\" on \".dump\"\n", azArg[i]);
16195 rc = 1;
16196 sqlite3_free(zLike);
16197 goto meta_command_exit;
16198 }
16199 }else if( zLike ){
16200 zLike = sqlite3_mprintf("%z OR name LIKE %Q ESCAPE '\\'",
16201 zLike, azArg[i]);
@@ -16528,11 +16549,10 @@
16549 int needCommit; /* True to COMMIT or ROLLBACK at end */
16550 int nSep; /* Number of bytes in p->colSeparator[] */
16551 char *zSql; /* An SQL statement */
16552 ImportCtx sCtx; /* Reader context */
16553 char *(SQLITE_CDECL *xRead)(ImportCtx*); /* Func to read one value */
 
16554 int eVerbose = 0; /* Larger for more console output */
16555 int nSkip = 0; /* Initial lines to skip */
16556 int useOutputMode = 1; /* Use output mode to determine separators */
16557
16558 memset(&sCtx, 0, sizeof(sCtx));
@@ -16634,15 +16654,15 @@
16654 rc = 1;
16655 goto meta_command_exit;
16656 #else
16657 sCtx.in = popen(sCtx.zFile+1, "r");
16658 sCtx.zFile = "<pipe>";
16659 sCtx.xCloser = pclose;
16660 #endif
16661 }else{
16662 sCtx.in = fopen(sCtx.zFile, "rb");
16663 sCtx.xCloser = fclose;
16664 }
16665 if( sCtx.in==0 ){
16666 utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile);
16667 rc = 1;
16668 goto meta_command_exit;
@@ -16662,11 +16682,11 @@
16682 while( xRead(&sCtx) && sCtx.cTerm==sCtx.cColSep ){}
16683 sCtx.nLine++;
16684 }
16685 zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
16686 if( zSql==0 ){
16687 import_cleanup(&sCtx);
16688 shell_out_of_memory();
16689 }
16690 nByte = strlen30(zSql);
16691 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16692 import_append_char(&sCtx, 0); /* To ensure sCtx.z is allocated */
@@ -16678,12 +16698,11 @@
16698 cSep = ',';
16699 if( sCtx.cTerm!=sCtx.cColSep ) break;
16700 }
16701 if( cSep=='(' ){
16702 sqlite3_free(zCreate);
16703 import_cleanup(&sCtx);
 
16704 utf8_printf(stderr,"%s: empty file\n", sCtx.zFile);
16705 rc = 1;
16706 goto meta_command_exit;
16707 }
16708 zCreate = sqlite3_mprintf("%z\n)", zCreate);
@@ -16693,32 +16712,31 @@
16712 rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
16713 sqlite3_free(zCreate);
16714 if( rc ){
16715 utf8_printf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
16716 sqlite3_errmsg(p->db));
16717 import_cleanup(&sCtx);
 
16718 rc = 1;
16719 goto meta_command_exit;
16720 }
16721 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16722 }
16723 sqlite3_free(zSql);
16724 if( rc ){
16725 if (pStmt) sqlite3_finalize(pStmt);
16726 utf8_printf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
16727 import_cleanup(&sCtx);
16728 rc = 1;
16729 goto meta_command_exit;
16730 }
16731 nCol = sqlite3_column_count(pStmt);
16732 sqlite3_finalize(pStmt);
16733 pStmt = 0;
16734 if( nCol==0 ) return 0; /* no columns, no error */
16735 zSql = sqlite3_malloc64( nByte*2 + 20 + nCol*2 );
16736 if( zSql==0 ){
16737 import_cleanup(&sCtx);
16738 shell_out_of_memory();
16739 }
16740 sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable);
16741 j = strlen30(zSql);
16742 for(i=1; i<nCol; i++){
@@ -16733,11 +16751,11 @@
16751 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
16752 sqlite3_free(zSql);
16753 if( rc ){
16754 utf8_printf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
16755 if (pStmt) sqlite3_finalize(pStmt);
16756 import_cleanup(&sCtx);
16757 rc = 1;
16758 goto meta_command_exit;
16759 }
16760 needCommit = sqlite3_get_autocommit(p->db);
16761 if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
@@ -16785,12 +16803,11 @@
16803 sCtx.nRow++;
16804 }
16805 }
16806 }while( sCtx.cTerm!=EOF );
16807
16808 import_cleanup(&sCtx);
 
16809 sqlite3_finalize(pStmt);
16810 if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
16811 if( eVerbose>0 ){
16812 utf8_printf(p->out,
16813 "Added %d rows with %d errors using %d lines of input\n",
16814
+38 -12
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
11651165
#define SQLITE_VERSION "3.33.0"
11661166
#define SQLITE_VERSION_NUMBER 3033000
1167
-#define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
1167
+#define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -30932,13 +30932,13 @@
3093230932
pMem->n = (int)(z - zOut);
3093330933
}
3093430934
*z = 0;
3093530935
assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
3093630936
30937
- c = pMem->flags;
30937
+ c = MEM_Str|MEM_Term|(pMem->flags&(MEM_AffMask|MEM_Subtype));
3093830938
sqlite3VdbeMemRelease(pMem);
30939
- pMem->flags = MEM_Str|MEM_Term|(c&(MEM_AffMask|MEM_Subtype));
30939
+ pMem->flags = c;
3094030940
pMem->enc = desiredEnc;
3094130941
pMem->z = (char*)zOut;
3094230942
pMem->zMalloc = pMem->z;
3094330943
pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->z);
3094430944
@@ -85827,10 +85827,12 @@
8582785827
/* This happens if a malloc() inside a call to sqlite3_column_text() or
8582885828
** sqlite3_column_text16() failed. */
8582985829
goto no_mem;
8583085830
}
8583185831
assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY );
85832
+ testcase( p->rc!=SQLITE_OK );
85833
+ p->rc = SQLITE_OK;
8583285834
assert( p->bIsReader || p->readOnly!=0 );
8583385835
p->iCurrentTime = 0;
8583485836
assert( p->explain==0 );
8583585837
p->pResultSet = 0;
8583685838
db->busyHandler.nBusy = 0;
@@ -93140,13 +93142,11 @@
9314093142
/* Jump to here if the sqlite3_interrupt() API sets the interrupt
9314193143
** flag.
9314293144
*/
9314393145
abort_due_to_interrupt:
9314493146
assert( AtomicLoad(&db->u1.isInterrupted) );
93145
- rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT;
93146
- p->rc = rc;
93147
- sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc));
93147
+ rc = SQLITE_INTERRUPT;
9314893148
goto abort_due_to_error;
9314993149
}
9315093150
9315193151
9315293152
/************** End of vdbe.c ************************************************/
@@ -108185,10 +108185,34 @@
108185108185
assert( regOut!=regStat && regOut!=regStat+1 );
108186108186
sqlite3VdbeAddFunctionCall(pParse, 0, regStat, regOut, 1+IsStat4,
108187108187
&statGetFuncdef, 0);
108188108188
}
108189108189
108190
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
108191
+/* Add a comment to the most recent VDBE opcode that is the name
108192
+** of the k-th column of the pIdx index.
108193
+*/
108194
+static void analyzeVdbeCommentIndexWithColumnName(
108195
+ Vdbe *v, /* Prepared statement under construction */
108196
+ Index *pIdx, /* Index whose column is being loaded */
108197
+ int k /* Which column index */
108198
+){
108199
+ int i; /* Index of column in the table */
108200
+ assert( k>=0 && k<pIdx->nColumn );
108201
+ i = pIdx->aiColumn[k];
108202
+ if( NEVER(i==XN_ROWID) ){
108203
+ VdbeComment((v,"%s.rowid",pIdx->zName));
108204
+ }else if( i==XN_EXPR ){
108205
+ VdbeComment((v,"%s.expr(%d)",pIdx->zName, k));
108206
+ }else{
108207
+ VdbeComment((v,"%s.%s", pIdx->zName, pIdx->pTable->aCol[i].zName));
108208
+ }
108209
+}
108210
+#else
108211
+# define analyzeVdbeCommentIndexWithColumnName(a,b,c)
108212
+#endif /* SQLITE_DEBUG */
108213
+
108190108214
/*
108191108215
** Generate code to do an analysis of all indices associated with
108192108216
** a single table.
108193108217
*/
108194108218
static void analyzeOneTable(
@@ -108401,11 +108425,11 @@
108401108425
}
108402108426
for(i=0; i<nColTest; i++){
108403108427
char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
108404108428
sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
108405108429
sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
108406
- VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108430
+ analyzeVdbeCommentIndexWithColumnName(v,pIdx,i);
108407108431
aGotoChng[i] =
108408108432
sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
108409108433
sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
108410108434
VdbeCoverage(v);
108411108435
}
@@ -108422,11 +108446,11 @@
108422108446
*/
108423108447
sqlite3VdbeJumpHere(v, addrNextRow-1);
108424108448
for(i=0; i<nColTest; i++){
108425108449
sqlite3VdbeJumpHere(v, aGotoChng[i]);
108426108450
sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
108427
- VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108451
+ analyzeVdbeCommentIndexWithColumnName(v,pIdx,i);
108428108452
}
108429108453
sqlite3VdbeResolveLabel(v, endDistinctTest);
108430108454
sqlite3DbFree(db, aGotoChng);
108431108455
}
108432108456
@@ -108448,11 +108472,11 @@
108448108472
regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
108449108473
for(j=0; j<pPk->nKeyCol; j++){
108450108474
k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
108451108475
assert( k>=0 && k<pIdx->nColumn );
108452108476
sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
108453
- VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108477
+ analyzeVdbeCommentIndexWithColumnName(v,pIdx,k);
108454108478
}
108455108479
sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
108456108480
sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
108457108481
}
108458108482
}
@@ -147867,10 +147891,11 @@
147867147891
pNew->rSetup = 0;
147868147892
pNew->prereq = mPrereq;
147869147893
pNew->nOut = rSize;
147870147894
pNew->u.btree.pIndex = pProbe;
147871147895
b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);
147896
+
147872147897
/* The ONEPASS_DESIRED flags never occurs together with ORDER BY */
147873147898
assert( (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || b==0 );
147874147899
if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
147875147900
/* Integer primary key index */
147876147901
pNew->wsFlags = WHERE_IPK;
@@ -147896,10 +147921,11 @@
147896147921
147897147922
/* Full scan via index */
147898147923
if( b
147899147924
|| !HasRowid(pTab)
147900147925
|| pProbe->pPartIdxWhere!=0
147926
+ || pSrc->fg.isIndexedBy
147901147927
|| ( m==0
147902147928
&& pProbe->bUnordered==0
147903147929
&& (pProbe->szIdxRow<pTab->szTabRow)
147904147930
&& (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0
147905147931
&& sqlite3GlobalConfig.bUseCis
@@ -224840,11 +224866,11 @@
224840224866
int nArg, /* Number of args */
224841224867
sqlite3_value **apUnused /* Function arguments */
224842224868
){
224843224869
assert( nArg==0 );
224844224870
UNUSED_PARAM2(nArg, apUnused);
224845
- sqlite3_result_text(pCtx, "fts5: 2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82", -1, SQLITE_TRANSIENT);
224871
+ sqlite3_result_text(pCtx, "fts5: 2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6", -1, SQLITE_TRANSIENT);
224846224872
}
224847224873
224848224874
/*
224849224875
** Return true if zName is the extension on one of the shadow tables used
224850224876
** by this module.
@@ -229623,12 +229649,12 @@
229623229649
}
229624229650
#endif /* SQLITE_CORE */
229625229651
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229626229652
229627229653
/************** End of stmt.c ************************************************/
229628
-#if __LINE__!=229628
229654
+#if __LINE__!=229654
229629229655
#undef SQLITE_SOURCE_ID
229630
-#define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9falt2"
229656
+#define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80dalt2"
229631229657
#endif
229632229658
/* Return the source-id for this library */
229633229659
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229634229660
/************************** End of sqlite3.c ******************************/
229635229661
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -30932,13 +30932,13 @@
30932 pMem->n = (int)(z - zOut);
30933 }
30934 *z = 0;
30935 assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
30936
30937 c = pMem->flags;
30938 sqlite3VdbeMemRelease(pMem);
30939 pMem->flags = MEM_Str|MEM_Term|(c&(MEM_AffMask|MEM_Subtype));
30940 pMem->enc = desiredEnc;
30941 pMem->z = (char*)zOut;
30942 pMem->zMalloc = pMem->z;
30943 pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->z);
30944
@@ -85827,10 +85827,12 @@
85827 /* This happens if a malloc() inside a call to sqlite3_column_text() or
85828 ** sqlite3_column_text16() failed. */
85829 goto no_mem;
85830 }
85831 assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY );
 
 
85832 assert( p->bIsReader || p->readOnly!=0 );
85833 p->iCurrentTime = 0;
85834 assert( p->explain==0 );
85835 p->pResultSet = 0;
85836 db->busyHandler.nBusy = 0;
@@ -93140,13 +93142,11 @@
93140 /* Jump to here if the sqlite3_interrupt() API sets the interrupt
93141 ** flag.
93142 */
93143 abort_due_to_interrupt:
93144 assert( AtomicLoad(&db->u1.isInterrupted) );
93145 rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT;
93146 p->rc = rc;
93147 sqlite3VdbeError(p, "%s", sqlite3ErrStr(rc));
93148 goto abort_due_to_error;
93149 }
93150
93151
93152 /************** End of vdbe.c ************************************************/
@@ -108185,10 +108185,34 @@
108185 assert( regOut!=regStat && regOut!=regStat+1 );
108186 sqlite3VdbeAddFunctionCall(pParse, 0, regStat, regOut, 1+IsStat4,
108187 &statGetFuncdef, 0);
108188 }
108189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108190 /*
108191 ** Generate code to do an analysis of all indices associated with
108192 ** a single table.
108193 */
108194 static void analyzeOneTable(
@@ -108401,11 +108425,11 @@
108401 }
108402 for(i=0; i<nColTest; i++){
108403 char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
108404 sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
108405 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
108406 VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108407 aGotoChng[i] =
108408 sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
108409 sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
108410 VdbeCoverage(v);
108411 }
@@ -108422,11 +108446,11 @@
108422 */
108423 sqlite3VdbeJumpHere(v, addrNextRow-1);
108424 for(i=0; i<nColTest; i++){
108425 sqlite3VdbeJumpHere(v, aGotoChng[i]);
108426 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
108427 VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108428 }
108429 sqlite3VdbeResolveLabel(v, endDistinctTest);
108430 sqlite3DbFree(db, aGotoChng);
108431 }
108432
@@ -108448,11 +108472,11 @@
108448 regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
108449 for(j=0; j<pPk->nKeyCol; j++){
108450 k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
108451 assert( k>=0 && k<pIdx->nColumn );
108452 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
108453 VdbeComment((v, "%s.column(%d)", pIdx->zName, i));
108454 }
108455 sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
108456 sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
108457 }
108458 }
@@ -147867,10 +147891,11 @@
147867 pNew->rSetup = 0;
147868 pNew->prereq = mPrereq;
147869 pNew->nOut = rSize;
147870 pNew->u.btree.pIndex = pProbe;
147871 b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);
 
147872 /* The ONEPASS_DESIRED flags never occurs together with ORDER BY */
147873 assert( (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || b==0 );
147874 if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
147875 /* Integer primary key index */
147876 pNew->wsFlags = WHERE_IPK;
@@ -147896,10 +147921,11 @@
147896
147897 /* Full scan via index */
147898 if( b
147899 || !HasRowid(pTab)
147900 || pProbe->pPartIdxWhere!=0
 
147901 || ( m==0
147902 && pProbe->bUnordered==0
147903 && (pProbe->szIdxRow<pTab->szTabRow)
147904 && (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0
147905 && sqlite3GlobalConfig.bUseCis
@@ -224840,11 +224866,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.
@@ -229623,12 +229649,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
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -30932,13 +30932,13 @@
30932 pMem->n = (int)(z - zOut);
30933 }
30934 *z = 0;
30935 assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
30936
30937 c = MEM_Str|MEM_Term|(pMem->flags&(MEM_AffMask|MEM_Subtype));
30938 sqlite3VdbeMemRelease(pMem);
30939 pMem->flags = c;
30940 pMem->enc = desiredEnc;
30941 pMem->z = (char*)zOut;
30942 pMem->zMalloc = pMem->z;
30943 pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->z);
30944
@@ -85827,10 +85827,12 @@
85827 /* This happens if a malloc() inside a call to sqlite3_column_text() or
85828 ** sqlite3_column_text16() failed. */
85829 goto no_mem;
85830 }
85831 assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY );
85832 testcase( p->rc!=SQLITE_OK );
85833 p->rc = SQLITE_OK;
85834 assert( p->bIsReader || p->readOnly!=0 );
85835 p->iCurrentTime = 0;
85836 assert( p->explain==0 );
85837 p->pResultSet = 0;
85838 db->busyHandler.nBusy = 0;
@@ -93140,13 +93142,11 @@
93142 /* Jump to here if the sqlite3_interrupt() API sets the interrupt
93143 ** flag.
93144 */
93145 abort_due_to_interrupt:
93146 assert( AtomicLoad(&db->u1.isInterrupted) );
93147 rc = SQLITE_INTERRUPT;
 
 
93148 goto abort_due_to_error;
93149 }
93150
93151
93152 /************** End of vdbe.c ************************************************/
@@ -108185,10 +108185,34 @@
108185 assert( regOut!=regStat && regOut!=regStat+1 );
108186 sqlite3VdbeAddFunctionCall(pParse, 0, regStat, regOut, 1+IsStat4,
108187 &statGetFuncdef, 0);
108188 }
108189
108190 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
108191 /* Add a comment to the most recent VDBE opcode that is the name
108192 ** of the k-th column of the pIdx index.
108193 */
108194 static void analyzeVdbeCommentIndexWithColumnName(
108195 Vdbe *v, /* Prepared statement under construction */
108196 Index *pIdx, /* Index whose column is being loaded */
108197 int k /* Which column index */
108198 ){
108199 int i; /* Index of column in the table */
108200 assert( k>=0 && k<pIdx->nColumn );
108201 i = pIdx->aiColumn[k];
108202 if( NEVER(i==XN_ROWID) ){
108203 VdbeComment((v,"%s.rowid",pIdx->zName));
108204 }else if( i==XN_EXPR ){
108205 VdbeComment((v,"%s.expr(%d)",pIdx->zName, k));
108206 }else{
108207 VdbeComment((v,"%s.%s", pIdx->zName, pIdx->pTable->aCol[i].zName));
108208 }
108209 }
108210 #else
108211 # define analyzeVdbeCommentIndexWithColumnName(a,b,c)
108212 #endif /* SQLITE_DEBUG */
108213
108214 /*
108215 ** Generate code to do an analysis of all indices associated with
108216 ** a single table.
108217 */
108218 static void analyzeOneTable(
@@ -108401,11 +108425,11 @@
108425 }
108426 for(i=0; i<nColTest; i++){
108427 char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
108428 sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
108429 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
108430 analyzeVdbeCommentIndexWithColumnName(v,pIdx,i);
108431 aGotoChng[i] =
108432 sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
108433 sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
108434 VdbeCoverage(v);
108435 }
@@ -108422,11 +108446,11 @@
108446 */
108447 sqlite3VdbeJumpHere(v, addrNextRow-1);
108448 for(i=0; i<nColTest; i++){
108449 sqlite3VdbeJumpHere(v, aGotoChng[i]);
108450 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
108451 analyzeVdbeCommentIndexWithColumnName(v,pIdx,i);
108452 }
108453 sqlite3VdbeResolveLabel(v, endDistinctTest);
108454 sqlite3DbFree(db, aGotoChng);
108455 }
108456
@@ -108448,11 +108472,11 @@
108472 regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
108473 for(j=0; j<pPk->nKeyCol; j++){
108474 k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
108475 assert( k>=0 && k<pIdx->nColumn );
108476 sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
108477 analyzeVdbeCommentIndexWithColumnName(v,pIdx,k);
108478 }
108479 sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
108480 sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
108481 }
108482 }
@@ -147867,10 +147891,11 @@
147891 pNew->rSetup = 0;
147892 pNew->prereq = mPrereq;
147893 pNew->nOut = rSize;
147894 pNew->u.btree.pIndex = pProbe;
147895 b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);
147896
147897 /* The ONEPASS_DESIRED flags never occurs together with ORDER BY */
147898 assert( (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || b==0 );
147899 if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
147900 /* Integer primary key index */
147901 pNew->wsFlags = WHERE_IPK;
@@ -147896,10 +147921,11 @@
147921
147922 /* Full scan via index */
147923 if( b
147924 || !HasRowid(pTab)
147925 || pProbe->pPartIdxWhere!=0
147926 || pSrc->fg.isIndexedBy
147927 || ( m==0
147928 && pProbe->bUnordered==0
147929 && (pProbe->szIdxRow<pTab->szTabRow)
147930 && (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0
147931 && sqlite3GlobalConfig.bUseCis
@@ -224840,11 +224866,11 @@
224866 int nArg, /* Number of args */
224867 sqlite3_value **apUnused /* Function arguments */
224868 ){
224869 assert( nArg==0 );
224870 UNUSED_PARAM2(nArg, apUnused);
224871 sqlite3_result_text(pCtx, "fts5: 2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6", -1, SQLITE_TRANSIENT);
224872 }
224873
224874 /*
224875 ** Return true if zName is the extension on one of the shadow tables used
224876 ** by this module.
@@ -229623,12 +229649,12 @@
229649 }
229650 #endif /* SQLITE_CORE */
229651 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
229652
229653 /************** End of stmt.c ************************************************/
229654 #if __LINE__!=229654
229655 #undef SQLITE_SOURCE_ID
229656 #define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80dalt2"
229657 #endif
229658 /* Return the source-id for this library */
229659 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
229660 /************************** End of sqlite3.c ******************************/
229661
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.33.0"
127127
#define SQLITE_VERSION_NUMBER 3033000
128
-#define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
128
+#define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-05-29 16:15:58 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-06-04 02:50:47 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134

Keyboard Shortcuts

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