Fossil SCM

Update the built-in SQLite to the latest 3.44.0 alpha yet again. This time, also remember to include the "shell.c" source file from SQLite that includes the removal of an "sprintf()" call, thereby avoiding scary MacOS warnings.

drh 2023-10-23 10:21 trunk
Commit 6ac015311e2c1b3d644724836ab59acaf2a09a32dd27b42d578ea1ef56d306fe
+41 -27
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -468,21 +468,15 @@
468468
static int stdin_is_interactive = 1;
469469
470470
#if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \
471471
&& !defined(SHELL_OMIT_WIN_UTF8)
472472
# define SHELL_WIN_UTF8_OPT 1
473
+ static int console_utf8 = sizeof(char*)/4 - 1;
473474
#else
474475
# define SHELL_WIN_UTF8_OPT 0
475476
#endif
476477
477
-#if SHELL_WIN_UTF8_OPT
478
-/*
479
-** Setup console for UTF-8 input/output when following variable true.
480
-*/
481
-static int console_utf8 = 0;
482
-#endif
483
-
484478
/*
485479
** On Windows systems we have to know if standard output is a console
486480
** in order to translate UTF-8 into MBCS. The following variable is
487481
** true if translation is required.
488482
*/
@@ -750,15 +744,11 @@
750744
*/
751745
#if defined(_WIN32) || defined(WIN32)
752746
void utf8_printf(FILE *out, const char *zFormat, ...){
753747
va_list ap;
754748
va_start(ap, zFormat);
755
- if( stdout_is_console && (out==stdout || out==stderr)
756
-# if SHELL_WIN_UTF8_OPT
757
- && !console_utf8
758
-# endif
759
- ){
749
+ if( stdout_is_console && (out==stdout || out==stderr) && !console_utf8 ){
760750
char *z1 = sqlite3_vmprintf(zFormat, ap);
761751
char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0);
762752
sqlite3_free(z1);
763753
fputs(z2, out);
764754
sqlite3_free(z2);
@@ -968,15 +958,11 @@
968958
}
969959
#if defined(_WIN32) || defined(WIN32)
970960
/* For interactive input on Windows systems, without -utf8,
971961
** translate the multi-byte characterset characters into UTF-8.
972962
** This is the translation that predates the -utf8 option. */
973
- if( stdin_is_interactive && in==stdin
974
-# if SHELL_WIN_UTF8_OPT
975
- && !console_utf8
976
-# endif /* SHELL_WIN_UTF8_OPT */
977
- ){
963
+ if( stdin_is_interactive && in==stdin && !console_utf8 ){
978964
char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0);
979965
if( zTrans ){
980966
i64 nTrans = strlen(zTrans)+1;
981967
if( nTrans>nLine ){
982968
zLine = realloc(zLine, nTrans);
@@ -1258,11 +1244,11 @@
12581244
double r = sqlite3_value_double(apVal[0]);
12591245
int n = nVal>=2 ? sqlite3_value_int(apVal[1]) : 26;
12601246
char z[400];
12611247
if( n<1 ) n = 1;
12621248
if( n>350 ) n = 350;
1263
- sprintf(z, "%#+.*e", n, r);
1249
+ snprintf(z, sizeof(z)-1, "%#+.*e", n, r);
12641250
sqlite3_result_text(pCtx, z, -1, SQLITE_TRANSIENT);
12651251
}
12661252
12671253
12681254
/*
@@ -5370,11 +5356,12 @@
53705356
0, /* xFindMethod */
53715357
0, /* xRename */
53725358
0, /* xSavepoint */
53735359
0, /* xRelease */
53745360
0, /* xRollbackTo */
5375
- 0 /* xShadowName */
5361
+ 0, /* xShadowName */
5362
+ 0 /* xIntegrity */
53765363
};
53775364
53785365
#endif /* SQLITE_OMIT_VIRTUALTABLE */
53795366
53805367
#ifdef _WIN32
@@ -7268,10 +7255,11 @@
72687255
0, /* xRename */
72697256
0, /* xSavepoint */
72707257
0, /* xRelease */
72717258
0, /* xRollbackTo */
72727259
0, /* xShadowName */
7260
+ 0 /* xIntegrity */
72737261
};
72747262
72757263
int rc = sqlite3_create_module(db, "fsdir", &fsdirModule, 0);
72767264
return rc;
72777265
}
@@ -7788,11 +7776,12 @@
77887776
0, /* xFindMethod */
77897777
0, /* xRename */
77907778
0, /* xSavepoint */
77917779
0, /* xRelease */
77927780
0, /* xRollbackTo */
7793
- 0 /* xShadowName */
7781
+ 0, /* xShadowName */
7782
+ 0 /* xIntegrity */
77947783
};
77957784
77967785
#endif /* SQLITE_OMIT_VIRTUALTABLE */
77977786
77987787
int sqlite3CompletionVtabInit(sqlite3 *db){
@@ -10699,11 +10688,12 @@
1069910688
zipfileFindFunction, /* xFindMethod */
1070010689
0, /* xRename */
1070110690
0, /* xSavepoint */
1070210691
0, /* xRelease */
1070310692
0, /* xRollback */
10704
- 0 /* xShadowName */
10693
+ 0, /* xShadowName */
10694
+ 0 /* xIntegrity */
1070510695
};
1070610696
1070710697
int rc = sqlite3_create_module(db, "zipfile" , &zipfileModule, 0);
1070810698
if( rc==SQLITE_OK ) rc = sqlite3_overload_function(db, "zipfile_cds", -1);
1070910699
if( rc==SQLITE_OK ){
@@ -11698,10 +11688,11 @@
1169811688
0, /* xRename - rename the table */
1169911689
0, /* xSavepoint */
1170011690
0, /* xRelease */
1170111691
0, /* xRollbackTo */
1170211692
0, /* xShadowName */
11693
+ 0, /* xIntegrity */
1170311694
};
1170411695
1170511696
return sqlite3_create_module(p->dbv, "expert", &expertModule, (void*)p);
1170611697
}
1170711698
/*
@@ -14280,11 +14271,12 @@
1428014271
0, /* xFindMethod */
1428114272
0, /* xRename */
1428214273
0, /* xSavepoint */
1428314274
0, /* xRelease */
1428414275
0, /* xRollbackTo */
14285
- 0 /* xShadowName */
14276
+ 0, /* xShadowName */
14277
+ 0 /* xIntegrity */
1428614278
};
1428714279
1428814280
int rc = sqlite3_create_module(db, "sqlite_dbdata", &dbdata_module, 0);
1428914281
if( rc==SQLITE_OK ){
1429014282
rc = sqlite3_create_module(db, "sqlite_dbptr", &dbdata_module, (void*)1);
@@ -23828,11 +23820,10 @@
2382823820
if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
2382923821
}else{
2383023822
azArg[nArg++] = &zLine[h];
2383123823
while( zLine[h] && !IsSpace(zLine[h]) ){ h++; }
2383223824
if( zLine[h] ) zLine[h++] = 0;
23833
- resolve_backslashes(azArg[nArg-1]);
2383423825
}
2383523826
}
2383623827
azArg[nArg] = 0;
2383723828
2383823829
/* Process the input line.
@@ -24567,12 +24558,14 @@
2456724558
sqlite3_stmt *pStmt;
2456824559
rc = sqlite3_prepare_v2(p->db,
2456924560
"SELECT rowid FROM sqlite_schema"
2457024561
" WHERE name GLOB 'sqlite_stat[134]'",
2457124562
-1, &pStmt, 0);
24572
- doStats = sqlite3_step(pStmt)==SQLITE_ROW;
24573
- sqlite3_finalize(pStmt);
24563
+ if( rc==SQLITE_OK ){
24564
+ doStats = sqlite3_step(pStmt)==SQLITE_ROW;
24565
+ sqlite3_finalize(pStmt);
24566
+ }
2457424567
}
2457524568
if( doStats==0 ){
2457624569
raw_printf(p->out, "/* No STAT tables available */\n");
2457724570
}else{
2457824571
raw_printf(p->out, "ANALYZE sqlite_schema;\n");
@@ -24857,10 +24850,18 @@
2485724850
** Did we reach end-of-file OR end-of-line before finding any
2485824851
** columns in ASCII mode? If so, stop instead of NULL filling
2485924852
** the remaining columns.
2486024853
*/
2486124854
if( p->mode==MODE_Ascii && (z==0 || z[0]==0) && i==0 ) break;
24855
+ /*
24856
+ ** For CSV mode, per RFC 4180, accept EOF in lieu of final
24857
+ ** record terminator but only for last field of multi-field row.
24858
+ ** (If there are too few fields, it's not valid CSV anyway.)
24859
+ */
24860
+ if( z==0 && (xRead==csv_read_one_field) && i==nCol-1 && i>0 ){
24861
+ z = "";
24862
+ }
2486224863
sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
2486324864
if( i<nCol-1 && sCtx.cTerm!=sCtx.cColSep ){
2486424865
utf8_printf(stderr, "%s:%d: expected %d columns but found %d - "
2486524866
"filling the rest with NULL\n",
2486624867
sCtx.zFile, startLine, nCol, i+1);
@@ -26696,10 +26697,11 @@
2669626697
/*{"benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS,1, "" },*/
2669726698
/*{"bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, 1, "" },*/
2669826699
{"byteorder", SQLITE_TESTCTRL_BYTEORDER, 0, "" },
2669926700
{"extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,0,"BOOLEAN" },
2670026701
/*{"fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, 1,"" },*/
26702
+ {"fk_no_action", SQLITE_TESTCTRL_FK_NO_ACTION, 0, "BOOLEAN" },
2670126703
{"imposter", SQLITE_TESTCTRL_IMPOSTER,1,"SCHEMA ON/OFF ROOTPAGE"},
2670226704
{"internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS,0,"" },
2670326705
{"localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN" },
2670426706
{"never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN" },
2670526707
{"optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK" },
@@ -26766,10 +26768,11 @@
2676626768
}else{
2676726769
switch(testctrl){
2676826770
2676926771
/* sqlite3_test_control(int, db, int) */
2677026772
case SQLITE_TESTCTRL_OPTIMIZATIONS:
26773
+ case SQLITE_TESTCTRL_FK_NO_ACTION:
2677126774
if( nArg==3 ){
2677226775
unsigned int opt = (unsigned int)strtol(azArg[2], 0, 0);
2677326776
rc2 = sqlite3_test_control(testctrl, p->db, opt);
2677426777
isOk = 3;
2677526778
}
@@ -27718,10 +27721,13 @@
2771827721
" -mmap N default mmap size set to N\n"
2771927722
#ifdef SQLITE_ENABLE_MULTIPLEX
2772027723
" -multiplex enable the multiplexor VFS\n"
2772127724
#endif
2772227725
" -newline SEP set output row separator. Default: '\\n'\n"
27726
+#if SHELL_WIN_UTF8_OPT
27727
+ " -no-utf8 do not try to set up UTF-8 output (for legacy)\n"
27728
+#endif
2772327729
" -nofollow refuse to open symbolic links to database files\n"
2772427730
" -nonce STRING set the safe-mode escape nonce\n"
2772527731
" -nullvalue TEXT set text string for NULL values. Default ''\n"
2772627732
" -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n"
2772727733
" -pcachetrace trace all page cache operations\n"
@@ -28284,10 +28290,14 @@
2828428290
}else if( cli_strcmp(z,"-batch")==0 ){
2828528291
stdin_is_interactive = 0;
2828628292
}else if( cli_strcmp(z,"-utf8")==0 ){
2828728293
#if SHELL_WIN_UTF8_OPT
2828828294
console_utf8 = 1;
28295
+#endif /* SHELL_WIN_UTF8_OPT */
28296
+ }else if( cli_strcmp(z,"-no-utf8")==0 ){
28297
+#if SHELL_WIN_UTF8_OPT
28298
+ console_utf8 = 0;
2828928299
#endif /* SHELL_WIN_UTF8_OPT */
2829028300
}else if( cli_strcmp(z,"-heap")==0 ){
2829128301
i++;
2829228302
}else if( cli_strcmp(z,"-pagecache")==0 ){
2829328303
i+=2;
@@ -28409,15 +28419,19 @@
2840928419
/* Run commands received from standard input
2841028420
*/
2841128421
if( stdin_is_interactive ){
2841228422
char *zHome;
2841328423
char *zHistory;
28424
+ const char *zCharset = "";
2841428425
int nHistory;
28426
+#if SHELL_WIN_UTF8_OPT
28427
+ if( console_utf8 ) zCharset = " (utf8)";
28428
+#endif
2841528429
printf(
28416
- "SQLite version %s %.19s\n" /*extra-version-info*/
28430
+ "SQLite version %s %.19s%s\n" /*extra-version-info*/
2841728431
"Enter \".help\" for usage hints.\n",
28418
- sqlite3_libversion(), sqlite3_sourceid()
28432
+ sqlite3_libversion(), sqlite3_sourceid(), zCharset
2841928433
);
2842028434
if( warnInmemoryDb ){
2842128435
printf("Connected to a ");
2842228436
printBold("transient in-memory database");
2842328437
printf(".\nUse \".open FILENAME\" to reopen on a "
2842428438
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -468,21 +468,15 @@
468 static int stdin_is_interactive = 1;
469
470 #if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \
471 && !defined(SHELL_OMIT_WIN_UTF8)
472 # define SHELL_WIN_UTF8_OPT 1
 
473 #else
474 # define SHELL_WIN_UTF8_OPT 0
475 #endif
476
477 #if SHELL_WIN_UTF8_OPT
478 /*
479 ** Setup console for UTF-8 input/output when following variable true.
480 */
481 static int console_utf8 = 0;
482 #endif
483
484 /*
485 ** On Windows systems we have to know if standard output is a console
486 ** in order to translate UTF-8 into MBCS. The following variable is
487 ** true if translation is required.
488 */
@@ -750,15 +744,11 @@
750 */
751 #if defined(_WIN32) || defined(WIN32)
752 void utf8_printf(FILE *out, const char *zFormat, ...){
753 va_list ap;
754 va_start(ap, zFormat);
755 if( stdout_is_console && (out==stdout || out==stderr)
756 # if SHELL_WIN_UTF8_OPT
757 && !console_utf8
758 # endif
759 ){
760 char *z1 = sqlite3_vmprintf(zFormat, ap);
761 char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0);
762 sqlite3_free(z1);
763 fputs(z2, out);
764 sqlite3_free(z2);
@@ -968,15 +958,11 @@
968 }
969 #if defined(_WIN32) || defined(WIN32)
970 /* For interactive input on Windows systems, without -utf8,
971 ** translate the multi-byte characterset characters into UTF-8.
972 ** This is the translation that predates the -utf8 option. */
973 if( stdin_is_interactive && in==stdin
974 # if SHELL_WIN_UTF8_OPT
975 && !console_utf8
976 # endif /* SHELL_WIN_UTF8_OPT */
977 ){
978 char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0);
979 if( zTrans ){
980 i64 nTrans = strlen(zTrans)+1;
981 if( nTrans>nLine ){
982 zLine = realloc(zLine, nTrans);
@@ -1258,11 +1244,11 @@
1258 double r = sqlite3_value_double(apVal[0]);
1259 int n = nVal>=2 ? sqlite3_value_int(apVal[1]) : 26;
1260 char z[400];
1261 if( n<1 ) n = 1;
1262 if( n>350 ) n = 350;
1263 sprintf(z, "%#+.*e", n, r);
1264 sqlite3_result_text(pCtx, z, -1, SQLITE_TRANSIENT);
1265 }
1266
1267
1268 /*
@@ -5370,11 +5356,12 @@
5370 0, /* xFindMethod */
5371 0, /* xRename */
5372 0, /* xSavepoint */
5373 0, /* xRelease */
5374 0, /* xRollbackTo */
5375 0 /* xShadowName */
 
5376 };
5377
5378 #endif /* SQLITE_OMIT_VIRTUALTABLE */
5379
5380 #ifdef _WIN32
@@ -7268,10 +7255,11 @@
7268 0, /* xRename */
7269 0, /* xSavepoint */
7270 0, /* xRelease */
7271 0, /* xRollbackTo */
7272 0, /* xShadowName */
 
7273 };
7274
7275 int rc = sqlite3_create_module(db, "fsdir", &fsdirModule, 0);
7276 return rc;
7277 }
@@ -7788,11 +7776,12 @@
7788 0, /* xFindMethod */
7789 0, /* xRename */
7790 0, /* xSavepoint */
7791 0, /* xRelease */
7792 0, /* xRollbackTo */
7793 0 /* xShadowName */
 
7794 };
7795
7796 #endif /* SQLITE_OMIT_VIRTUALTABLE */
7797
7798 int sqlite3CompletionVtabInit(sqlite3 *db){
@@ -10699,11 +10688,12 @@
10699 zipfileFindFunction, /* xFindMethod */
10700 0, /* xRename */
10701 0, /* xSavepoint */
10702 0, /* xRelease */
10703 0, /* xRollback */
10704 0 /* xShadowName */
 
10705 };
10706
10707 int rc = sqlite3_create_module(db, "zipfile" , &zipfileModule, 0);
10708 if( rc==SQLITE_OK ) rc = sqlite3_overload_function(db, "zipfile_cds", -1);
10709 if( rc==SQLITE_OK ){
@@ -11698,10 +11688,11 @@
11698 0, /* xRename - rename the table */
11699 0, /* xSavepoint */
11700 0, /* xRelease */
11701 0, /* xRollbackTo */
11702 0, /* xShadowName */
 
11703 };
11704
11705 return sqlite3_create_module(p->dbv, "expert", &expertModule, (void*)p);
11706 }
11707 /*
@@ -14280,11 +14271,12 @@
14280 0, /* xFindMethod */
14281 0, /* xRename */
14282 0, /* xSavepoint */
14283 0, /* xRelease */
14284 0, /* xRollbackTo */
14285 0 /* xShadowName */
 
14286 };
14287
14288 int rc = sqlite3_create_module(db, "sqlite_dbdata", &dbdata_module, 0);
14289 if( rc==SQLITE_OK ){
14290 rc = sqlite3_create_module(db, "sqlite_dbptr", &dbdata_module, (void*)1);
@@ -23828,11 +23820,10 @@
23828 if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
23829 }else{
23830 azArg[nArg++] = &zLine[h];
23831 while( zLine[h] && !IsSpace(zLine[h]) ){ h++; }
23832 if( zLine[h] ) zLine[h++] = 0;
23833 resolve_backslashes(azArg[nArg-1]);
23834 }
23835 }
23836 azArg[nArg] = 0;
23837
23838 /* Process the input line.
@@ -24567,12 +24558,14 @@
24567 sqlite3_stmt *pStmt;
24568 rc = sqlite3_prepare_v2(p->db,
24569 "SELECT rowid FROM sqlite_schema"
24570 " WHERE name GLOB 'sqlite_stat[134]'",
24571 -1, &pStmt, 0);
24572 doStats = sqlite3_step(pStmt)==SQLITE_ROW;
24573 sqlite3_finalize(pStmt);
 
 
24574 }
24575 if( doStats==0 ){
24576 raw_printf(p->out, "/* No STAT tables available */\n");
24577 }else{
24578 raw_printf(p->out, "ANALYZE sqlite_schema;\n");
@@ -24857,10 +24850,18 @@
24857 ** Did we reach end-of-file OR end-of-line before finding any
24858 ** columns in ASCII mode? If so, stop instead of NULL filling
24859 ** the remaining columns.
24860 */
24861 if( p->mode==MODE_Ascii && (z==0 || z[0]==0) && i==0 ) break;
 
 
 
 
 
 
 
 
24862 sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
24863 if( i<nCol-1 && sCtx.cTerm!=sCtx.cColSep ){
24864 utf8_printf(stderr, "%s:%d: expected %d columns but found %d - "
24865 "filling the rest with NULL\n",
24866 sCtx.zFile, startLine, nCol, i+1);
@@ -26696,10 +26697,11 @@
26696 /*{"benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS,1, "" },*/
26697 /*{"bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, 1, "" },*/
26698 {"byteorder", SQLITE_TESTCTRL_BYTEORDER, 0, "" },
26699 {"extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,0,"BOOLEAN" },
26700 /*{"fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, 1,"" },*/
 
26701 {"imposter", SQLITE_TESTCTRL_IMPOSTER,1,"SCHEMA ON/OFF ROOTPAGE"},
26702 {"internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS,0,"" },
26703 {"localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN" },
26704 {"never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN" },
26705 {"optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK" },
@@ -26766,10 +26768,11 @@
26766 }else{
26767 switch(testctrl){
26768
26769 /* sqlite3_test_control(int, db, int) */
26770 case SQLITE_TESTCTRL_OPTIMIZATIONS:
 
26771 if( nArg==3 ){
26772 unsigned int opt = (unsigned int)strtol(azArg[2], 0, 0);
26773 rc2 = sqlite3_test_control(testctrl, p->db, opt);
26774 isOk = 3;
26775 }
@@ -27718,10 +27721,13 @@
27718 " -mmap N default mmap size set to N\n"
27719 #ifdef SQLITE_ENABLE_MULTIPLEX
27720 " -multiplex enable the multiplexor VFS\n"
27721 #endif
27722 " -newline SEP set output row separator. Default: '\\n'\n"
 
 
 
27723 " -nofollow refuse to open symbolic links to database files\n"
27724 " -nonce STRING set the safe-mode escape nonce\n"
27725 " -nullvalue TEXT set text string for NULL values. Default ''\n"
27726 " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n"
27727 " -pcachetrace trace all page cache operations\n"
@@ -28284,10 +28290,14 @@
28284 }else if( cli_strcmp(z,"-batch")==0 ){
28285 stdin_is_interactive = 0;
28286 }else if( cli_strcmp(z,"-utf8")==0 ){
28287 #if SHELL_WIN_UTF8_OPT
28288 console_utf8 = 1;
 
 
 
 
28289 #endif /* SHELL_WIN_UTF8_OPT */
28290 }else if( cli_strcmp(z,"-heap")==0 ){
28291 i++;
28292 }else if( cli_strcmp(z,"-pagecache")==0 ){
28293 i+=2;
@@ -28409,15 +28419,19 @@
28409 /* Run commands received from standard input
28410 */
28411 if( stdin_is_interactive ){
28412 char *zHome;
28413 char *zHistory;
 
28414 int nHistory;
 
 
 
28415 printf(
28416 "SQLite version %s %.19s\n" /*extra-version-info*/
28417 "Enter \".help\" for usage hints.\n",
28418 sqlite3_libversion(), sqlite3_sourceid()
28419 );
28420 if( warnInmemoryDb ){
28421 printf("Connected to a ");
28422 printBold("transient in-memory database");
28423 printf(".\nUse \".open FILENAME\" to reopen on a "
28424
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -468,21 +468,15 @@
468 static int stdin_is_interactive = 1;
469
470 #if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \
471 && !defined(SHELL_OMIT_WIN_UTF8)
472 # define SHELL_WIN_UTF8_OPT 1
473 static int console_utf8 = sizeof(char*)/4 - 1;
474 #else
475 # define SHELL_WIN_UTF8_OPT 0
476 #endif
477
 
 
 
 
 
 
 
478 /*
479 ** On Windows systems we have to know if standard output is a console
480 ** in order to translate UTF-8 into MBCS. The following variable is
481 ** true if translation is required.
482 */
@@ -750,15 +744,11 @@
744 */
745 #if defined(_WIN32) || defined(WIN32)
746 void utf8_printf(FILE *out, const char *zFormat, ...){
747 va_list ap;
748 va_start(ap, zFormat);
749 if( stdout_is_console && (out==stdout || out==stderr) && !console_utf8 ){
 
 
 
 
750 char *z1 = sqlite3_vmprintf(zFormat, ap);
751 char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0);
752 sqlite3_free(z1);
753 fputs(z2, out);
754 sqlite3_free(z2);
@@ -968,15 +958,11 @@
958 }
959 #if defined(_WIN32) || defined(WIN32)
960 /* For interactive input on Windows systems, without -utf8,
961 ** translate the multi-byte characterset characters into UTF-8.
962 ** This is the translation that predates the -utf8 option. */
963 if( stdin_is_interactive && in==stdin && !console_utf8 ){
 
 
 
 
964 char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0);
965 if( zTrans ){
966 i64 nTrans = strlen(zTrans)+1;
967 if( nTrans>nLine ){
968 zLine = realloc(zLine, nTrans);
@@ -1258,11 +1244,11 @@
1244 double r = sqlite3_value_double(apVal[0]);
1245 int n = nVal>=2 ? sqlite3_value_int(apVal[1]) : 26;
1246 char z[400];
1247 if( n<1 ) n = 1;
1248 if( n>350 ) n = 350;
1249 snprintf(z, sizeof(z)-1, "%#+.*e", n, r);
1250 sqlite3_result_text(pCtx, z, -1, SQLITE_TRANSIENT);
1251 }
1252
1253
1254 /*
@@ -5370,11 +5356,12 @@
5356 0, /* xFindMethod */
5357 0, /* xRename */
5358 0, /* xSavepoint */
5359 0, /* xRelease */
5360 0, /* xRollbackTo */
5361 0, /* xShadowName */
5362 0 /* xIntegrity */
5363 };
5364
5365 #endif /* SQLITE_OMIT_VIRTUALTABLE */
5366
5367 #ifdef _WIN32
@@ -7268,10 +7255,11 @@
7255 0, /* xRename */
7256 0, /* xSavepoint */
7257 0, /* xRelease */
7258 0, /* xRollbackTo */
7259 0, /* xShadowName */
7260 0 /* xIntegrity */
7261 };
7262
7263 int rc = sqlite3_create_module(db, "fsdir", &fsdirModule, 0);
7264 return rc;
7265 }
@@ -7788,11 +7776,12 @@
7776 0, /* xFindMethod */
7777 0, /* xRename */
7778 0, /* xSavepoint */
7779 0, /* xRelease */
7780 0, /* xRollbackTo */
7781 0, /* xShadowName */
7782 0 /* xIntegrity */
7783 };
7784
7785 #endif /* SQLITE_OMIT_VIRTUALTABLE */
7786
7787 int sqlite3CompletionVtabInit(sqlite3 *db){
@@ -10699,11 +10688,12 @@
10688 zipfileFindFunction, /* xFindMethod */
10689 0, /* xRename */
10690 0, /* xSavepoint */
10691 0, /* xRelease */
10692 0, /* xRollback */
10693 0, /* xShadowName */
10694 0 /* xIntegrity */
10695 };
10696
10697 int rc = sqlite3_create_module(db, "zipfile" , &zipfileModule, 0);
10698 if( rc==SQLITE_OK ) rc = sqlite3_overload_function(db, "zipfile_cds", -1);
10699 if( rc==SQLITE_OK ){
@@ -11698,10 +11688,11 @@
11688 0, /* xRename - rename the table */
11689 0, /* xSavepoint */
11690 0, /* xRelease */
11691 0, /* xRollbackTo */
11692 0, /* xShadowName */
11693 0, /* xIntegrity */
11694 };
11695
11696 return sqlite3_create_module(p->dbv, "expert", &expertModule, (void*)p);
11697 }
11698 /*
@@ -14280,11 +14271,12 @@
14271 0, /* xFindMethod */
14272 0, /* xRename */
14273 0, /* xSavepoint */
14274 0, /* xRelease */
14275 0, /* xRollbackTo */
14276 0, /* xShadowName */
14277 0 /* xIntegrity */
14278 };
14279
14280 int rc = sqlite3_create_module(db, "sqlite_dbdata", &dbdata_module, 0);
14281 if( rc==SQLITE_OK ){
14282 rc = sqlite3_create_module(db, "sqlite_dbptr", &dbdata_module, (void*)1);
@@ -23828,11 +23820,10 @@
23820 if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
23821 }else{
23822 azArg[nArg++] = &zLine[h];
23823 while( zLine[h] && !IsSpace(zLine[h]) ){ h++; }
23824 if( zLine[h] ) zLine[h++] = 0;
 
23825 }
23826 }
23827 azArg[nArg] = 0;
23828
23829 /* Process the input line.
@@ -24567,12 +24558,14 @@
24558 sqlite3_stmt *pStmt;
24559 rc = sqlite3_prepare_v2(p->db,
24560 "SELECT rowid FROM sqlite_schema"
24561 " WHERE name GLOB 'sqlite_stat[134]'",
24562 -1, &pStmt, 0);
24563 if( rc==SQLITE_OK ){
24564 doStats = sqlite3_step(pStmt)==SQLITE_ROW;
24565 sqlite3_finalize(pStmt);
24566 }
24567 }
24568 if( doStats==0 ){
24569 raw_printf(p->out, "/* No STAT tables available */\n");
24570 }else{
24571 raw_printf(p->out, "ANALYZE sqlite_schema;\n");
@@ -24857,10 +24850,18 @@
24850 ** Did we reach end-of-file OR end-of-line before finding any
24851 ** columns in ASCII mode? If so, stop instead of NULL filling
24852 ** the remaining columns.
24853 */
24854 if( p->mode==MODE_Ascii && (z==0 || z[0]==0) && i==0 ) break;
24855 /*
24856 ** For CSV mode, per RFC 4180, accept EOF in lieu of final
24857 ** record terminator but only for last field of multi-field row.
24858 ** (If there are too few fields, it's not valid CSV anyway.)
24859 */
24860 if( z==0 && (xRead==csv_read_one_field) && i==nCol-1 && i>0 ){
24861 z = "";
24862 }
24863 sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
24864 if( i<nCol-1 && sCtx.cTerm!=sCtx.cColSep ){
24865 utf8_printf(stderr, "%s:%d: expected %d columns but found %d - "
24866 "filling the rest with NULL\n",
24867 sCtx.zFile, startLine, nCol, i+1);
@@ -26696,10 +26697,11 @@
26697 /*{"benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS,1, "" },*/
26698 /*{"bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, 1, "" },*/
26699 {"byteorder", SQLITE_TESTCTRL_BYTEORDER, 0, "" },
26700 {"extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,0,"BOOLEAN" },
26701 /*{"fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, 1,"" },*/
26702 {"fk_no_action", SQLITE_TESTCTRL_FK_NO_ACTION, 0, "BOOLEAN" },
26703 {"imposter", SQLITE_TESTCTRL_IMPOSTER,1,"SCHEMA ON/OFF ROOTPAGE"},
26704 {"internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS,0,"" },
26705 {"localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,0,"BOOLEAN" },
26706 {"never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT,1, "BOOLEAN" },
26707 {"optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS,0,"DISABLE-MASK" },
@@ -26766,10 +26768,11 @@
26768 }else{
26769 switch(testctrl){
26770
26771 /* sqlite3_test_control(int, db, int) */
26772 case SQLITE_TESTCTRL_OPTIMIZATIONS:
26773 case SQLITE_TESTCTRL_FK_NO_ACTION:
26774 if( nArg==3 ){
26775 unsigned int opt = (unsigned int)strtol(azArg[2], 0, 0);
26776 rc2 = sqlite3_test_control(testctrl, p->db, opt);
26777 isOk = 3;
26778 }
@@ -27718,10 +27721,13 @@
27721 " -mmap N default mmap size set to N\n"
27722 #ifdef SQLITE_ENABLE_MULTIPLEX
27723 " -multiplex enable the multiplexor VFS\n"
27724 #endif
27725 " -newline SEP set output row separator. Default: '\\n'\n"
27726 #if SHELL_WIN_UTF8_OPT
27727 " -no-utf8 do not try to set up UTF-8 output (for legacy)\n"
27728 #endif
27729 " -nofollow refuse to open symbolic links to database files\n"
27730 " -nonce STRING set the safe-mode escape nonce\n"
27731 " -nullvalue TEXT set text string for NULL values. Default ''\n"
27732 " -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n"
27733 " -pcachetrace trace all page cache operations\n"
@@ -28284,10 +28290,14 @@
28290 }else if( cli_strcmp(z,"-batch")==0 ){
28291 stdin_is_interactive = 0;
28292 }else if( cli_strcmp(z,"-utf8")==0 ){
28293 #if SHELL_WIN_UTF8_OPT
28294 console_utf8 = 1;
28295 #endif /* SHELL_WIN_UTF8_OPT */
28296 }else if( cli_strcmp(z,"-no-utf8")==0 ){
28297 #if SHELL_WIN_UTF8_OPT
28298 console_utf8 = 0;
28299 #endif /* SHELL_WIN_UTF8_OPT */
28300 }else if( cli_strcmp(z,"-heap")==0 ){
28301 i++;
28302 }else if( cli_strcmp(z,"-pagecache")==0 ){
28303 i+=2;
@@ -28409,15 +28419,19 @@
28419 /* Run commands received from standard input
28420 */
28421 if( stdin_is_interactive ){
28422 char *zHome;
28423 char *zHistory;
28424 const char *zCharset = "";
28425 int nHistory;
28426 #if SHELL_WIN_UTF8_OPT
28427 if( console_utf8 ) zCharset = " (utf8)";
28428 #endif
28429 printf(
28430 "SQLite version %s %.19s%s\n" /*extra-version-info*/
28431 "Enter \".help\" for usage hints.\n",
28432 sqlite3_libversion(), sqlite3_sourceid(), zCharset
28433 );
28434 if( warnInmemoryDb ){
28435 printf("Connected to a ");
28436 printBold("transient in-memory database");
28437 printf(".\nUse \".open FILENAME\" to reopen on a "
28438
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
2020
** The content in this amalgamation comes from Fossil check-in
21
-** 78a9728dc6b88d8ef924c86603056df1820.
21
+** db82b4281a0e0d5e365553df11e0347f60c.
2222
*/
2323
#define SQLITE_CORE 1
2424
#define SQLITE_AMALGAMATION 1
2525
#ifndef SQLITE_PRIVATE
2626
# define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459459
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460460
** [sqlite_version()] and [sqlite_source_id()].
461461
*/
462462
#define SQLITE_VERSION "3.44.0"
463463
#define SQLITE_VERSION_NUMBER 3044000
464
-#define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
464
+#define SQLITE_SOURCE_ID "2023-10-23 02:01:14 0db82b4281a0e0d5e365553df11e0347f60c00c861c0fb96227059edff3a0ef6"
465465
466466
/*
467467
** CAPI3REF: Run-Time Library Version Numbers
468468
** KEYWORDS: sqlite3_version sqlite3_sourceid
469469
**
470470
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** 78a9728dc6b88d8ef924c86603056df1820.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.44.0"
463 #define SQLITE_VERSION_NUMBER 3044000
464 #define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
470
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** db82b4281a0e0d5e365553df11e0347f60c.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.44.0"
463 #define SQLITE_VERSION_NUMBER 3044000
464 #define SQLITE_SOURCE_ID "2023-10-23 02:01:14 0db82b4281a0e0d5e365553df11e0347f60c00c861c0fb96227059edff3a0ef6"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
470
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.44.0"
150150
#define SQLITE_VERSION_NUMBER 3044000
151
-#define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
151
+#define SQLITE_SOURCE_ID "2023-10-23 02:01:14 0db82b4281a0e0d5e365553df11e0347f60c00c861c0fb96227059edff3a0ef6"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.44.0"
150 #define SQLITE_VERSION_NUMBER 3044000
151 #define SQLITE_SOURCE_ID "2023-10-22 23:44:32 678a9728dc6b88d8ef924c86603056df18204bc9a9c4776b9baffd7c5b10c5f2"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.44.0"
150 #define SQLITE_VERSION_NUMBER 3044000
151 #define SQLITE_SOURCE_ID "2023-10-23 02:01:14 0db82b4281a0e0d5e365553df11e0347f60c00c861c0fb96227059edff3a0ef6"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157

Keyboard Shortcuts

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