| | @@ -452,11 +452,11 @@ |
| 452 | 452 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 453 | 453 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 454 | 454 | */ |
| 455 | 455 | #define SQLITE_VERSION "3.38.0" |
| 456 | 456 | #define SQLITE_VERSION_NUMBER 3038000 |
| 457 | | -#define SQLITE_SOURCE_ID "2022-02-15 13:23:09 9edaeed56f2282fd4da935454178c38ab49d259aed96d4e720aae09050a53006" |
| 457 | +#define SQLITE_SOURCE_ID "2022-02-22 18:58:40 40fa792d359f84c3b9e9d6623743e1a59826274e221df1bde8f47086968a1bab" |
| 458 | 458 | |
| 459 | 459 | /* |
| 460 | 460 | ** CAPI3REF: Run-Time Library Version Numbers |
| 461 | 461 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 462 | 462 | ** |
| | @@ -4588,10 +4588,14 @@ |
| 4588 | 4588 | ** ^For example, an UPDATE statement might have a WHERE clause that |
| 4589 | 4589 | ** makes it a no-op, but the sqlite3_stmt_readonly() result would still |
| 4590 | 4590 | ** be false. ^Similarly, a CREATE TABLE IF NOT EXISTS statement is a |
| 4591 | 4591 | ** read-only no-op if the table already exists, but |
| 4592 | 4592 | ** sqlite3_stmt_readonly() still returns false for such a statement. |
| 4593 | +** |
| 4594 | +** ^If prepared statement X is an [EXPLAIN] or [EXPLAIN QUERY PLAN] |
| 4595 | +** statement, then sqlite3_stmt_readonly(X) returns the same value as |
| 4596 | +** if the EXPLAIN or EXPLAIN QUERY PLAN prefix were omitted. |
| 4593 | 4597 | */ |
| 4594 | 4598 | SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 4595 | 4599 | |
| 4596 | 4600 | /* |
| 4597 | 4601 | ** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement |
| | @@ -23620,12 +23624,12 @@ |
| 23620 | 23624 | |
| 23621 | 23625 | /* Initialize the contents of sLocal to avoid a compiler warning. */ |
| 23622 | 23626 | memset(&sLocal, 0, sizeof(sLocal)); |
| 23623 | 23627 | |
| 23624 | 23628 | computeJD(p); |
| 23625 | | - if( p->iJD<21086676000*(i64)10000 /* 1970-01-01 */ |
| 23626 | | - || p->iJD>21301414560*(i64)10000 /* 2038-01-18 */ |
| 23629 | + if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */ |
| 23630 | + || p->iJD>2130141456*(i64)100000 /* 2038-01-18 */ |
| 23627 | 23631 | ){ |
| 23628 | 23632 | /* EVIDENCE-OF: R-55269-29598 The localtime_r() C function normally only |
| 23629 | 23633 | ** works for years between 1970 and 2037. For dates outside this range, |
| 23630 | 23634 | ** SQLite attempts to map the year into an equivalent year within this |
| 23631 | 23635 | ** range, do the calculation, then map the year back. |
| | @@ -23727,11 +23731,13 @@ |
| 23727 | 23731 | if( sqlite3_stricmp(z, "auto")==0 ){ |
| 23728 | 23732 | if( idx>1 ) return 1; /* IMP: R-33611-57934 */ |
| 23729 | 23733 | if( !p->rawS || p->validJD ){ |
| 23730 | 23734 | rc = 0; |
| 23731 | 23735 | p->rawS = 0; |
| 23732 | | - }else if( p->s>=-210866760000 && p->s<=253402300799 ){ |
| 23736 | + }else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */ |
| 23737 | + && p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */ |
| 23738 | + ){ |
| 23733 | 23739 | r = p->s*1000.0 + 210866760000000.0; |
| 23734 | 23740 | clearYMD_HMS_TZ(p); |
| 23735 | 23741 | p->iJD = (sqlite3_int64)(r + 0.5); |
| 23736 | 23742 | p->validJD = 1; |
| 23737 | 23743 | p->rawS = 0; |
| | @@ -79457,11 +79463,11 @@ |
| 79457 | 79463 | *ppVal = pVal; |
| 79458 | 79464 | return rc; |
| 79459 | 79465 | |
| 79460 | 79466 | no_mem: |
| 79461 | 79467 | #ifdef SQLITE_ENABLE_STAT4 |
| 79462 | | - if( pCtx==0 || pCtx->pParse->nErr==0 ) |
| 79468 | + if( pCtx==0 || NEVER(pCtx->pParse->nErr==0) ) |
| 79463 | 79469 | #endif |
| 79464 | 79470 | sqlite3OomFault(db); |
| 79465 | 79471 | sqlite3DbFree(db, zVal); |
| 79466 | 79472 | assert( *ppVal==0 ); |
| 79467 | 79473 | #ifdef SQLITE_ENABLE_STAT4 |
| | @@ -90598,11 +90604,11 @@ |
| 90598 | 90604 | } |
| 90599 | 90605 | nHdr++; |
| 90600 | 90606 | testcase( uu==127 ); testcase( uu==128 ); |
| 90601 | 90607 | testcase( uu==32767 ); testcase( uu==32768 ); |
| 90602 | 90608 | testcase( uu==8388607 ); testcase( uu==8388608 ); |
| 90603 | | - testcase( uu==2147483647 ); testcase( uu==2147483648 ); |
| 90609 | + testcase( uu==2147483647 ); testcase( uu==2147483648LL ); |
| 90604 | 90610 | testcase( uu==140737488355327LL ); testcase( uu==140737488355328LL ); |
| 90605 | 90611 | if( uu<=127 ){ |
| 90606 | 90612 | if( (i&1)==i && file_format>=4 ){ |
| 90607 | 90613 | pRec->uTemp = 8+(u32)uu; |
| 90608 | 90614 | }else{ |
| | @@ -114178,10 +114184,12 @@ |
| 114178 | 114184 | pParse->nested++; |
| 114179 | 114185 | memcpy(saveBuf, PARSE_TAIL(pParse), PARSE_TAIL_SZ); |
| 114180 | 114186 | memset(PARSE_TAIL(pParse), 0, PARSE_TAIL_SZ); |
| 114181 | 114187 | db->mDbFlags |= DBFLAG_PreferBuiltin; |
| 114182 | 114188 | sqlite3RunParser(pParse, zSql); |
| 114189 | + sqlite3DbFree(db, pParse->zErrMsg); |
| 114190 | + pParse->zErrMsg = 0; |
| 114183 | 114191 | db->mDbFlags = savedDbFlags; |
| 114184 | 114192 | sqlite3DbFree(db, zSql); |
| 114185 | 114193 | memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ); |
| 114186 | 114194 | pParse->nested--; |
| 114187 | 114195 | } |
| | @@ -234290,11 +234298,11 @@ |
| 234290 | 234298 | int nArg, /* Number of args */ |
| 234291 | 234299 | sqlite3_value **apUnused /* Function arguments */ |
| 234292 | 234300 | ){ |
| 234293 | 234301 | assert( nArg==0 ); |
| 234294 | 234302 | UNUSED_PARAM2(nArg, apUnused); |
| 234295 | | - sqlite3_result_text(pCtx, "fts5: 2022-02-15 13:23:09 9edaeed56f2282fd4da935454178c38ab49d259aed96d4e720aae09050a53006", -1, SQLITE_TRANSIENT); |
| 234303 | + sqlite3_result_text(pCtx, "fts5: 2022-02-22 18:58:40 40fa792d359f84c3b9e9d6623743e1a59826274e221df1bde8f47086968a1bab", -1, SQLITE_TRANSIENT); |
| 234296 | 234304 | } |
| 234297 | 234305 | |
| 234298 | 234306 | /* |
| 234299 | 234307 | ** Return true if zName is the extension on one of the shadow tables used |
| 234300 | 234308 | ** by this module. |
| 234301 | 234309 | |