Fossil SCM

Update the built-in SQLite to the latest trunk version for beta testing of SQLite.

drh 2026-05-04 10:25 UTC trunk
Commit c93e1c8721e9c62c42f3030568ae9575d4978672ac2a1c8e3d99eb04abee18f0
+143 -51
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -22123,23 +22123,44 @@
2212322123
int rc = sqlite3_finalize(pStmt);
2212422124
if( rc!=SQLITE_OK && p->errCode==SQLITE_OK ){
2212522125
recoverDbError(p, db);
2212622126
}
2212722127
}
22128
+
22129
+/*
22130
+** Run a single SQL statement in zSql. If zSql contains two or more
22131
+** SQL statements separated by ';', only the first is run.
22132
+**
22133
+** Return the sqlite3_finalizer() or sqlite3_prepare() result code
22134
+** from running the zSql statement.
22135
+*/
22136
+static int recoverOneStmt(sqlite3 *db, const char *zSql){
22137
+ sqlite3_stmt *pStmt = 0;
22138
+ int rc;
22139
+ if( zSql==0 ) return SQLITE_OK;
22140
+ rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
22141
+ if( rc ){
22142
+ sqlite3_finalize(pStmt);
22143
+ return rc;
22144
+ }
22145
+ while( SQLITE_ROW==sqlite3_step(pStmt) ){}
22146
+ return sqlite3_finalize(pStmt);
22147
+}
2212822148
2212922149
/*
2213022150
** This function is a no-op if recover handle p already contains an error
2213122151
** (if p->errCode!=SQLITE_OK). A copy of p->errCode is returned in this
2213222152
** case.
2213322153
**
22134
-** Otherwise, execute SQL script zSql. If successful, return SQLITE_OK.
22135
-** Or, if an error occurs, leave an error code and message in the recover
22136
-** handle and return a copy of the error code.
22154
+** Otherwise, execute a single SQL statment in zSql. Even if zSql contains
22155
+** two or more SQL statements separated by ';', only execute the first one.
22156
+** If successful, return SQLITE_OK. Or, if an error occurs, leave an error
22157
+** code and message in the recover handle and return a copy of the error code.
2213722158
*/
2213822159
static int recoverExec(sqlite3_recover *p, sqlite3 *db, const char *zSql){
2213922160
if( p->errCode==SQLITE_OK ){
22140
- int rc = sqlite3_exec(db, zSql, 0, 0, 0);
22161
+ int rc = recoverOneStmt(db, zSql);
2214122162
if( rc ){
2214222163
recoverDbError(p, db);
2214322164
}
2214422165
}
2214522166
return p->errCode;
@@ -22535,11 +22556,12 @@
2253522556
recoverError(p, SQLITE_NOMEM, 0);
2253622557
}
2253722558
}
2253822559
recoverFinalize(p, p1);
2253922560
}
22540
- recoverExec(p, db2, "CREATE TABLE t1(a); DROP TABLE t1;");
22561
+ recoverExec(p, db2, "CREATE TABLE t1(a)");
22562
+ recoverExec(p, db2, "DROP TABLE t1");
2254122563
2254222564
if( p->errCode==SQLITE_OK ){
2254322565
sqlite3 *db = p->dbOut;
2254422566
sqlite3_backup *pBackup = sqlite3_backup_init(db, "main", db2, "main");
2254522567
if( pBackup ){
@@ -22617,16 +22639,16 @@
2261722639
** discarded.
2261822640
*/
2261922641
static void recoverOpenRecovery(sqlite3_recover *p){
2262022642
char *zSql = recoverMPrintf(p, "ATTACH %Q AS recovery;", p->zStateDb);
2262122643
recoverExec(p, p->dbOut, zSql);
22644
+ sqlite3_free(zSql);
22645
+ recoverExec(p, p->dbOut, "PRAGMA writable_schema = 1");
22646
+ recoverExec(p, p->dbOut,
22647
+ "CREATE TABLE recovery.map(pgno INTEGER PRIMARY KEY, parent INT)");
2262222648
recoverExec(p, p->dbOut,
22623
- "PRAGMA writable_schema = 1;"
22624
- "CREATE TABLE recovery.map(pgno INTEGER PRIMARY KEY, parent INT);"
22625
- "CREATE TABLE recovery.schema(type, name, tbl_name, rootpage, sql);"
22626
- );
22627
- sqlite3_free(zSql);
22649
+ "CREATE TABLE recovery.schema(type, name, tbl_name, rootpage, sql)");
2262822650
}
2262922651
2263022652
2263122653
/*
2263222654
** This function is a no-op if recover handle p already contains an error
@@ -22762,11 +22784,11 @@
2276222784
" (type='index' AND (sql LIKE '%unique%' OR ?1))"
2276322785
" FROM recovery.schema"
2276422786
")"
2276522787
"SELECT rootpage, tbl, isVirtual, name, sql"
2276622788
" FROM dbschema "
22767
- " WHERE tbl OR isIndex"
22789
+ " WHERE (tbl OR isIndex) AND sql GLOB 'CREATE *'"
2276822790
" ORDER BY tbl DESC, name=='sqlite_sequence' DESC"
2276922791
);
2277022792
2277122793
pTblname = recoverPrepare(p, p->dbOut,
2277222794
"SELECT name FROM sqlite_schema "
@@ -22788,11 +22810,11 @@
2278822810
zSql = (const char*)(zFree = recoverMPrintf(p,
2278922811
"INSERT INTO sqlite_schema VALUES('table', %Q, %Q, 0, %Q)",
2279022812
zName, zName, zSql
2279122813
));
2279222814
}
22793
- rc = sqlite3_exec(p->dbOut, zSql, 0, 0, 0);
22815
+ rc = recoverOneStmt(p->dbOut, zSql);
2279422816
if( rc==SQLITE_OK ){
2279522817
recoverSqlCallback(p, zSql);
2279622818
if( bTable && !bVirtual ){
2279722819
if( SQLITE_ROW==sqlite3_step(pTblname) ){
2279822820
const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0);
@@ -22830,19 +22852,21 @@
2283022852
2283122853
pSelect = recoverPrepare(p, p->dbOut,
2283222854
p->bSlowIndexes ?
2283322855
"SELECT rootpage, sql FROM recovery.schema "
2283422856
" WHERE type!='table' AND type!='index'"
22857
+ " AND sql GLOB 'CREATE *'"
2283522858
:
2283622859
"SELECT rootpage, sql FROM recovery.schema "
2283722860
" WHERE type!='table' AND (type!='index' OR sql NOT LIKE '%unique%')"
22861
+ " AND sql GLOB 'CREATE *'"
2283822862
);
2283922863
2284022864
if( pSelect ){
2284122865
while( sqlite3_step(pSelect)==SQLITE_ROW ){
2284222866
const char *zSql = (const char*)sqlite3_column_text(pSelect, 1);
22843
- int rc = sqlite3_exec(p->dbOut, zSql, 0, 0, 0);
22867
+ int rc = recoverOneStmt(p->dbOut, zSql);
2284422868
if( rc==SQLITE_OK ){
2284522869
recoverSqlCallback(p, zSql);
2284622870
}else if( rc!=SQLITE_ERROR ){
2284722871
recoverDbError(p, p->dbOut);
2284822872
}
@@ -24216,11 +24240,11 @@
2421624240
recoverCacheSchema(p);
2421724241
2421824242
if( bUseWrapper ) recoverUninstallWrapper(p);
2421924243
}while( p->errCode==SQLITE_NOTADB
2422024244
&& (bUseWrapper--)
24221
- && SQLITE_OK==sqlite3_exec(p->dbIn, "ROLLBACK", 0, 0, 0)
24245
+ && SQLITE_OK==recoverOneStmt(p->dbIn, "ROLLBACK")
2422224246
);
2422324247
}
2422424248
2422524249
recoverLeaveMutex();
2422624250
recoverExec(p, p->dbOut, "BEGIN");
@@ -24281,11 +24305,11 @@
2428124305
2428224306
/* If no error has occurred, commit the write transaction on the output
2428324307
** database. Regardless of whether or not an error has occurred, make
2428424308
** an attempt to end the read transaction on the input database. */
2428524309
recoverExec(p, p->dbOut, "COMMIT");
24286
- rc = sqlite3_exec(p->dbIn, "END", 0, 0, 0);
24310
+ rc = recoverOneStmt(p->dbIn, "END");
2428724311
if( p->errCode==SQLITE_OK ) p->errCode = rc;
2428824312
2428924313
recoverSqlCallback(p, "PRAGMA writable_schema = off");
2429024314
recoverSqlCallback(p, "COMMIT");
2429124315
p->eState = RECOVER_STATE_DONE;
@@ -24477,11 +24501,11 @@
2447724501
if( p==0 ){
2447824502
rc = SQLITE_NOMEM;
2447924503
}else{
2448024504
recoverFinalCleanup(p);
2448124505
if( p->bCloseTransaction && sqlite3_get_autocommit(p->dbIn)==0 ){
24482
- rc = sqlite3_exec(p->dbIn, "END", 0, 0, 0);
24506
+ rc = recoverOneStmt(p->dbIn, "END");
2448324507
if( p->errCode==SQLITE_OK ) p->errCode = rc;
2448424508
}
2448524509
rc = p->errCode;
2448624510
sqlite3_free(p->zErrMsg);
2448724511
sqlite3_free(p->zStateDb);
@@ -24564,10 +24588,11 @@
2456424588
unsigned statsOn; /* True to display memory stats before each finalize */
2456524589
unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
2456624590
u8 nPopOutput; /* Revert .output settings when reaching zero */
2456724591
u8 nPopMode; /* Revert .mode settings when reaching zero */
2456824592
u8 enableTimer; /* Enable the timer. 2: permanently 1: only once */
24593
+ u8 bDelimitNonprint; /* Add \001...\002 around non-printing in prompts */
2456924594
int inputNesting; /* Track nesting level of .read and other redirects */
2457024595
double prevTimer; /* Last reported timer value */
2457124596
double tmProgress; /* --timeout option for .progress */
2457224597
i64 lineno; /* Line number of last line read from in */
2457324598
const char *zInFile; /* Name of the input file */
@@ -25107,10 +25132,22 @@
2510725132
break;
2510825133
}
2510925134
}
2511025135
return zLine;
2511125136
}
25137
+
25138
+/*
25139
+** Return true if either the SQLITE_NO_COLOR compile-time option is used
25140
+** or if the NO_COLOR environment variable exists
25141
+*/
25142
+static int shellNoColor(void){
25143
+#ifdef SQLITE_NO_COLOR
25144
+ return 1;
25145
+#else
25146
+ return getenv("NO_COLOR")!=0;
25147
+#endif
25148
+}
2511225149
2511325150
/*
2511425151
** The SQLITE_PS_APPDEF macro should be set to the name of a function
2511525152
** that accepts a single "int" argument and returns a "const char *"
2511625153
** that is guaranteed to be non-NULL. The value returned depends on the
@@ -25133,24 +25170,28 @@
2513325170
switch( c ){
2513425171
/* The default main prompt string */
2513525172
case 1:
2513625173
#if defined(SQLITE_PS1)
2513725174
return SQLITE_PS1;
25138
-#elif defined(SQLITE_PS_NOANSI)
25139
- return "/A-/v /~> ";
2514025175
#else
25141
- return "/e[1;32m/A-/v /e[1;/x33/:36/;m/m/e[3m/;/f/;/e[0m-> ";
25176
+ if( shellNoColor() ){
25177
+ return "/A-/v /~> ";
25178
+ }else{
25179
+ return "/e[1;32m/A-/v /e[1;/x33/:36/;m/m/e[3m/;/f/;/e[0m-> ";
25180
+ }
2514225181
#endif
2514325182
2514425183
/* The default continuation prompt string */
2514525184
case 2:
2514625185
#if defined(SQLITE_PS2)
2514725186
return SQLITE_PS2;
25148
-#elif defined(SQLITE_PS_NOANSI)
25149
- return "/B/C> ";
2515025187
#else
25151
- return "/B/e[1;/x33/:36/;m/C/e[0m-> ";
25188
+ if( shellNoColor() ){
25189
+ return "/B/C> ";
25190
+ }else{
25191
+ return "/B/e[1;/x33/:36/;m/C/e[0m-> ";
25192
+ }
2515225193
#endif
2515325194
2515425195
/* Name of environment variables that override the prompt strings
2515525196
** of cases 1 and 2 */
2515625197
case 3: return "SQLITE_PS1";
@@ -25218,13 +25259,13 @@
2521825259
}else if( p->db && (pFN = sqlite3_db_filename(p->db,0))!=0 ){
2521925260
zFN = sqlite3_filename_database(pFN);
2522025261
}
2522125262
if( zFN==0 || zFN[0]==0 ){
2522225263
zFN = p->pAuxDb->zDbFilename;
25223
- if( zFN==0 || zFN[0]==0 || cli_strcmp(zFN,":memory:")==0 ){
25224
- zFN = zMemoryName;
25225
- }
25264
+ }
25265
+ if( zFN==0 || zFN[0]==0 || cli_strcmp(zFN,":memory:")==0 ){
25266
+ zFN = zMemoryName;
2522625267
}
2522725268
return zFN;
2522825269
}
2522925270
2523025271
/*
@@ -25263,10 +25304,26 @@
2526325304
if( z==0 || z[0]==0 ) z = getenv("LOGNAME");
2526425305
if( z==0 || z[0]==0 ) z = "?";
2526525306
#endif
2526625307
return z;
2526725308
}
25309
+
25310
+/* If z[] begins with one or more ANSI X3.64 (VT100) escape sequences
25311
+** return the number of bytes in all such escape sequences. Return
25312
+** zero if there are no valid escape sequences.
25313
+*/
25314
+static int nAnsiEscape(const char *z){
25315
+ int i = 0;
25316
+ while( z[i]=='\033' && z[i+1]=='[' ){
25317
+ int k = i+2;
25318
+ while( z[k]>=0x30 && z[k]<=0x3f ){ k++; }
25319
+ while( z[k]>=0x20 && z[k]<=0x2f ){ k++; }
25320
+ if( z[k]<0x40 || z[k]>0x7e ) break;
25321
+ i = k+1;
25322
+ }
25323
+ return i;
25324
+}
2526825325
2526925326
/*
2527025327
** Expand escapes in the given input prompt string. Return the
2527125328
** expanded prompt in memory obtained from sqlite3_malloc(). The
2527225329
** caller is responsible for freeing the memory.
@@ -25311,10 +25368,11 @@
2531125368
continue;
2531225369
}
2531325370
if( c>='0' && c<='7' ){
2531425371
/* /nnn becomes a single byte given by octal nnn */
2531525372
int v = c - '0';
25373
+ i++;
2531625374
while( i<=2 && zPrompt[i+1]>='0' && zPrompt[i+1]<='7' ){
2531725375
v = v*8 + zPrompt[++i] - '0';
2531825376
}
2531925377
if( !mOff ) sqlite3_str_appendchar(pOut, 1, v);
2532025378
zPrompt += i+1;
@@ -25533,15 +25591,36 @@
2553325591
memmove(z+idxSpace+nNew, z+idxSpace, len-nNew-idxSpace);
2553425592
memset(z+idxSpace, ' ', nNew);
2553525593
}
2553625594
}
2553725595
}
25538
-
2553925596
if( 0==sqlite3_str_length(pOut) ){
2554025597
/* Avoid a bogus OOM */
2554125598
sqlite3_str_appendchar(pOut, 1, '\0');
2554225599
}
25600
+
25601
+ /* Editline does not recognize ANSI X3.64 escape sequences. So we have
25602
+ ** to find them all and enclose them inside '\001'...'\002' delimiters.
25603
+ ** Some versions of readline also require this, but others do not.
25604
+ */
25605
+ if( p->bDelimitNonprint && strstr(sqlite3_str_value(pOut),"\033[")!=0 ){
25606
+ char *zOrig = sqlite3_str_finish(pOut);
25607
+ int n;
25608
+ pOut = sqlite3_str_new(0);
25609
+ for(i=0; zOrig[i]; i++){
25610
+ if( zOrig[i]=='\033' && (n = nAnsiEscape(zOrig+i))>0 ){
25611
+ sqlite3_str_appendchar(pOut, 1, 1);
25612
+ sqlite3_str_append(pOut, &zOrig[i], n);
25613
+ sqlite3_str_appendchar(pOut, 1, 2);
25614
+ i += n-1;
25615
+ }else{
25616
+ sqlite3_str_appendchar(pOut, 1, zOrig[i]);
25617
+ }
25618
+ }
25619
+ sqlite3_free(zOrig);
25620
+ }
25621
+
2554325622
return sqlite3_str_finish(pOut);
2554425623
}
2554525624
2554625625
/*
2554725626
** Retrieve a single line of input text.
@@ -25912,21 +25991,27 @@
2591225991
}
2591325992
sqlite3_result_value(pCtx, apVal[0]);
2591425993
}
2591525994
2591625995
/*
25917
-** SQL function: shell_prompt_test(PROMPT)
25918
-** shell_prompt_test(PROMPT,PRIOR)
25919
-** shell_prompt_test(PROMPT,PRIOR,FILENAME)
25996
+** SQL function: shell_prompt_test(PROMPT,PRIOR,FILENAME,FLAGS)
2592025997
**
2592125998
** Return the shell prompt, with escapes expanded, for testing purposes.
2592225999
** The first argument is the raw (unexpanded) prompt string. Or if the
2592326000
** first argument is NULL, then use whatever prompt string is currently
2592426001
** configured. If the second argument exists and is not NULL, then the
2592526002
** second argument is understood to be prior incomplete text and a
2592626003
** continuation prompt is generated. If a third argument is provided,
25927
-** it is assumed to be the full pathname of the database file.
26004
+** it is assumed to be the full pathname of the database file. The
26005
+** fourth argument, if provided, is an integer of flags:
26006
+**
26007
+** 0x0001 Always insert \001..\002 delimiters around ANSI escapes
26008
+** 0x0002 Never insert \001..\002 delimiters
26009
+**
26010
+** This function is for testing purposes only. The interface may change.
26011
+** The function itself might be renamed or removed in future releases. Do
26012
+** not use this function in applications.
2592826013
*/
2592926014
static void shellExpandPrompt(
2593026015
sqlite3_context *pCtx,
2593126016
int nVal,
2593226017
sqlite3_value **apVal
@@ -25936,11 +26021,14 @@
2593626021
const char *zPrior;
2593726022
const char *zSavedDbFile;
2593826023
int mSavedFlgs;
2593926024
const char *zFName;
2594026025
char *zRes;
26026
+ int mFlags;
26027
+ char bSavedDelimit = p->bDelimitNonprint;
2594126028
26029
+ if( nVal<1 ) return;
2594226030
if( nVal<2
2594326031
|| (zPrior = (const char*)sqlite3_value_text(apVal[1]))==0
2594426032
|| zPrior[0]==0
2594526033
){
2594626034
zPrior = 0;
@@ -25952,12 +26040,19 @@
2595226040
zSavedDbFile = p->pAuxDb->zDbFilename;
2595326041
mSavedFlgs = p->pAuxDb->mFlgs;
2595426042
if( nVal>=3 && (zFName = (const char*)sqlite3_value_text(apVal[2]))!=0 ){
2595526043
p->pAuxDb->zDbFilename = zFName;
2595626044
p->pAuxDb->mFlgs |= 0x001;
26045
+ }
26046
+ mFlags = nVal>=4 ? sqlite3_value_int(apVal[3]) : 0;
26047
+ if( mFlags & 0x0001 ){
26048
+ p->bDelimitNonprint = 1;
26049
+ }else if( mFlags & 0x0002 ){
26050
+ p->bDelimitNonprint = 0;
2595726051
}
2595826052
zRes = expand_prompt(p, zPrior, zPrompt);
26053
+ p->bDelimitNonprint = bSavedDelimit;
2595926054
p->pAuxDb->zDbFilename = zSavedDbFile;
2596026055
p->pAuxDb->mFlgs = mSavedFlgs;
2596126056
sqlite3_result_text(pCtx, zRes, -1, SQLITE_TRANSIENT);
2596226057
sqlite3_free(zRes);
2596326058
}
@@ -29406,15 +29501,11 @@
2940629501
sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0,
2940729502
editFunc, 0, 0);
2940829503
sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0,
2940929504
editFunc, 0, 0);
2941029505
#endif
29411
- sqlite3_create_function(p->db, "shell_prompt_test", 1, SQLITE_UTF8,
29412
- p, shellExpandPrompt, 0, 0);
29413
- sqlite3_create_function(p->db, "shell_prompt_test", 2, SQLITE_UTF8,
29414
- p, shellExpandPrompt, 0, 0);
29415
- sqlite3_create_function(p->db, "shell_prompt_test", 3, SQLITE_UTF8,
29506
+ sqlite3_create_function(p->db, "shell_prompt_test", -1, SQLITE_UTF8,
2941629507
p, shellExpandPrompt, 0, 0);
2941729508
sqlite3_create_function(p->db, "shell_temp_filename", 1, SQLITE_UTF8,
2941829509
p, shellTempFilenameFunc, 0, 0);
2941929510
2942029511
@@ -37724,31 +37815,32 @@
3772437815
verify_uninitialized();
3772537816
#endif
3772637817
sqlite3_config(SQLITE_CONFIG_URI, 1);
3772737818
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
3772837819
globalShellState = p;
37820
+#if HAVE_EDITLINE || HAVE_READLINE
37821
+ /* Editline requires \001...\002 delimiters around ANSI x3.64 escapes in
37822
+ ** prompt strings. Readline does sometimes, depending on how it is
37823
+ ** compiled and installed. */
37824
+ p->bDelimitNonprint = 1;
37825
+#else
37826
+ /* No \001...\002 escapes required for linenoise or when not using a
37827
+ ** command-line editing library */
37828
+ p->bDelimitNonprint = 0;
37829
+#endif
3772937830
}
3773037831
3773137832
/*
3773237833
** Output text to the console in a font that attracts extra attention.
3773337834
*/
37734
-#if 0 /* Windows now handles ANSI escape codes */
37735
-static void printBold(const char *zText){
37736
- HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
37737
- CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo;
37738
- GetConsoleScreenBufferInfo(out, &defaultScreenInfo);
37739
- SetConsoleTextAttribute(out,
37740
- FOREGROUND_RED|FOREGROUND_INTENSITY
37741
- );
37742
- sputz(stdout, zText);
37743
- SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes);
37744
-}
37745
-#else
37746
-static void printBold(const char *zText){
37747
- cli_printf(stdout, "\033[1;36m\033[3m%s\033[0m", zText);
37748
-}
37749
-#endif
37835
+static void printBold(const char *zText){
37836
+ if( shellNoColor() ){
37837
+ cli_printf(stdout, "%s", zText);
37838
+ }else{
37839
+ cli_printf(stdout, "\033[1;36m\033[3m%s\033[0m", zText);
37840
+ }
37841
+}
3775037842
3775137843
/*
3775237844
** Get the argument to an --option. Throw an error and die if no argument
3775337845
** is available.
3775437846
*/
3775537847
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -22123,23 +22123,44 @@
22123 int rc = sqlite3_finalize(pStmt);
22124 if( rc!=SQLITE_OK && p->errCode==SQLITE_OK ){
22125 recoverDbError(p, db);
22126 }
22127 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22128
22129 /*
22130 ** This function is a no-op if recover handle p already contains an error
22131 ** (if p->errCode!=SQLITE_OK). A copy of p->errCode is returned in this
22132 ** case.
22133 **
22134 ** Otherwise, execute SQL script zSql. If successful, return SQLITE_OK.
22135 ** Or, if an error occurs, leave an error code and message in the recover
22136 ** handle and return a copy of the error code.
 
22137 */
22138 static int recoverExec(sqlite3_recover *p, sqlite3 *db, const char *zSql){
22139 if( p->errCode==SQLITE_OK ){
22140 int rc = sqlite3_exec(db, zSql, 0, 0, 0);
22141 if( rc ){
22142 recoverDbError(p, db);
22143 }
22144 }
22145 return p->errCode;
@@ -22535,11 +22556,12 @@
22535 recoverError(p, SQLITE_NOMEM, 0);
22536 }
22537 }
22538 recoverFinalize(p, p1);
22539 }
22540 recoverExec(p, db2, "CREATE TABLE t1(a); DROP TABLE t1;");
 
22541
22542 if( p->errCode==SQLITE_OK ){
22543 sqlite3 *db = p->dbOut;
22544 sqlite3_backup *pBackup = sqlite3_backup_init(db, "main", db2, "main");
22545 if( pBackup ){
@@ -22617,16 +22639,16 @@
22617 ** discarded.
22618 */
22619 static void recoverOpenRecovery(sqlite3_recover *p){
22620 char *zSql = recoverMPrintf(p, "ATTACH %Q AS recovery;", p->zStateDb);
22621 recoverExec(p, p->dbOut, zSql);
 
 
 
 
22622 recoverExec(p, p->dbOut,
22623 "PRAGMA writable_schema = 1;"
22624 "CREATE TABLE recovery.map(pgno INTEGER PRIMARY KEY, parent INT);"
22625 "CREATE TABLE recovery.schema(type, name, tbl_name, rootpage, sql);"
22626 );
22627 sqlite3_free(zSql);
22628 }
22629
22630
22631 /*
22632 ** This function is a no-op if recover handle p already contains an error
@@ -22762,11 +22784,11 @@
22762 " (type='index' AND (sql LIKE '%unique%' OR ?1))"
22763 " FROM recovery.schema"
22764 ")"
22765 "SELECT rootpage, tbl, isVirtual, name, sql"
22766 " FROM dbschema "
22767 " WHERE tbl OR isIndex"
22768 " ORDER BY tbl DESC, name=='sqlite_sequence' DESC"
22769 );
22770
22771 pTblname = recoverPrepare(p, p->dbOut,
22772 "SELECT name FROM sqlite_schema "
@@ -22788,11 +22810,11 @@
22788 zSql = (const char*)(zFree = recoverMPrintf(p,
22789 "INSERT INTO sqlite_schema VALUES('table', %Q, %Q, 0, %Q)",
22790 zName, zName, zSql
22791 ));
22792 }
22793 rc = sqlite3_exec(p->dbOut, zSql, 0, 0, 0);
22794 if( rc==SQLITE_OK ){
22795 recoverSqlCallback(p, zSql);
22796 if( bTable && !bVirtual ){
22797 if( SQLITE_ROW==sqlite3_step(pTblname) ){
22798 const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0);
@@ -22830,19 +22852,21 @@
22830
22831 pSelect = recoverPrepare(p, p->dbOut,
22832 p->bSlowIndexes ?
22833 "SELECT rootpage, sql FROM recovery.schema "
22834 " WHERE type!='table' AND type!='index'"
 
22835 :
22836 "SELECT rootpage, sql FROM recovery.schema "
22837 " WHERE type!='table' AND (type!='index' OR sql NOT LIKE '%unique%')"
 
22838 );
22839
22840 if( pSelect ){
22841 while( sqlite3_step(pSelect)==SQLITE_ROW ){
22842 const char *zSql = (const char*)sqlite3_column_text(pSelect, 1);
22843 int rc = sqlite3_exec(p->dbOut, zSql, 0, 0, 0);
22844 if( rc==SQLITE_OK ){
22845 recoverSqlCallback(p, zSql);
22846 }else if( rc!=SQLITE_ERROR ){
22847 recoverDbError(p, p->dbOut);
22848 }
@@ -24216,11 +24240,11 @@
24216 recoverCacheSchema(p);
24217
24218 if( bUseWrapper ) recoverUninstallWrapper(p);
24219 }while( p->errCode==SQLITE_NOTADB
24220 && (bUseWrapper--)
24221 && SQLITE_OK==sqlite3_exec(p->dbIn, "ROLLBACK", 0, 0, 0)
24222 );
24223 }
24224
24225 recoverLeaveMutex();
24226 recoverExec(p, p->dbOut, "BEGIN");
@@ -24281,11 +24305,11 @@
24281
24282 /* If no error has occurred, commit the write transaction on the output
24283 ** database. Regardless of whether or not an error has occurred, make
24284 ** an attempt to end the read transaction on the input database. */
24285 recoverExec(p, p->dbOut, "COMMIT");
24286 rc = sqlite3_exec(p->dbIn, "END", 0, 0, 0);
24287 if( p->errCode==SQLITE_OK ) p->errCode = rc;
24288
24289 recoverSqlCallback(p, "PRAGMA writable_schema = off");
24290 recoverSqlCallback(p, "COMMIT");
24291 p->eState = RECOVER_STATE_DONE;
@@ -24477,11 +24501,11 @@
24477 if( p==0 ){
24478 rc = SQLITE_NOMEM;
24479 }else{
24480 recoverFinalCleanup(p);
24481 if( p->bCloseTransaction && sqlite3_get_autocommit(p->dbIn)==0 ){
24482 rc = sqlite3_exec(p->dbIn, "END", 0, 0, 0);
24483 if( p->errCode==SQLITE_OK ) p->errCode = rc;
24484 }
24485 rc = p->errCode;
24486 sqlite3_free(p->zErrMsg);
24487 sqlite3_free(p->zStateDb);
@@ -24564,10 +24588,11 @@
24564 unsigned statsOn; /* True to display memory stats before each finalize */
24565 unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
24566 u8 nPopOutput; /* Revert .output settings when reaching zero */
24567 u8 nPopMode; /* Revert .mode settings when reaching zero */
24568 u8 enableTimer; /* Enable the timer. 2: permanently 1: only once */
 
24569 int inputNesting; /* Track nesting level of .read and other redirects */
24570 double prevTimer; /* Last reported timer value */
24571 double tmProgress; /* --timeout option for .progress */
24572 i64 lineno; /* Line number of last line read from in */
24573 const char *zInFile; /* Name of the input file */
@@ -25107,10 +25132,22 @@
25107 break;
25108 }
25109 }
25110 return zLine;
25111 }
 
 
 
 
 
 
 
 
 
 
 
 
25112
25113 /*
25114 ** The SQLITE_PS_APPDEF macro should be set to the name of a function
25115 ** that accepts a single "int" argument and returns a "const char *"
25116 ** that is guaranteed to be non-NULL. The value returned depends on the
@@ -25133,24 +25170,28 @@
25133 switch( c ){
25134 /* The default main prompt string */
25135 case 1:
25136 #if defined(SQLITE_PS1)
25137 return SQLITE_PS1;
25138 #elif defined(SQLITE_PS_NOANSI)
25139 return "/A-/v /~> ";
25140 #else
25141 return "/e[1;32m/A-/v /e[1;/x33/:36/;m/m/e[3m/;/f/;/e[0m-> ";
 
 
 
 
25142 #endif
25143
25144 /* The default continuation prompt string */
25145 case 2:
25146 #if defined(SQLITE_PS2)
25147 return SQLITE_PS2;
25148 #elif defined(SQLITE_PS_NOANSI)
25149 return "/B/C> ";
25150 #else
25151 return "/B/e[1;/x33/:36/;m/C/e[0m-> ";
 
 
 
 
25152 #endif
25153
25154 /* Name of environment variables that override the prompt strings
25155 ** of cases 1 and 2 */
25156 case 3: return "SQLITE_PS1";
@@ -25218,13 +25259,13 @@
25218 }else if( p->db && (pFN = sqlite3_db_filename(p->db,0))!=0 ){
25219 zFN = sqlite3_filename_database(pFN);
25220 }
25221 if( zFN==0 || zFN[0]==0 ){
25222 zFN = p->pAuxDb->zDbFilename;
25223 if( zFN==0 || zFN[0]==0 || cli_strcmp(zFN,":memory:")==0 ){
25224 zFN = zMemoryName;
25225 }
25226 }
25227 return zFN;
25228 }
25229
25230 /*
@@ -25263,10 +25304,26 @@
25263 if( z==0 || z[0]==0 ) z = getenv("LOGNAME");
25264 if( z==0 || z[0]==0 ) z = "?";
25265 #endif
25266 return z;
25267 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25268
25269 /*
25270 ** Expand escapes in the given input prompt string. Return the
25271 ** expanded prompt in memory obtained from sqlite3_malloc(). The
25272 ** caller is responsible for freeing the memory.
@@ -25311,10 +25368,11 @@
25311 continue;
25312 }
25313 if( c>='0' && c<='7' ){
25314 /* /nnn becomes a single byte given by octal nnn */
25315 int v = c - '0';
 
25316 while( i<=2 && zPrompt[i+1]>='0' && zPrompt[i+1]<='7' ){
25317 v = v*8 + zPrompt[++i] - '0';
25318 }
25319 if( !mOff ) sqlite3_str_appendchar(pOut, 1, v);
25320 zPrompt += i+1;
@@ -25533,15 +25591,36 @@
25533 memmove(z+idxSpace+nNew, z+idxSpace, len-nNew-idxSpace);
25534 memset(z+idxSpace, ' ', nNew);
25535 }
25536 }
25537 }
25538
25539 if( 0==sqlite3_str_length(pOut) ){
25540 /* Avoid a bogus OOM */
25541 sqlite3_str_appendchar(pOut, 1, '\0');
25542 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25543 return sqlite3_str_finish(pOut);
25544 }
25545
25546 /*
25547 ** Retrieve a single line of input text.
@@ -25912,21 +25991,27 @@
25912 }
25913 sqlite3_result_value(pCtx, apVal[0]);
25914 }
25915
25916 /*
25917 ** SQL function: shell_prompt_test(PROMPT)
25918 ** shell_prompt_test(PROMPT,PRIOR)
25919 ** shell_prompt_test(PROMPT,PRIOR,FILENAME)
25920 **
25921 ** Return the shell prompt, with escapes expanded, for testing purposes.
25922 ** The first argument is the raw (unexpanded) prompt string. Or if the
25923 ** first argument is NULL, then use whatever prompt string is currently
25924 ** configured. If the second argument exists and is not NULL, then the
25925 ** second argument is understood to be prior incomplete text and a
25926 ** continuation prompt is generated. If a third argument is provided,
25927 ** it is assumed to be the full pathname of the database file.
 
 
 
 
 
 
 
 
25928 */
25929 static void shellExpandPrompt(
25930 sqlite3_context *pCtx,
25931 int nVal,
25932 sqlite3_value **apVal
@@ -25936,11 +26021,14 @@
25936 const char *zPrior;
25937 const char *zSavedDbFile;
25938 int mSavedFlgs;
25939 const char *zFName;
25940 char *zRes;
 
 
25941
 
25942 if( nVal<2
25943 || (zPrior = (const char*)sqlite3_value_text(apVal[1]))==0
25944 || zPrior[0]==0
25945 ){
25946 zPrior = 0;
@@ -25952,12 +26040,19 @@
25952 zSavedDbFile = p->pAuxDb->zDbFilename;
25953 mSavedFlgs = p->pAuxDb->mFlgs;
25954 if( nVal>=3 && (zFName = (const char*)sqlite3_value_text(apVal[2]))!=0 ){
25955 p->pAuxDb->zDbFilename = zFName;
25956 p->pAuxDb->mFlgs |= 0x001;
 
 
 
 
 
 
25957 }
25958 zRes = expand_prompt(p, zPrior, zPrompt);
 
25959 p->pAuxDb->zDbFilename = zSavedDbFile;
25960 p->pAuxDb->mFlgs = mSavedFlgs;
25961 sqlite3_result_text(pCtx, zRes, -1, SQLITE_TRANSIENT);
25962 sqlite3_free(zRes);
25963 }
@@ -29406,15 +29501,11 @@
29406 sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0,
29407 editFunc, 0, 0);
29408 sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0,
29409 editFunc, 0, 0);
29410 #endif
29411 sqlite3_create_function(p->db, "shell_prompt_test", 1, SQLITE_UTF8,
29412 p, shellExpandPrompt, 0, 0);
29413 sqlite3_create_function(p->db, "shell_prompt_test", 2, SQLITE_UTF8,
29414 p, shellExpandPrompt, 0, 0);
29415 sqlite3_create_function(p->db, "shell_prompt_test", 3, SQLITE_UTF8,
29416 p, shellExpandPrompt, 0, 0);
29417 sqlite3_create_function(p->db, "shell_temp_filename", 1, SQLITE_UTF8,
29418 p, shellTempFilenameFunc, 0, 0);
29419
29420
@@ -37724,31 +37815,32 @@
37724 verify_uninitialized();
37725 #endif
37726 sqlite3_config(SQLITE_CONFIG_URI, 1);
37727 sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
37728 globalShellState = p;
 
 
 
 
 
 
 
 
 
 
37729 }
37730
37731 /*
37732 ** Output text to the console in a font that attracts extra attention.
37733 */
37734 #if 0 /* Windows now handles ANSI escape codes */
37735 static void printBold(const char *zText){
37736 HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
37737 CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo;
37738 GetConsoleScreenBufferInfo(out, &defaultScreenInfo);
37739 SetConsoleTextAttribute(out,
37740 FOREGROUND_RED|FOREGROUND_INTENSITY
37741 );
37742 sputz(stdout, zText);
37743 SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes);
37744 }
37745 #else
37746 static void printBold(const char *zText){
37747 cli_printf(stdout, "\033[1;36m\033[3m%s\033[0m", zText);
37748 }
37749 #endif
37750
37751 /*
37752 ** Get the argument to an --option. Throw an error and die if no argument
37753 ** is available.
37754 */
37755
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -22123,23 +22123,44 @@
22123 int rc = sqlite3_finalize(pStmt);
22124 if( rc!=SQLITE_OK && p->errCode==SQLITE_OK ){
22125 recoverDbError(p, db);
22126 }
22127 }
22128
22129 /*
22130 ** Run a single SQL statement in zSql. If zSql contains two or more
22131 ** SQL statements separated by ';', only the first is run.
22132 **
22133 ** Return the sqlite3_finalizer() or sqlite3_prepare() result code
22134 ** from running the zSql statement.
22135 */
22136 static int recoverOneStmt(sqlite3 *db, const char *zSql){
22137 sqlite3_stmt *pStmt = 0;
22138 int rc;
22139 if( zSql==0 ) return SQLITE_OK;
22140 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
22141 if( rc ){
22142 sqlite3_finalize(pStmt);
22143 return rc;
22144 }
22145 while( SQLITE_ROW==sqlite3_step(pStmt) ){}
22146 return sqlite3_finalize(pStmt);
22147 }
22148
22149 /*
22150 ** This function is a no-op if recover handle p already contains an error
22151 ** (if p->errCode!=SQLITE_OK). A copy of p->errCode is returned in this
22152 ** case.
22153 **
22154 ** Otherwise, execute a single SQL statment in zSql. Even if zSql contains
22155 ** two or more SQL statements separated by ';', only execute the first one.
22156 ** If successful, return SQLITE_OK. Or, if an error occurs, leave an error
22157 ** code and message in the recover handle and return a copy of the error code.
22158 */
22159 static int recoverExec(sqlite3_recover *p, sqlite3 *db, const char *zSql){
22160 if( p->errCode==SQLITE_OK ){
22161 int rc = recoverOneStmt(db, zSql);
22162 if( rc ){
22163 recoverDbError(p, db);
22164 }
22165 }
22166 return p->errCode;
@@ -22535,11 +22556,12 @@
22556 recoverError(p, SQLITE_NOMEM, 0);
22557 }
22558 }
22559 recoverFinalize(p, p1);
22560 }
22561 recoverExec(p, db2, "CREATE TABLE t1(a)");
22562 recoverExec(p, db2, "DROP TABLE t1");
22563
22564 if( p->errCode==SQLITE_OK ){
22565 sqlite3 *db = p->dbOut;
22566 sqlite3_backup *pBackup = sqlite3_backup_init(db, "main", db2, "main");
22567 if( pBackup ){
@@ -22617,16 +22639,16 @@
22639 ** discarded.
22640 */
22641 static void recoverOpenRecovery(sqlite3_recover *p){
22642 char *zSql = recoverMPrintf(p, "ATTACH %Q AS recovery;", p->zStateDb);
22643 recoverExec(p, p->dbOut, zSql);
22644 sqlite3_free(zSql);
22645 recoverExec(p, p->dbOut, "PRAGMA writable_schema = 1");
22646 recoverExec(p, p->dbOut,
22647 "CREATE TABLE recovery.map(pgno INTEGER PRIMARY KEY, parent INT)");
22648 recoverExec(p, p->dbOut,
22649 "CREATE TABLE recovery.schema(type, name, tbl_name, rootpage, sql)");
 
 
 
 
22650 }
22651
22652
22653 /*
22654 ** This function is a no-op if recover handle p already contains an error
@@ -22762,11 +22784,11 @@
22784 " (type='index' AND (sql LIKE '%unique%' OR ?1))"
22785 " FROM recovery.schema"
22786 ")"
22787 "SELECT rootpage, tbl, isVirtual, name, sql"
22788 " FROM dbschema "
22789 " WHERE (tbl OR isIndex) AND sql GLOB 'CREATE *'"
22790 " ORDER BY tbl DESC, name=='sqlite_sequence' DESC"
22791 );
22792
22793 pTblname = recoverPrepare(p, p->dbOut,
22794 "SELECT name FROM sqlite_schema "
@@ -22788,11 +22810,11 @@
22810 zSql = (const char*)(zFree = recoverMPrintf(p,
22811 "INSERT INTO sqlite_schema VALUES('table', %Q, %Q, 0, %Q)",
22812 zName, zName, zSql
22813 ));
22814 }
22815 rc = recoverOneStmt(p->dbOut, zSql);
22816 if( rc==SQLITE_OK ){
22817 recoverSqlCallback(p, zSql);
22818 if( bTable && !bVirtual ){
22819 if( SQLITE_ROW==sqlite3_step(pTblname) ){
22820 const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0);
@@ -22830,19 +22852,21 @@
22852
22853 pSelect = recoverPrepare(p, p->dbOut,
22854 p->bSlowIndexes ?
22855 "SELECT rootpage, sql FROM recovery.schema "
22856 " WHERE type!='table' AND type!='index'"
22857 " AND sql GLOB 'CREATE *'"
22858 :
22859 "SELECT rootpage, sql FROM recovery.schema "
22860 " WHERE type!='table' AND (type!='index' OR sql NOT LIKE '%unique%')"
22861 " AND sql GLOB 'CREATE *'"
22862 );
22863
22864 if( pSelect ){
22865 while( sqlite3_step(pSelect)==SQLITE_ROW ){
22866 const char *zSql = (const char*)sqlite3_column_text(pSelect, 1);
22867 int rc = recoverOneStmt(p->dbOut, zSql);
22868 if( rc==SQLITE_OK ){
22869 recoverSqlCallback(p, zSql);
22870 }else if( rc!=SQLITE_ERROR ){
22871 recoverDbError(p, p->dbOut);
22872 }
@@ -24216,11 +24240,11 @@
24240 recoverCacheSchema(p);
24241
24242 if( bUseWrapper ) recoverUninstallWrapper(p);
24243 }while( p->errCode==SQLITE_NOTADB
24244 && (bUseWrapper--)
24245 && SQLITE_OK==recoverOneStmt(p->dbIn, "ROLLBACK")
24246 );
24247 }
24248
24249 recoverLeaveMutex();
24250 recoverExec(p, p->dbOut, "BEGIN");
@@ -24281,11 +24305,11 @@
24305
24306 /* If no error has occurred, commit the write transaction on the output
24307 ** database. Regardless of whether or not an error has occurred, make
24308 ** an attempt to end the read transaction on the input database. */
24309 recoverExec(p, p->dbOut, "COMMIT");
24310 rc = recoverOneStmt(p->dbIn, "END");
24311 if( p->errCode==SQLITE_OK ) p->errCode = rc;
24312
24313 recoverSqlCallback(p, "PRAGMA writable_schema = off");
24314 recoverSqlCallback(p, "COMMIT");
24315 p->eState = RECOVER_STATE_DONE;
@@ -24477,11 +24501,11 @@
24501 if( p==0 ){
24502 rc = SQLITE_NOMEM;
24503 }else{
24504 recoverFinalCleanup(p);
24505 if( p->bCloseTransaction && sqlite3_get_autocommit(p->dbIn)==0 ){
24506 rc = recoverOneStmt(p->dbIn, "END");
24507 if( p->errCode==SQLITE_OK ) p->errCode = rc;
24508 }
24509 rc = p->errCode;
24510 sqlite3_free(p->zErrMsg);
24511 sqlite3_free(p->zStateDb);
@@ -24564,10 +24588,11 @@
24588 unsigned statsOn; /* True to display memory stats before each finalize */
24589 unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
24590 u8 nPopOutput; /* Revert .output settings when reaching zero */
24591 u8 nPopMode; /* Revert .mode settings when reaching zero */
24592 u8 enableTimer; /* Enable the timer. 2: permanently 1: only once */
24593 u8 bDelimitNonprint; /* Add \001...\002 around non-printing in prompts */
24594 int inputNesting; /* Track nesting level of .read and other redirects */
24595 double prevTimer; /* Last reported timer value */
24596 double tmProgress; /* --timeout option for .progress */
24597 i64 lineno; /* Line number of last line read from in */
24598 const char *zInFile; /* Name of the input file */
@@ -25107,10 +25132,22 @@
25132 break;
25133 }
25134 }
25135 return zLine;
25136 }
25137
25138 /*
25139 ** Return true if either the SQLITE_NO_COLOR compile-time option is used
25140 ** or if the NO_COLOR environment variable exists
25141 */
25142 static int shellNoColor(void){
25143 #ifdef SQLITE_NO_COLOR
25144 return 1;
25145 #else
25146 return getenv("NO_COLOR")!=0;
25147 #endif
25148 }
25149
25150 /*
25151 ** The SQLITE_PS_APPDEF macro should be set to the name of a function
25152 ** that accepts a single "int" argument and returns a "const char *"
25153 ** that is guaranteed to be non-NULL. The value returned depends on the
@@ -25133,24 +25170,28 @@
25170 switch( c ){
25171 /* The default main prompt string */
25172 case 1:
25173 #if defined(SQLITE_PS1)
25174 return SQLITE_PS1;
 
 
25175 #else
25176 if( shellNoColor() ){
25177 return "/A-/v /~> ";
25178 }else{
25179 return "/e[1;32m/A-/v /e[1;/x33/:36/;m/m/e[3m/;/f/;/e[0m-> ";
25180 }
25181 #endif
25182
25183 /* The default continuation prompt string */
25184 case 2:
25185 #if defined(SQLITE_PS2)
25186 return SQLITE_PS2;
 
 
25187 #else
25188 if( shellNoColor() ){
25189 return "/B/C> ";
25190 }else{
25191 return "/B/e[1;/x33/:36/;m/C/e[0m-> ";
25192 }
25193 #endif
25194
25195 /* Name of environment variables that override the prompt strings
25196 ** of cases 1 and 2 */
25197 case 3: return "SQLITE_PS1";
@@ -25218,13 +25259,13 @@
25259 }else if( p->db && (pFN = sqlite3_db_filename(p->db,0))!=0 ){
25260 zFN = sqlite3_filename_database(pFN);
25261 }
25262 if( zFN==0 || zFN[0]==0 ){
25263 zFN = p->pAuxDb->zDbFilename;
25264 }
25265 if( zFN==0 || zFN[0]==0 || cli_strcmp(zFN,":memory:")==0 ){
25266 zFN = zMemoryName;
25267 }
25268 return zFN;
25269 }
25270
25271 /*
@@ -25263,10 +25304,26 @@
25304 if( z==0 || z[0]==0 ) z = getenv("LOGNAME");
25305 if( z==0 || z[0]==0 ) z = "?";
25306 #endif
25307 return z;
25308 }
25309
25310 /* If z[] begins with one or more ANSI X3.64 (VT100) escape sequences
25311 ** return the number of bytes in all such escape sequences. Return
25312 ** zero if there are no valid escape sequences.
25313 */
25314 static int nAnsiEscape(const char *z){
25315 int i = 0;
25316 while( z[i]=='\033' && z[i+1]=='[' ){
25317 int k = i+2;
25318 while( z[k]>=0x30 && z[k]<=0x3f ){ k++; }
25319 while( z[k]>=0x20 && z[k]<=0x2f ){ k++; }
25320 if( z[k]<0x40 || z[k]>0x7e ) break;
25321 i = k+1;
25322 }
25323 return i;
25324 }
25325
25326 /*
25327 ** Expand escapes in the given input prompt string. Return the
25328 ** expanded prompt in memory obtained from sqlite3_malloc(). The
25329 ** caller is responsible for freeing the memory.
@@ -25311,10 +25368,11 @@
25368 continue;
25369 }
25370 if( c>='0' && c<='7' ){
25371 /* /nnn becomes a single byte given by octal nnn */
25372 int v = c - '0';
25373 i++;
25374 while( i<=2 && zPrompt[i+1]>='0' && zPrompt[i+1]<='7' ){
25375 v = v*8 + zPrompt[++i] - '0';
25376 }
25377 if( !mOff ) sqlite3_str_appendchar(pOut, 1, v);
25378 zPrompt += i+1;
@@ -25533,15 +25591,36 @@
25591 memmove(z+idxSpace+nNew, z+idxSpace, len-nNew-idxSpace);
25592 memset(z+idxSpace, ' ', nNew);
25593 }
25594 }
25595 }
 
25596 if( 0==sqlite3_str_length(pOut) ){
25597 /* Avoid a bogus OOM */
25598 sqlite3_str_appendchar(pOut, 1, '\0');
25599 }
25600
25601 /* Editline does not recognize ANSI X3.64 escape sequences. So we have
25602 ** to find them all and enclose them inside '\001'...'\002' delimiters.
25603 ** Some versions of readline also require this, but others do not.
25604 */
25605 if( p->bDelimitNonprint && strstr(sqlite3_str_value(pOut),"\033[")!=0 ){
25606 char *zOrig = sqlite3_str_finish(pOut);
25607 int n;
25608 pOut = sqlite3_str_new(0);
25609 for(i=0; zOrig[i]; i++){
25610 if( zOrig[i]=='\033' && (n = nAnsiEscape(zOrig+i))>0 ){
25611 sqlite3_str_appendchar(pOut, 1, 1);
25612 sqlite3_str_append(pOut, &zOrig[i], n);
25613 sqlite3_str_appendchar(pOut, 1, 2);
25614 i += n-1;
25615 }else{
25616 sqlite3_str_appendchar(pOut, 1, zOrig[i]);
25617 }
25618 }
25619 sqlite3_free(zOrig);
25620 }
25621
25622 return sqlite3_str_finish(pOut);
25623 }
25624
25625 /*
25626 ** Retrieve a single line of input text.
@@ -25912,21 +25991,27 @@
25991 }
25992 sqlite3_result_value(pCtx, apVal[0]);
25993 }
25994
25995 /*
25996 ** SQL function: shell_prompt_test(PROMPT,PRIOR,FILENAME,FLAGS)
 
 
25997 **
25998 ** Return the shell prompt, with escapes expanded, for testing purposes.
25999 ** The first argument is the raw (unexpanded) prompt string. Or if the
26000 ** first argument is NULL, then use whatever prompt string is currently
26001 ** configured. If the second argument exists and is not NULL, then the
26002 ** second argument is understood to be prior incomplete text and a
26003 ** continuation prompt is generated. If a third argument is provided,
26004 ** it is assumed to be the full pathname of the database file. The
26005 ** fourth argument, if provided, is an integer of flags:
26006 **
26007 ** 0x0001 Always insert \001..\002 delimiters around ANSI escapes
26008 ** 0x0002 Never insert \001..\002 delimiters
26009 **
26010 ** This function is for testing purposes only. The interface may change.
26011 ** The function itself might be renamed or removed in future releases. Do
26012 ** not use this function in applications.
26013 */
26014 static void shellExpandPrompt(
26015 sqlite3_context *pCtx,
26016 int nVal,
26017 sqlite3_value **apVal
@@ -25936,11 +26021,14 @@
26021 const char *zPrior;
26022 const char *zSavedDbFile;
26023 int mSavedFlgs;
26024 const char *zFName;
26025 char *zRes;
26026 int mFlags;
26027 char bSavedDelimit = p->bDelimitNonprint;
26028
26029 if( nVal<1 ) return;
26030 if( nVal<2
26031 || (zPrior = (const char*)sqlite3_value_text(apVal[1]))==0
26032 || zPrior[0]==0
26033 ){
26034 zPrior = 0;
@@ -25952,12 +26040,19 @@
26040 zSavedDbFile = p->pAuxDb->zDbFilename;
26041 mSavedFlgs = p->pAuxDb->mFlgs;
26042 if( nVal>=3 && (zFName = (const char*)sqlite3_value_text(apVal[2]))!=0 ){
26043 p->pAuxDb->zDbFilename = zFName;
26044 p->pAuxDb->mFlgs |= 0x001;
26045 }
26046 mFlags = nVal>=4 ? sqlite3_value_int(apVal[3]) : 0;
26047 if( mFlags & 0x0001 ){
26048 p->bDelimitNonprint = 1;
26049 }else if( mFlags & 0x0002 ){
26050 p->bDelimitNonprint = 0;
26051 }
26052 zRes = expand_prompt(p, zPrior, zPrompt);
26053 p->bDelimitNonprint = bSavedDelimit;
26054 p->pAuxDb->zDbFilename = zSavedDbFile;
26055 p->pAuxDb->mFlgs = mSavedFlgs;
26056 sqlite3_result_text(pCtx, zRes, -1, SQLITE_TRANSIENT);
26057 sqlite3_free(zRes);
26058 }
@@ -29406,15 +29501,11 @@
29501 sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0,
29502 editFunc, 0, 0);
29503 sqlite3_create_function(p->db, "edit", 2, SQLITE_UTF8, 0,
29504 editFunc, 0, 0);
29505 #endif
29506 sqlite3_create_function(p->db, "shell_prompt_test", -1, SQLITE_UTF8,
 
 
 
 
29507 p, shellExpandPrompt, 0, 0);
29508 sqlite3_create_function(p->db, "shell_temp_filename", 1, SQLITE_UTF8,
29509 p, shellTempFilenameFunc, 0, 0);
29510
29511
@@ -37724,31 +37815,32 @@
37815 verify_uninitialized();
37816 #endif
37817 sqlite3_config(SQLITE_CONFIG_URI, 1);
37818 sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
37819 globalShellState = p;
37820 #if HAVE_EDITLINE || HAVE_READLINE
37821 /* Editline requires \001...\002 delimiters around ANSI x3.64 escapes in
37822 ** prompt strings. Readline does sometimes, depending on how it is
37823 ** compiled and installed. */
37824 p->bDelimitNonprint = 1;
37825 #else
37826 /* No \001...\002 escapes required for linenoise or when not using a
37827 ** command-line editing library */
37828 p->bDelimitNonprint = 0;
37829 #endif
37830 }
37831
37832 /*
37833 ** Output text to the console in a font that attracts extra attention.
37834 */
37835 static void printBold(const char *zText){
37836 if( shellNoColor() ){
37837 cli_printf(stdout, "%s", zText);
37838 }else{
37839 cli_printf(stdout, "\033[1;36m\033[3m%s\033[0m", zText);
37840 }
37841 }
 
 
 
 
 
 
 
 
 
37842
37843 /*
37844 ** Get the argument to an --option. Throw an error and die if no argument
37845 ** is available.
37846 */
37847
+80 -43
--- 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
-** 4aac1057eeaf6c29a4893e9c080497c780b0 with changes in files:
21
+** 7e4134e3ff1ca8712f5fc78fadae66554945 with changes in files:
2222
**
2323
**
2424
*/
2525
#ifndef SQLITE_AMALGAMATION
2626
#define SQLITE_CORE 1
@@ -467,14 +467,14 @@
467467
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
468468
** [sqlite_version()] and [sqlite_source_id()].
469469
*/
470470
#define SQLITE_VERSION "3.54.0"
471471
#define SQLITE_VERSION_NUMBER 3054000
472
-#define SQLITE_SOURCE_ID "2026-04-30 18:23:58 4aac1057eeaf6c29a4893e9c080497c780b0963e810c501532d79eba1b457f27"
472
+#define SQLITE_SOURCE_ID "2026-05-04 10:14:13 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb"
473473
#define SQLITE_SCM_BRANCH "trunk"
474474
#define SQLITE_SCM_TAGS ""
475
-#define SQLITE_SCM_DATETIME "2026-04-30T18:23:58.352Z"
475
+#define SQLITE_SCM_DATETIME "2026-05-04T10:14:13.819Z"
476476
477477
/*
478478
** CAPI3REF: Run-Time Library Version Numbers
479479
** KEYWORDS: sqlite3_version sqlite3_sourceid
480480
**
@@ -30675,18 +30675,12 @@
3067530675
#endif
3067630676
3067730677
/*
3067830678
** Each SQLite mutex is an instance of the following structure.
3067930679
**
30680
-** The ALIGN128 macro attempts to force 128-byte alignment on mutexes,
30681
-** so that adjacent mutex objects are always on different cache lines
30682
-** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
30683
-** seems to work well for all contemporary processors. Experiments show
30684
-** that 64 works just as well most of the time, but the internet says
30685
-** that 128-byte alignment works better.
3068630680
*/
30687
-struct ALIGN128 sqlite3_mutex {
30681
+struct sqlite3_mutex {
3068830682
pthread_mutex_t mutex; /* Mutex controlling the lock */
3068930683
#if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
3069030684
int id; /* Mutex type */
3069130685
#endif
3069230686
#if SQLITE_MUTEX_NREF
@@ -30795,23 +30789,35 @@
3079530789
** returns a different mutex on every call. But for the static
3079630790
** mutex types, the same mutex is returned on every call that has
3079730791
** the same type number.
3079830792
*/
3079930793
static sqlite3_mutex *pthreadMutexAlloc(int iType){
30800
- static sqlite3_mutex staticMutexes[] = {
30801
- SQLITE3_MUTEX_INITIALIZER(2),
30802
- SQLITE3_MUTEX_INITIALIZER(3),
30803
- SQLITE3_MUTEX_INITIALIZER(4),
30804
- SQLITE3_MUTEX_INITIALIZER(5),
30805
- SQLITE3_MUTEX_INITIALIZER(6),
30806
- SQLITE3_MUTEX_INITIALIZER(7),
30807
- SQLITE3_MUTEX_INITIALIZER(8),
30808
- SQLITE3_MUTEX_INITIALIZER(9),
30809
- SQLITE3_MUTEX_INITIALIZER(10),
30810
- SQLITE3_MUTEX_INITIALIZER(11),
30811
- SQLITE3_MUTEX_INITIALIZER(12),
30812
- SQLITE3_MUTEX_INITIALIZER(13)
30794
+ /* Static mutexes - those with IDs of 2 or more...
30795
+ **
30796
+ ** The ALIGN128 macro attempts to force 128-byte alignment on mutexes,
30797
+ ** so that adjacent mutex objects are always on different cache lines
30798
+ ** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
30799
+ ** seems to work well for all contemporary processors. Experiments show
30800
+ ** that 64 works just as well most of the time, but the internet says
30801
+ ** that 128-byte alignment works better.
30802
+ */
30803
+ static ALIGN128 union staticMutex {
30804
+ sqlite3_mutex m;
30805
+ char aSpacer[128];
30806
+ } aMutex[] = {
30807
+ { .m = SQLITE3_MUTEX_INITIALIZER(2) },
30808
+ { .m = SQLITE3_MUTEX_INITIALIZER(3) },
30809
+ { .m = SQLITE3_MUTEX_INITIALIZER(4) },
30810
+ { .m = SQLITE3_MUTEX_INITIALIZER(5) },
30811
+ { .m = SQLITE3_MUTEX_INITIALIZER(6) },
30812
+ { .m = SQLITE3_MUTEX_INITIALIZER(7) },
30813
+ { .m = SQLITE3_MUTEX_INITIALIZER(8) },
30814
+ { .m = SQLITE3_MUTEX_INITIALIZER(9) },
30815
+ { .m = SQLITE3_MUTEX_INITIALIZER(10) },
30816
+ { .m = SQLITE3_MUTEX_INITIALIZER(11) },
30817
+ { .m = SQLITE3_MUTEX_INITIALIZER(12) },
30818
+ { .m = SQLITE3_MUTEX_INITIALIZER(13) },
3081330819
};
3081430820
sqlite3_mutex *p;
3081530821
switch( iType ){
3081630822
case SQLITE_MUTEX_RECURSIVE: {
3081730823
p = sqlite3MallocZero( sizeof(*p) );
@@ -30844,16 +30850,16 @@
3084430850
}
3084530851
break;
3084630852
}
3084730853
default: {
3084830854
#ifdef SQLITE_ENABLE_API_ARMOR
30849
- if( iType-2<0 || iType-2>=ArraySize(staticMutexes) ){
30855
+ if( iType-2<0 || iType-2>=ArraySize(aMutex) ){
3085030856
(void)SQLITE_MISUSE_BKPT;
3085130857
return 0;
3085230858
}
3085330859
#endif
30854
- p = &staticMutexes[iType-2];
30860
+ p = &aMutex[iType-2].m;
3085530861
break;
3085630862
}
3085730863
}
3085830864
#if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
3085930865
assert( p==0 || p->id==iType );
@@ -31134,11 +31140,11 @@
3113431140
** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
3113531141
** seems to work well for all contemporary processors. Experiments show
3113631142
** that 64 works just as well most of the time, but the internet says
3113731143
** that 128-byte alignment works better.
3113831144
*/
31139
-struct ALIGN128 sqlite3_mutex {
31145
+struct sqlite3_mutex {
3114031146
union {
3114131147
CRITICAL_SECTION cs; /* The CRITICAL_SECTION mutex. id==1 */
3114231148
SRWLOCK srwl; /* The Slim reader/writer lock. id!=1 */
3114331149
} u;
3114431150
int id; /* Mutex type */
@@ -31180,13 +31186,23 @@
3118031186
MemoryBarrier();
3118131187
#endif
3118231188
}
3118331189
3118431190
/*
31185
-** Initialize and deinitialize the mutex subsystem.
31191
+** Static mutexes.
31192
+**
31193
+** The ALIGN128 macro on the static mutex array forces 128-byte alignment
31194
+** on the mutexes so that adjacent mutex objects are always on different
31195
+** cache lines in the CPU. This is CPU-dependent, of course, but 128-byte
31196
+** alignment seems to work well for all contemporary processors.
31197
+** Experiments show that 64 works just as well most of the time, but
31198
+** the internet says that 128-byte alignment works better.
3118631199
*/
31187
-static sqlite3_mutex winMutex_staticMutexes[12];
31200
+static ALIGN128 union staticMutexes {
31201
+ sqlite3_mutex m;
31202
+ char spacer[128];
31203
+} aWindowsMutex[12];
3118831204
static int winMutex_isInit = 0;
3118931205
3119031206
/* As the winMutexInit() and winMutexEnd() functions are called as part
3119131207
** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
3119231208
** "interlocked" magic used here is probably not strictly necessary.
@@ -31197,12 +31213,12 @@
3119731213
3119831214
static int winMutexInit(void){
3119931215
/* The first to increment to 1 does actual initialization */
3120031216
if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
3120131217
int i;
31202
- for(i=0; i<ArraySize(winMutex_staticMutexes); i++){
31203
- sqlite3_mutex *p = &winMutex_staticMutexes[i];
31218
+ for(i=0; i<ArraySize(aWindowsMutex); i++){
31219
+ sqlite3_mutex *p = &aWindowsMutex[i].m;
3120431220
p->id = i+2;
3120531221
InitializeSRWLock(&p->u.srwl);
3120631222
#ifdef SQLITE_DEBUG
3120731223
p->nRef = 0;
3120831224
p->owner = 0;
@@ -31301,16 +31317,16 @@
3130131317
}
3130231318
break;
3130331319
}
3130431320
default: {
3130531321
#ifdef SQLITE_ENABLE_API_ARMOR
31306
- if( iType-2<0 || iType-2>=ArraySize(winMutex_staticMutexes) ){
31322
+ if( iType-2<0 || iType-2>=ArraySize(aWindowsMutex) ){
3130731323
(void)SQLITE_MISUSE_BKPT;
3130831324
return 0;
3130931325
}
3131031326
#endif
31311
- p = &winMutex_staticMutexes[iType-2];
31327
+ p = &aWindowsMutex[iType-2].m;
3131231328
#ifdef SQLITE_DEBUG
3131331329
#ifdef SQLITE_WIN32_MUTEX_TRACE_STATIC
3131431330
InterlockedCompareExchange(&p->trace, 1, 0);
3131531331
#endif
3131631332
#endif
@@ -37163,11 +37179,11 @@
3716337179
int b, lp, e, adj, s;
3716437180
u32 pwr10l, mid1;
3716537181
u64 pwr10h, x, hi, lo, sticky, u, m;
3716637182
double r;
3716737183
if( p<POWERSOF10_FIRST ) return 0.0;
37168
- if( p>POWERSOF10_LAST ) return INFINITY;
37184
+ if( p>POWERSOF10_LAST ) return (double)INFINITY;
3716937185
b = 64 - countLeadingZeros(d);
3717037186
lp = pwr10to2(p);
3717137187
e = 53 - b - lp;
3717237188
if( e > 1074 ){
3717337189
if( e>=1130 ) return 0.0;
@@ -37193,11 +37209,11 @@
3719337209
if( adj ){
3719437210
u = (u>>adj) | (u&1);
3719537211
e -= adj;
3719637212
}
3719737213
m = (u + 1 + ((u>>2)&1)) >> 2;
37198
- if( e<=(-972) ) return INFINITY;
37214
+ if( e<=(-972) ) return (double)INFINITY;
3719937215
if((m & U64_BIT(52)) != 0){
3720037216
m = (m & ~U64_BIT(52)) | ((u64)(1075-e)<<52);
3720137217
}
3720237218
memcpy(&r,&m,8);
3720337219
return r;
@@ -83809,16 +83825,20 @@
8380983825
SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
8381083826
int rc;
8381183827
int destMode; /* Destination journal mode */
8381283828
int pgszSrc = 0; /* Source page size */
8381383829
int pgszDest = 0; /* Destination page size */
83814
- Btree *pDest = p->pDest->pBt;
83815
- Btree *pSrc = p->pSrc->pBt;
83830
+ Btree *pDest;
83831
+ Btree *pSrc;
8381683832
8381783833
#ifdef SQLITE_ENABLE_API_ARMOR
8381883834
if( p==0 ) return SQLITE_MISUSE_BKPT;
8381983835
#endif
83836
+ assert( p->pDest );
83837
+ assert( p->pSrc );
83838
+ pDest = p->pDest->pBt;
83839
+ pSrc = p->pSrc->pBt;
8382083840
sqlite3_mutex_enter(p->pSrcDb->mutex);
8382183841
sqlite3BtreeEnter(pSrc);
8382283842
if( p->pDestDb ){
8382383843
sqlite3_mutex_enter(p->pDestDb->mutex);
8382483844
}
@@ -110014,13 +110034,11 @@
110014110034
pExpr->op = eNewExprOp;
110015110035
lookupname_end:
110016110036
if( cnt==1 ){
110017110037
assert( pNC!=0 );
110018110038
#ifndef SQLITE_OMIT_AUTHORIZATION
110019
- if( pParse->db->xAuth
110020
- && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER)
110021
- ){
110039
+ if( db->xAuth && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER) ){
110022110040
sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
110023110041
}
110024110042
#endif
110025110043
/* Increment the nRef value on all name contexts from TopNC up to
110026110044
** the point where the name matched. */
@@ -125104,12 +125122,18 @@
125104125122
/*
125105125123
** Do an authorization check using the code and arguments given. Return
125106125124
** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
125107125125
** is returned, then the error count and error message in pParse are
125108125126
** modified appropriately.
125127
+**
125128
+** Divided into two routines. realAuthCheck() does the work. The
125129
+** sqlite3AuthCheck() routine is usually a fast no-op but invokes
125130
+** realAuthCheck() (and spends time doing some stack pushes and pops
125131
+** as a result) in the uncommon case where an authorization check is
125132
+** actually needed.
125109125133
*/
125110
-SQLITE_PRIVATE int sqlite3AuthCheck(
125134
+static int SQLITE_NOINLINE realAuthCheck(
125111125135
Parse *pParse,
125112125136
int code,
125113125137
const char *zArg1,
125114125138
const char *zArg2,
125115125139
const char *zArg3
@@ -125119,11 +125143,11 @@
125119125143
125120125144
/* Don't do any authorization checks if the database is initializing
125121125145
** or if the parser is being invoked from within sqlite3_declare_vtab.
125122125146
*/
125123125147
assert( !IN_RENAME_OBJECT || db->xAuth==0 );
125124
- if( db->xAuth==0 || db->init.busy || IN_SPECIAL_PARSE ){
125148
+ if( IN_SPECIAL_PARSE ){
125125125149
return SQLITE_OK;
125126125150
}
125127125151
125128125152
/* EVIDENCE-OF: R-43249-19882 The third through sixth parameters to the
125129125153
** callback are either NULL pointers or zero-terminated strings that
@@ -125143,10 +125167,23 @@
125143125167
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
125144125168
rc = SQLITE_DENY;
125145125169
sqliteAuthBadReturnCode(pParse);
125146125170
}
125147125171
return rc;
125172
+}
125173
+SQLITE_PRIVATE int sqlite3AuthCheck(
125174
+ Parse *pParse,
125175
+ int code,
125176
+ const char *zArg1,
125177
+ const char *zArg2,
125178
+ const char *zArg3
125179
+){
125180
+ if( pParse->db->xAuth!=0 && pParse->db->init.busy==0 ){
125181
+ return realAuthCheck(pParse,code,zArg1,zArg2,zArg3);
125182
+ }else{
125183
+ return SQLITE_OK;
125184
+ }
125148125185
}
125149125186
125150125187
/*
125151125188
** Push an authorization context. After this routine is called, the
125152125189
** zArg3 argument to authorization callbacks will be zContext until
@@ -239358,11 +239395,11 @@
239358239395
int bNew,
239359239396
int iCol,
239360239397
const char *pVal,
239361239398
int nVal
239362239399
){
239363
- int nText = nVal>=0 ? nVal : strlen(pVal);
239400
+ sqlite3_int64 nText = nVal>=0 ? nVal : strlen(pVal);
239364239401
sqlite3_int64 nByte = 1 + sessionVarintLen(nText) + nText;
239365239402
int rc = SQLITE_OK;
239366239403
SessionBuffer *pBuf = 0;
239367239404
239368239405
if( SQLITE_OK!=(rc = checkChangeParams(pGrp, bNew, iCol, nByte, &pBuf)) ){
@@ -262217,11 +262254,11 @@
262217262254
int nArg, /* Number of args */
262218262255
sqlite3_value **apUnused /* Function arguments */
262219262256
){
262220262257
assert( nArg==0 );
262221262258
UNUSED_PARAM2(nArg, apUnused);
262222
- sqlite3_result_text(pCtx, "fts5: 2026-04-29 19:14:54 1f940357f7bb160b583ac5b08ff4e32a9fef353255d032c5a18bcb04416c0f0b", -1, SQLITE_TRANSIENT);
262259
+ sqlite3_result_text(pCtx, "fts5: 2026-05-04 10:14:13 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb", -1, SQLITE_TRANSIENT);
262223262260
}
262224262261
262225262262
/*
262226262263
** Implementation of fts5_locale(LOCALE, TEXT) function.
262227262264
**
262228262265
--- 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 ** 4aac1057eeaf6c29a4893e9c080497c780b0 with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
@@ -467,14 +467,14 @@
467 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
468 ** [sqlite_version()] and [sqlite_source_id()].
469 */
470 #define SQLITE_VERSION "3.54.0"
471 #define SQLITE_VERSION_NUMBER 3054000
472 #define SQLITE_SOURCE_ID "2026-04-30 18:23:58 4aac1057eeaf6c29a4893e9c080497c780b0963e810c501532d79eba1b457f27"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-04-30T18:23:58.352Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -30675,18 +30675,12 @@
30675 #endif
30676
30677 /*
30678 ** Each SQLite mutex is an instance of the following structure.
30679 **
30680 ** The ALIGN128 macro attempts to force 128-byte alignment on mutexes,
30681 ** so that adjacent mutex objects are always on different cache lines
30682 ** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
30683 ** seems to work well for all contemporary processors. Experiments show
30684 ** that 64 works just as well most of the time, but the internet says
30685 ** that 128-byte alignment works better.
30686 */
30687 struct ALIGN128 sqlite3_mutex {
30688 pthread_mutex_t mutex; /* Mutex controlling the lock */
30689 #if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
30690 int id; /* Mutex type */
30691 #endif
30692 #if SQLITE_MUTEX_NREF
@@ -30795,23 +30789,35 @@
30795 ** returns a different mutex on every call. But for the static
30796 ** mutex types, the same mutex is returned on every call that has
30797 ** the same type number.
30798 */
30799 static sqlite3_mutex *pthreadMutexAlloc(int iType){
30800 static sqlite3_mutex staticMutexes[] = {
30801 SQLITE3_MUTEX_INITIALIZER(2),
30802 SQLITE3_MUTEX_INITIALIZER(3),
30803 SQLITE3_MUTEX_INITIALIZER(4),
30804 SQLITE3_MUTEX_INITIALIZER(5),
30805 SQLITE3_MUTEX_INITIALIZER(6),
30806 SQLITE3_MUTEX_INITIALIZER(7),
30807 SQLITE3_MUTEX_INITIALIZER(8),
30808 SQLITE3_MUTEX_INITIALIZER(9),
30809 SQLITE3_MUTEX_INITIALIZER(10),
30810 SQLITE3_MUTEX_INITIALIZER(11),
30811 SQLITE3_MUTEX_INITIALIZER(12),
30812 SQLITE3_MUTEX_INITIALIZER(13)
 
 
 
 
 
 
 
 
 
 
 
 
30813 };
30814 sqlite3_mutex *p;
30815 switch( iType ){
30816 case SQLITE_MUTEX_RECURSIVE: {
30817 p = sqlite3MallocZero( sizeof(*p) );
@@ -30844,16 +30850,16 @@
30844 }
30845 break;
30846 }
30847 default: {
30848 #ifdef SQLITE_ENABLE_API_ARMOR
30849 if( iType-2<0 || iType-2>=ArraySize(staticMutexes) ){
30850 (void)SQLITE_MISUSE_BKPT;
30851 return 0;
30852 }
30853 #endif
30854 p = &staticMutexes[iType-2];
30855 break;
30856 }
30857 }
30858 #if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
30859 assert( p==0 || p->id==iType );
@@ -31134,11 +31140,11 @@
31134 ** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
31135 ** seems to work well for all contemporary processors. Experiments show
31136 ** that 64 works just as well most of the time, but the internet says
31137 ** that 128-byte alignment works better.
31138 */
31139 struct ALIGN128 sqlite3_mutex {
31140 union {
31141 CRITICAL_SECTION cs; /* The CRITICAL_SECTION mutex. id==1 */
31142 SRWLOCK srwl; /* The Slim reader/writer lock. id!=1 */
31143 } u;
31144 int id; /* Mutex type */
@@ -31180,13 +31186,23 @@
31180 MemoryBarrier();
31181 #endif
31182 }
31183
31184 /*
31185 ** Initialize and deinitialize the mutex subsystem.
 
 
 
 
 
 
 
31186 */
31187 static sqlite3_mutex winMutex_staticMutexes[12];
 
 
 
31188 static int winMutex_isInit = 0;
31189
31190 /* As the winMutexInit() and winMutexEnd() functions are called as part
31191 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
31192 ** "interlocked" magic used here is probably not strictly necessary.
@@ -31197,12 +31213,12 @@
31197
31198 static int winMutexInit(void){
31199 /* The first to increment to 1 does actual initialization */
31200 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
31201 int i;
31202 for(i=0; i<ArraySize(winMutex_staticMutexes); i++){
31203 sqlite3_mutex *p = &winMutex_staticMutexes[i];
31204 p->id = i+2;
31205 InitializeSRWLock(&p->u.srwl);
31206 #ifdef SQLITE_DEBUG
31207 p->nRef = 0;
31208 p->owner = 0;
@@ -31301,16 +31317,16 @@
31301 }
31302 break;
31303 }
31304 default: {
31305 #ifdef SQLITE_ENABLE_API_ARMOR
31306 if( iType-2<0 || iType-2>=ArraySize(winMutex_staticMutexes) ){
31307 (void)SQLITE_MISUSE_BKPT;
31308 return 0;
31309 }
31310 #endif
31311 p = &winMutex_staticMutexes[iType-2];
31312 #ifdef SQLITE_DEBUG
31313 #ifdef SQLITE_WIN32_MUTEX_TRACE_STATIC
31314 InterlockedCompareExchange(&p->trace, 1, 0);
31315 #endif
31316 #endif
@@ -37163,11 +37179,11 @@
37163 int b, lp, e, adj, s;
37164 u32 pwr10l, mid1;
37165 u64 pwr10h, x, hi, lo, sticky, u, m;
37166 double r;
37167 if( p<POWERSOF10_FIRST ) return 0.0;
37168 if( p>POWERSOF10_LAST ) return INFINITY;
37169 b = 64 - countLeadingZeros(d);
37170 lp = pwr10to2(p);
37171 e = 53 - b - lp;
37172 if( e > 1074 ){
37173 if( e>=1130 ) return 0.0;
@@ -37193,11 +37209,11 @@
37193 if( adj ){
37194 u = (u>>adj) | (u&1);
37195 e -= adj;
37196 }
37197 m = (u + 1 + ((u>>2)&1)) >> 2;
37198 if( e<=(-972) ) return INFINITY;
37199 if((m & U64_BIT(52)) != 0){
37200 m = (m & ~U64_BIT(52)) | ((u64)(1075-e)<<52);
37201 }
37202 memcpy(&r,&m,8);
37203 return r;
@@ -83809,16 +83825,20 @@
83809 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
83810 int rc;
83811 int destMode; /* Destination journal mode */
83812 int pgszSrc = 0; /* Source page size */
83813 int pgszDest = 0; /* Destination page size */
83814 Btree *pDest = p->pDest->pBt;
83815 Btree *pSrc = p->pSrc->pBt;
83816
83817 #ifdef SQLITE_ENABLE_API_ARMOR
83818 if( p==0 ) return SQLITE_MISUSE_BKPT;
83819 #endif
 
 
 
 
83820 sqlite3_mutex_enter(p->pSrcDb->mutex);
83821 sqlite3BtreeEnter(pSrc);
83822 if( p->pDestDb ){
83823 sqlite3_mutex_enter(p->pDestDb->mutex);
83824 }
@@ -110014,13 +110034,11 @@
110014 pExpr->op = eNewExprOp;
110015 lookupname_end:
110016 if( cnt==1 ){
110017 assert( pNC!=0 );
110018 #ifndef SQLITE_OMIT_AUTHORIZATION
110019 if( pParse->db->xAuth
110020 && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER)
110021 ){
110022 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
110023 }
110024 #endif
110025 /* Increment the nRef value on all name contexts from TopNC up to
110026 ** the point where the name matched. */
@@ -125104,12 +125122,18 @@
125104 /*
125105 ** Do an authorization check using the code and arguments given. Return
125106 ** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
125107 ** is returned, then the error count and error message in pParse are
125108 ** modified appropriately.
 
 
 
 
 
 
125109 */
125110 SQLITE_PRIVATE int sqlite3AuthCheck(
125111 Parse *pParse,
125112 int code,
125113 const char *zArg1,
125114 const char *zArg2,
125115 const char *zArg3
@@ -125119,11 +125143,11 @@
125119
125120 /* Don't do any authorization checks if the database is initializing
125121 ** or if the parser is being invoked from within sqlite3_declare_vtab.
125122 */
125123 assert( !IN_RENAME_OBJECT || db->xAuth==0 );
125124 if( db->xAuth==0 || db->init.busy || IN_SPECIAL_PARSE ){
125125 return SQLITE_OK;
125126 }
125127
125128 /* EVIDENCE-OF: R-43249-19882 The third through sixth parameters to the
125129 ** callback are either NULL pointers or zero-terminated strings that
@@ -125143,10 +125167,23 @@
125143 }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
125144 rc = SQLITE_DENY;
125145 sqliteAuthBadReturnCode(pParse);
125146 }
125147 return rc;
 
 
 
 
 
 
 
 
 
 
 
 
 
125148 }
125149
125150 /*
125151 ** Push an authorization context. After this routine is called, the
125152 ** zArg3 argument to authorization callbacks will be zContext until
@@ -239358,11 +239395,11 @@
239358 int bNew,
239359 int iCol,
239360 const char *pVal,
239361 int nVal
239362 ){
239363 int nText = nVal>=0 ? nVal : strlen(pVal);
239364 sqlite3_int64 nByte = 1 + sessionVarintLen(nText) + nText;
239365 int rc = SQLITE_OK;
239366 SessionBuffer *pBuf = 0;
239367
239368 if( SQLITE_OK!=(rc = checkChangeParams(pGrp, bNew, iCol, nByte, &pBuf)) ){
@@ -262217,11 +262254,11 @@
262217 int nArg, /* Number of args */
262218 sqlite3_value **apUnused /* Function arguments */
262219 ){
262220 assert( nArg==0 );
262221 UNUSED_PARAM2(nArg, apUnused);
262222 sqlite3_result_text(pCtx, "fts5: 2026-04-29 19:14:54 1f940357f7bb160b583ac5b08ff4e32a9fef353255d032c5a18bcb04416c0f0b", -1, SQLITE_TRANSIENT);
262223 }
262224
262225 /*
262226 ** Implementation of fts5_locale(LOCALE, TEXT) function.
262227 **
262228
--- 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 ** 7e4134e3ff1ca8712f5fc78fadae66554945 with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
@@ -467,14 +467,14 @@
467 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
468 ** [sqlite_version()] and [sqlite_source_id()].
469 */
470 #define SQLITE_VERSION "3.54.0"
471 #define SQLITE_VERSION_NUMBER 3054000
472 #define SQLITE_SOURCE_ID "2026-05-04 10:14:13 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb"
473 #define SQLITE_SCM_BRANCH "trunk"
474 #define SQLITE_SCM_TAGS ""
475 #define SQLITE_SCM_DATETIME "2026-05-04T10:14:13.819Z"
476
477 /*
478 ** CAPI3REF: Run-Time Library Version Numbers
479 ** KEYWORDS: sqlite3_version sqlite3_sourceid
480 **
@@ -30675,18 +30675,12 @@
30675 #endif
30676
30677 /*
30678 ** Each SQLite mutex is an instance of the following structure.
30679 **
 
 
 
 
 
 
30680 */
30681 struct sqlite3_mutex {
30682 pthread_mutex_t mutex; /* Mutex controlling the lock */
30683 #if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
30684 int id; /* Mutex type */
30685 #endif
30686 #if SQLITE_MUTEX_NREF
@@ -30795,23 +30789,35 @@
30789 ** returns a different mutex on every call. But for the static
30790 ** mutex types, the same mutex is returned on every call that has
30791 ** the same type number.
30792 */
30793 static sqlite3_mutex *pthreadMutexAlloc(int iType){
30794 /* Static mutexes - those with IDs of 2 or more...
30795 **
30796 ** The ALIGN128 macro attempts to force 128-byte alignment on mutexes,
30797 ** so that adjacent mutex objects are always on different cache lines
30798 ** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
30799 ** seems to work well for all contemporary processors. Experiments show
30800 ** that 64 works just as well most of the time, but the internet says
30801 ** that 128-byte alignment works better.
30802 */
30803 static ALIGN128 union staticMutex {
30804 sqlite3_mutex m;
30805 char aSpacer[128];
30806 } aMutex[] = {
30807 { .m = SQLITE3_MUTEX_INITIALIZER(2) },
30808 { .m = SQLITE3_MUTEX_INITIALIZER(3) },
30809 { .m = SQLITE3_MUTEX_INITIALIZER(4) },
30810 { .m = SQLITE3_MUTEX_INITIALIZER(5) },
30811 { .m = SQLITE3_MUTEX_INITIALIZER(6) },
30812 { .m = SQLITE3_MUTEX_INITIALIZER(7) },
30813 { .m = SQLITE3_MUTEX_INITIALIZER(8) },
30814 { .m = SQLITE3_MUTEX_INITIALIZER(9) },
30815 { .m = SQLITE3_MUTEX_INITIALIZER(10) },
30816 { .m = SQLITE3_MUTEX_INITIALIZER(11) },
30817 { .m = SQLITE3_MUTEX_INITIALIZER(12) },
30818 { .m = SQLITE3_MUTEX_INITIALIZER(13) },
30819 };
30820 sqlite3_mutex *p;
30821 switch( iType ){
30822 case SQLITE_MUTEX_RECURSIVE: {
30823 p = sqlite3MallocZero( sizeof(*p) );
@@ -30844,16 +30850,16 @@
30850 }
30851 break;
30852 }
30853 default: {
30854 #ifdef SQLITE_ENABLE_API_ARMOR
30855 if( iType-2<0 || iType-2>=ArraySize(aMutex) ){
30856 (void)SQLITE_MISUSE_BKPT;
30857 return 0;
30858 }
30859 #endif
30860 p = &aMutex[iType-2].m;
30861 break;
30862 }
30863 }
30864 #if SQLITE_MUTEX_NREF || defined(SQLITE_ENABLE_API_ARMOR)
30865 assert( p==0 || p->id==iType );
@@ -31134,11 +31140,11 @@
31140 ** in the CPU. This is CPU-dependent, of course, but 128-byte alignment
31141 ** seems to work well for all contemporary processors. Experiments show
31142 ** that 64 works just as well most of the time, but the internet says
31143 ** that 128-byte alignment works better.
31144 */
31145 struct sqlite3_mutex {
31146 union {
31147 CRITICAL_SECTION cs; /* The CRITICAL_SECTION mutex. id==1 */
31148 SRWLOCK srwl; /* The Slim reader/writer lock. id!=1 */
31149 } u;
31150 int id; /* Mutex type */
@@ -31180,13 +31186,23 @@
31186 MemoryBarrier();
31187 #endif
31188 }
31189
31190 /*
31191 ** Static mutexes.
31192 **
31193 ** The ALIGN128 macro on the static mutex array forces 128-byte alignment
31194 ** on the mutexes so that adjacent mutex objects are always on different
31195 ** cache lines in the CPU. This is CPU-dependent, of course, but 128-byte
31196 ** alignment seems to work well for all contemporary processors.
31197 ** Experiments show that 64 works just as well most of the time, but
31198 ** the internet says that 128-byte alignment works better.
31199 */
31200 static ALIGN128 union staticMutexes {
31201 sqlite3_mutex m;
31202 char spacer[128];
31203 } aWindowsMutex[12];
31204 static int winMutex_isInit = 0;
31205
31206 /* As the winMutexInit() and winMutexEnd() functions are called as part
31207 ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the
31208 ** "interlocked" magic used here is probably not strictly necessary.
@@ -31197,12 +31213,12 @@
31213
31214 static int winMutexInit(void){
31215 /* The first to increment to 1 does actual initialization */
31216 if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
31217 int i;
31218 for(i=0; i<ArraySize(aWindowsMutex); i++){
31219 sqlite3_mutex *p = &aWindowsMutex[i].m;
31220 p->id = i+2;
31221 InitializeSRWLock(&p->u.srwl);
31222 #ifdef SQLITE_DEBUG
31223 p->nRef = 0;
31224 p->owner = 0;
@@ -31301,16 +31317,16 @@
31317 }
31318 break;
31319 }
31320 default: {
31321 #ifdef SQLITE_ENABLE_API_ARMOR
31322 if( iType-2<0 || iType-2>=ArraySize(aWindowsMutex) ){
31323 (void)SQLITE_MISUSE_BKPT;
31324 return 0;
31325 }
31326 #endif
31327 p = &aWindowsMutex[iType-2].m;
31328 #ifdef SQLITE_DEBUG
31329 #ifdef SQLITE_WIN32_MUTEX_TRACE_STATIC
31330 InterlockedCompareExchange(&p->trace, 1, 0);
31331 #endif
31332 #endif
@@ -37163,11 +37179,11 @@
37179 int b, lp, e, adj, s;
37180 u32 pwr10l, mid1;
37181 u64 pwr10h, x, hi, lo, sticky, u, m;
37182 double r;
37183 if( p<POWERSOF10_FIRST ) return 0.0;
37184 if( p>POWERSOF10_LAST ) return (double)INFINITY;
37185 b = 64 - countLeadingZeros(d);
37186 lp = pwr10to2(p);
37187 e = 53 - b - lp;
37188 if( e > 1074 ){
37189 if( e>=1130 ) return 0.0;
@@ -37193,11 +37209,11 @@
37209 if( adj ){
37210 u = (u>>adj) | (u&1);
37211 e -= adj;
37212 }
37213 m = (u + 1 + ((u>>2)&1)) >> 2;
37214 if( e<=(-972) ) return (double)INFINITY;
37215 if((m & U64_BIT(52)) != 0){
37216 m = (m & ~U64_BIT(52)) | ((u64)(1075-e)<<52);
37217 }
37218 memcpy(&r,&m,8);
37219 return r;
@@ -83809,16 +83825,20 @@
83825 SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
83826 int rc;
83827 int destMode; /* Destination journal mode */
83828 int pgszSrc = 0; /* Source page size */
83829 int pgszDest = 0; /* Destination page size */
83830 Btree *pDest;
83831 Btree *pSrc;
83832
83833 #ifdef SQLITE_ENABLE_API_ARMOR
83834 if( p==0 ) return SQLITE_MISUSE_BKPT;
83835 #endif
83836 assert( p->pDest );
83837 assert( p->pSrc );
83838 pDest = p->pDest->pBt;
83839 pSrc = p->pSrc->pBt;
83840 sqlite3_mutex_enter(p->pSrcDb->mutex);
83841 sqlite3BtreeEnter(pSrc);
83842 if( p->pDestDb ){
83843 sqlite3_mutex_enter(p->pDestDb->mutex);
83844 }
@@ -110014,13 +110034,11 @@
110034 pExpr->op = eNewExprOp;
110035 lookupname_end:
110036 if( cnt==1 ){
110037 assert( pNC!=0 );
110038 #ifndef SQLITE_OMIT_AUTHORIZATION
110039 if( db->xAuth && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER) ){
 
 
110040 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
110041 }
110042 #endif
110043 /* Increment the nRef value on all name contexts from TopNC up to
110044 ** the point where the name matched. */
@@ -125104,12 +125122,18 @@
125122 /*
125123 ** Do an authorization check using the code and arguments given. Return
125124 ** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
125125 ** is returned, then the error count and error message in pParse are
125126 ** modified appropriately.
125127 **
125128 ** Divided into two routines. realAuthCheck() does the work. The
125129 ** sqlite3AuthCheck() routine is usually a fast no-op but invokes
125130 ** realAuthCheck() (and spends time doing some stack pushes and pops
125131 ** as a result) in the uncommon case where an authorization check is
125132 ** actually needed.
125133 */
125134 static int SQLITE_NOINLINE realAuthCheck(
125135 Parse *pParse,
125136 int code,
125137 const char *zArg1,
125138 const char *zArg2,
125139 const char *zArg3
@@ -125119,11 +125143,11 @@
125143
125144 /* Don't do any authorization checks if the database is initializing
125145 ** or if the parser is being invoked from within sqlite3_declare_vtab.
125146 */
125147 assert( !IN_RENAME_OBJECT || db->xAuth==0 );
125148 if( IN_SPECIAL_PARSE ){
125149 return SQLITE_OK;
125150 }
125151
125152 /* EVIDENCE-OF: R-43249-19882 The third through sixth parameters to the
125153 ** callback are either NULL pointers or zero-terminated strings that
@@ -125143,10 +125167,23 @@
125167 }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
125168 rc = SQLITE_DENY;
125169 sqliteAuthBadReturnCode(pParse);
125170 }
125171 return rc;
125172 }
125173 SQLITE_PRIVATE int sqlite3AuthCheck(
125174 Parse *pParse,
125175 int code,
125176 const char *zArg1,
125177 const char *zArg2,
125178 const char *zArg3
125179 ){
125180 if( pParse->db->xAuth!=0 && pParse->db->init.busy==0 ){
125181 return realAuthCheck(pParse,code,zArg1,zArg2,zArg3);
125182 }else{
125183 return SQLITE_OK;
125184 }
125185 }
125186
125187 /*
125188 ** Push an authorization context. After this routine is called, the
125189 ** zArg3 argument to authorization callbacks will be zContext until
@@ -239358,11 +239395,11 @@
239395 int bNew,
239396 int iCol,
239397 const char *pVal,
239398 int nVal
239399 ){
239400 sqlite3_int64 nText = nVal>=0 ? nVal : strlen(pVal);
239401 sqlite3_int64 nByte = 1 + sessionVarintLen(nText) + nText;
239402 int rc = SQLITE_OK;
239403 SessionBuffer *pBuf = 0;
239404
239405 if( SQLITE_OK!=(rc = checkChangeParams(pGrp, bNew, iCol, nByte, &pBuf)) ){
@@ -262217,11 +262254,11 @@
262254 int nArg, /* Number of args */
262255 sqlite3_value **apUnused /* Function arguments */
262256 ){
262257 assert( nArg==0 );
262258 UNUSED_PARAM2(nArg, apUnused);
262259 sqlite3_result_text(pCtx, "fts5: 2026-05-04 10:14:13 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb", -1, SQLITE_TRANSIENT);
262260 }
262261
262262 /*
262263 ** Implementation of fts5_locale(LOCALE, TEXT) function.
262264 **
262265
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.54.0"
150150
#define SQLITE_VERSION_NUMBER 3054000
151
-#define SQLITE_SOURCE_ID "2026-04-30 18:23:58 4aac1057eeaf6c29a4893e9c080497c780b0963e810c501532d79eba1b457f27"
151
+#define SQLITE_SOURCE_ID "2026-05-04 10:14:13 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb"
152152
#define SQLITE_SCM_BRANCH "trunk"
153153
#define SQLITE_SCM_TAGS ""
154
-#define SQLITE_SCM_DATETIME "2026-04-30T18:23:58.352Z"
154
+#define SQLITE_SCM_DATETIME "2026-05-04T10:14:13.819Z"
155155
156156
/*
157157
** CAPI3REF: Run-Time Library Version Numbers
158158
** KEYWORDS: sqlite3_version sqlite3_sourceid
159159
**
160160
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.54.0"
150 #define SQLITE_VERSION_NUMBER 3054000
151 #define SQLITE_SOURCE_ID "2026-04-30 18:23:58 4aac1057eeaf6c29a4893e9c080497c780b0963e810c501532d79eba1b457f27"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-04-30T18:23:58.352Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
160
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,14 +146,14 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.54.0"
150 #define SQLITE_VERSION_NUMBER 3054000
151 #define SQLITE_SOURCE_ID "2026-05-04 10:14:13 7e4134e3ff1ca8712f5fc78fadae665549450988dc43af27c7fe0c77f10ce3fb"
152 #define SQLITE_SCM_BRANCH "trunk"
153 #define SQLITE_SCM_TAGS ""
154 #define SQLITE_SCM_DATETIME "2026-05-04T10:14:13.819Z"
155
156 /*
157 ** CAPI3REF: Run-Time Library Version Numbers
158 ** KEYWORDS: sqlite3_version sqlite3_sourceid
159 **
160

Keyboard Shortcuts

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