| | @@ -1147,11 +1147,11 @@ |
| 1147 | 1147 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1148 | 1148 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1149 | 1149 | */ |
| 1150 | 1150 | #define SQLITE_VERSION "3.22.0" |
| 1151 | 1151 | #define SQLITE_VERSION_NUMBER 3022000 |
| 1152 | | -#define SQLITE_SOURCE_ID "2018-01-16 13:37:43 feb2c2b6f66b0f45490beb1642d99cdb89fa220e299a8c118929df557c814189" |
| 1152 | +#define SQLITE_SOURCE_ID "2018-01-20 15:48:45 136bf323e42dc90e1780199a381bcbb084b069eca5c7343ee6fc6e2550831536" |
| 1153 | 1153 | |
| 1154 | 1154 | /* |
| 1155 | 1155 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1156 | 1156 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1157 | 1157 | ** |
| | @@ -1532,11 +1532,10 @@ |
| 1532 | 1532 | #define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8)) |
| 1533 | 1533 | #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) |
| 1534 | 1534 | #define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) |
| 1535 | 1535 | #define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) |
| 1536 | 1536 | #define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8)) |
| 1537 | | -#define SQLITE_CANTOPEN_DIRTYWAL (SQLITE_CANTOPEN | (5<<8)) |
| 1538 | 1537 | #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) |
| 1539 | 1538 | #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) |
| 1540 | 1539 | #define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) |
| 1541 | 1540 | #define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8)) |
| 1542 | 1541 | #define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4<<8)) |
| | @@ -3974,12 +3973,12 @@ |
| 3974 | 3973 | /* |
| 3975 | 3974 | ** CAPI3REF: SQL Trace Event Codes |
| 3976 | 3975 | ** KEYWORDS: SQLITE_TRACE |
| 3977 | 3976 | ** |
| 3978 | 3977 | ** These constants identify classes of events that can be monitored |
| 3979 | | -** using the [sqlite3_trace_v2()] tracing logic. The third argument |
| 3980 | | -** to [sqlite3_trace_v2()] is an OR-ed combination of one or more of |
| 3978 | +** using the [sqlite3_trace_v2()] tracing logic. The M argument |
| 3979 | +** to [sqlite3_trace_v2(D,M,X,P)] is an OR-ed combination of one or more of |
| 3981 | 3980 | ** the following constants. ^The first argument to the trace callback |
| 3982 | 3981 | ** is one of the following constants. |
| 3983 | 3982 | ** |
| 3984 | 3983 | ** New tracing constants may be added in future releases. |
| 3985 | 3984 | ** |
| | @@ -10097,10 +10096,39 @@ |
| 10097 | 10096 | ** Changes are not recorded for individual rows that have NULL values stored |
| 10098 | 10097 | ** in one or more of their PRIMARY KEY columns. |
| 10099 | 10098 | ** |
| 10100 | 10099 | ** SQLITE_OK is returned if the call completes without error. Or, if an error |
| 10101 | 10100 | ** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. |
| 10101 | +** |
| 10102 | +** <h3>Special sqlite_stat1 Handling</h3> |
| 10103 | +** |
| 10104 | +** As of SQLite version 3.22.0, the "sqlite_stat1" table is an exception to |
| 10105 | +** some of the rules above. In SQLite, the schema of sqlite_stat1 is: |
| 10106 | +** <pre> |
| 10107 | +** CREATE TABLE sqlite_stat1(tbl,idx,stat) |
| 10108 | +** </pre> |
| 10109 | +** |
| 10110 | +** Even though sqlite_stat1 does not have a PRIMARY KEY, changes are |
| 10111 | +** recorded for it as if the PRIMARY KEY is (tbl,idx). Additionally, changes |
| 10112 | +** are recorded for rows for which (idx IS NULL) is true. However, for such |
| 10113 | +** rows a zero-length blob (SQL value X'') is stored in the changeset or |
| 10114 | +** patchset instead of a NULL value. This allows such changesets to be |
| 10115 | +** manipulated by legacy implementations of sqlite3changeset_invert(), |
| 10116 | +** concat() and similar. |
| 10117 | +** |
| 10118 | +** The sqlite3changeset_apply() function automatically converts the |
| 10119 | +** zero-length blob back to a NULL value when updating the sqlite_stat1 |
| 10120 | +** table. However, if the application calls sqlite3changeset_new(), |
| 10121 | +** sqlite3changeset_old() or sqlite3changeset_conflict on a changeset |
| 10122 | +** iterator directly (including on a changeset iterator passed to a |
| 10123 | +** conflict-handler callback) then the X'' value is returned. The application |
| 10124 | +** must translate X'' to NULL itself if required. |
| 10125 | +** |
| 10126 | +** Legacy (older than 3.22.0) versions of the sessions module cannot capture |
| 10127 | +** changes made to the sqlite_stat1 table. Legacy versions of the |
| 10128 | +** sqlite3changeset_apply() function silently ignore any modifications to the |
| 10129 | +** sqlite_stat1 table that are part of a changeset or patchset. |
| 10102 | 10130 | */ |
| 10103 | 10131 | SQLITE_API int sqlite3session_attach( |
| 10104 | 10132 | sqlite3_session *pSession, /* Session object */ |
| 10105 | 10133 | const char *zTab /* Table name */ |
| 10106 | 10134 | ); |
| | @@ -18923,11 +18951,10 @@ |
| 18923 | 18951 | Vdbe *pVdbe; /* The VM that owns this context */ |
| 18924 | 18952 | int iOp; /* Instruction number of OP_Function */ |
| 18925 | 18953 | int isError; /* Error code returned by the function. */ |
| 18926 | 18954 | u8 skipFlag; /* Skip accumulator loading if true */ |
| 18927 | 18955 | u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */ |
| 18928 | | - u8 bVtabNoChng; /* Fetching an unchanging column in a vtab UPDATE */ |
| 18929 | 18956 | u8 argc; /* Number of arguments */ |
| 18930 | 18957 | sqlite3_value *argv[1]; /* Argument set */ |
| 18931 | 18958 | }; |
| 18932 | 18959 | |
| 18933 | 18960 | /* A bitfield type for use inside of structures. Always follow with :N where |
| | @@ -28766,19 +28793,40 @@ |
| 28766 | 28793 | ** E==2 results in 100. E==50 results in 1.0e50. |
| 28767 | 28794 | ** |
| 28768 | 28795 | ** This routine only works for values of E between 1 and 341. |
| 28769 | 28796 | */ |
| 28770 | 28797 | static LONGDOUBLE_TYPE sqlite3Pow10(int E){ |
| 28798 | +#if defined(_MSC_VER) |
| 28799 | + static const LONGDOUBLE_TYPE x[] = { |
| 28800 | + 1.0e+001, |
| 28801 | + 1.0e+002, |
| 28802 | + 1.0e+004, |
| 28803 | + 1.0e+008, |
| 28804 | + 1.0e+016, |
| 28805 | + 1.0e+032, |
| 28806 | + 1.0e+064, |
| 28807 | + 1.0e+128, |
| 28808 | + 1.0e+256 |
| 28809 | + }; |
| 28810 | + LONGDOUBLE_TYPE r = 1.0; |
| 28811 | + int i; |
| 28812 | + assert( E>=0 && E<=307 ); |
| 28813 | + for(i=0; E!=0; i++, E >>=1){ |
| 28814 | + if( E & 1 ) r *= x[i]; |
| 28815 | + } |
| 28816 | + return r; |
| 28817 | +#else |
| 28771 | 28818 | LONGDOUBLE_TYPE x = 10.0; |
| 28772 | 28819 | LONGDOUBLE_TYPE r = 1.0; |
| 28773 | 28820 | while(1){ |
| 28774 | 28821 | if( E & 1 ) r *= x; |
| 28775 | 28822 | E >>= 1; |
| 28776 | 28823 | if( E==0 ) break; |
| 28777 | 28824 | x *= x; |
| 28778 | 28825 | } |
| 28779 | 28826 | return r; |
| 28827 | +#endif |
| 28780 | 28828 | } |
| 28781 | 28829 | |
| 28782 | 28830 | /* |
| 28783 | 28831 | ** The string z[] is an text representation of a real number. |
| 28784 | 28832 | ** Convert this string to a double and write it into *pResult. |
| | @@ -42498,11 +42546,10 @@ |
| 42498 | 42546 | */ |
| 42499 | 42547 | static int winOpenSharedMemory(winFile *pDbFd){ |
| 42500 | 42548 | struct winShm *p; /* The connection to be opened */ |
| 42501 | 42549 | winShmNode *pShmNode = 0; /* The underlying mmapped file */ |
| 42502 | 42550 | int rc = SQLITE_OK; /* Result code */ |
| 42503 | | - int rc2 = SQLITE_ERROR; /* winOpen result code */ |
| 42504 | 42551 | winShmNode *pNew; /* Newly allocated winShmNode */ |
| 42505 | 42552 | int nName; /* Size of zName in bytes */ |
| 42506 | 42553 | |
| 42507 | 42554 | assert( pDbFd->pShm==0 ); /* Not previously opened */ |
| 42508 | 42555 | |
| | @@ -42532,10 +42579,13 @@ |
| 42532 | 42579 | if( sqlite3StrICmp(pShmNode->zFilename, pNew->zFilename)==0 ) break; |
| 42533 | 42580 | } |
| 42534 | 42581 | if( pShmNode ){ |
| 42535 | 42582 | sqlite3_free(pNew); |
| 42536 | 42583 | }else{ |
| 42584 | + int inFlags = SQLITE_OPEN_WAL; |
| 42585 | + int outFlags = 0; |
| 42586 | + |
| 42537 | 42587 | pShmNode = pNew; |
| 42538 | 42588 | pNew = 0; |
| 42539 | 42589 | ((winFile*)(&pShmNode->hFile))->h = INVALID_HANDLE_VALUE; |
| 42540 | 42590 | pShmNode->pNext = winShmNodeList; |
| 42541 | 42591 | winShmNodeList = pShmNode; |
| | @@ -42547,29 +42597,23 @@ |
| 42547 | 42597 | goto shm_open_err; |
| 42548 | 42598 | } |
| 42549 | 42599 | } |
| 42550 | 42600 | |
| 42551 | 42601 | if( 0==sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){ |
| 42552 | | - rc2 = winOpen(pDbFd->pVfs, |
| 42553 | | - pShmNode->zFilename, |
| 42554 | | - (sqlite3_file*)&pShmNode->hFile, |
| 42555 | | - SQLITE_OPEN_WAL|SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, |
| 42556 | | - 0); |
| 42557 | | - } |
| 42558 | | - if( rc2!=SQLITE_OK ){ |
| 42559 | | - rc2 = winOpen(pDbFd->pVfs, |
| 42560 | | - pShmNode->zFilename, |
| 42561 | | - (sqlite3_file*)&pShmNode->hFile, |
| 42562 | | - SQLITE_OPEN_WAL|SQLITE_OPEN_READONLY, |
| 42563 | | - 0); |
| 42564 | | - if( rc2!=SQLITE_OK ){ |
| 42565 | | - rc = winLogError(rc2, osGetLastError(), "winOpenShm", |
| 42566 | | - pShmNode->zFilename); |
| 42567 | | - goto shm_open_err; |
| 42568 | | - } |
| 42569 | | - pShmNode->isReadonly = 1; |
| 42570 | | - } |
| 42602 | + inFlags |= SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; |
| 42603 | + }else{ |
| 42604 | + inFlags |= SQLITE_OPEN_READONLY; |
| 42605 | + } |
| 42606 | + rc = winOpen(pDbFd->pVfs, pShmNode->zFilename, |
| 42607 | + (sqlite3_file*)&pShmNode->hFile, |
| 42608 | + inFlags, &outFlags); |
| 42609 | + if( rc!=SQLITE_OK ){ |
| 42610 | + rc = winLogError(rc, osGetLastError(), "winOpenShm", |
| 42611 | + pShmNode->zFilename); |
| 42612 | + goto shm_open_err; |
| 42613 | + } |
| 42614 | + if( outFlags==SQLITE_OPEN_READONLY ) pShmNode->isReadonly = 1; |
| 42571 | 42615 | |
| 42572 | 42616 | rc = winLockSharedMemory(pShmNode); |
| 42573 | 42617 | if( rc!=SQLITE_OK && rc!=SQLITE_READONLY_CANTINIT ) goto shm_open_err; |
| 42574 | 42618 | } |
| 42575 | 42619 | |
| | @@ -43751,12 +43795,14 @@ |
| 43751 | 43795 | dwShareMode, |
| 43752 | 43796 | dwCreationDisposition, |
| 43753 | 43797 | &extendedParameters); |
| 43754 | 43798 | if( h!=INVALID_HANDLE_VALUE ) break; |
| 43755 | 43799 | if( isReadWrite ){ |
| 43756 | | - int isRO = 0; |
| 43757 | | - int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); |
| 43800 | + int rc2, isRO = 0; |
| 43801 | + sqlite3BeginBenignMalloc(); |
| 43802 | + rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); |
| 43803 | + sqlite3EndBenignMalloc(); |
| 43758 | 43804 | if( rc2==SQLITE_OK && isRO ) break; |
| 43759 | 43805 | } |
| 43760 | 43806 | }while( winRetryIoerr(&cnt, &lastErrno) ); |
| 43761 | 43807 | #else |
| 43762 | 43808 | do{ |
| | @@ -43766,12 +43812,14 @@ |
| 43766 | 43812 | dwCreationDisposition, |
| 43767 | 43813 | dwFlagsAndAttributes, |
| 43768 | 43814 | NULL); |
| 43769 | 43815 | if( h!=INVALID_HANDLE_VALUE ) break; |
| 43770 | 43816 | if( isReadWrite ){ |
| 43771 | | - int isRO = 0; |
| 43772 | | - int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); |
| 43817 | + int rc2, isRO = 0; |
| 43818 | + sqlite3BeginBenignMalloc(); |
| 43819 | + rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); |
| 43820 | + sqlite3EndBenignMalloc(); |
| 43773 | 43821 | if( rc2==SQLITE_OK && isRO ) break; |
| 43774 | 43822 | } |
| 43775 | 43823 | }while( winRetryIoerr(&cnt, &lastErrno) ); |
| 43776 | 43824 | #endif |
| 43777 | 43825 | } |
| | @@ -43784,12 +43832,14 @@ |
| 43784 | 43832 | dwCreationDisposition, |
| 43785 | 43833 | dwFlagsAndAttributes, |
| 43786 | 43834 | NULL); |
| 43787 | 43835 | if( h!=INVALID_HANDLE_VALUE ) break; |
| 43788 | 43836 | if( isReadWrite ){ |
| 43789 | | - int isRO = 0; |
| 43790 | | - int rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); |
| 43837 | + int rc2, isRO = 0; |
| 43838 | + sqlite3BeginBenignMalloc(); |
| 43839 | + rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); |
| 43840 | + sqlite3EndBenignMalloc(); |
| 43791 | 43841 | if( rc2==SQLITE_OK && isRO ) break; |
| 43792 | 43842 | } |
| 43793 | 43843 | }while( winRetryIoerr(&cnt, &lastErrno) ); |
| 43794 | 43844 | } |
| 43795 | 43845 | #endif |
| | @@ -93290,19 +93340,19 @@ |
| 93290 | 93340 | for(i=0; i<p->nExpr; i++){ |
| 93291 | 93341 | heightOfExpr(p->a[i].pExpr, pnHeight); |
| 93292 | 93342 | } |
| 93293 | 93343 | } |
| 93294 | 93344 | } |
| 93295 | | -static void heightOfSelect(Select *p, int *pnHeight){ |
| 93296 | | - if( p ){ |
| 93345 | +static void heightOfSelect(Select *pSelect, int *pnHeight){ |
| 93346 | + Select *p; |
| 93347 | + for(p=pSelect; p; p=p->pPrior){ |
| 93297 | 93348 | heightOfExpr(p->pWhere, pnHeight); |
| 93298 | 93349 | heightOfExpr(p->pHaving, pnHeight); |
| 93299 | 93350 | heightOfExpr(p->pLimit, pnHeight); |
| 93300 | 93351 | heightOfExprList(p->pEList, pnHeight); |
| 93301 | 93352 | heightOfExprList(p->pGroupBy, pnHeight); |
| 93302 | 93353 | heightOfExprList(p->pOrderBy, pnHeight); |
| 93303 | | - heightOfSelect(p->pPrior, pnHeight); |
| 93304 | 93354 | } |
| 93305 | 93355 | } |
| 93306 | 93356 | |
| 93307 | 93357 | /* |
| 93308 | 93358 | ** Set the Expr.nHeight variable in the structure passed as an |
| | @@ -100084,10 +100134,13 @@ |
| 100084 | 100134 | assert( "BBB"[0]==SQLITE_AFF_TEXT ); |
| 100085 | 100135 | sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0); |
| 100086 | 100136 | sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid); |
| 100087 | 100137 | sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid); |
| 100088 | 100138 | sqlite3VdbeChangeP5(v, OPFLAG_APPEND); |
| 100139 | +#ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 100140 | + sqlite3VdbeChangeP4(v, -1, (char*)pStat1, P4_TABLE); |
| 100141 | +#endif |
| 100089 | 100142 | sqlite3VdbeJumpHere(v, jZeroRows); |
| 100090 | 100143 | } |
| 100091 | 100144 | } |
| 100092 | 100145 | |
| 100093 | 100146 | |
| | @@ -113501,10 +113554,11 @@ |
| 113501 | 113554 | int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*)); |
| 113502 | 113555 | void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*)); |
| 113503 | 113556 | void *(*value_pointer)(sqlite3_value*,const char*); |
| 113504 | 113557 | int (*vtab_nochange)(sqlite3_context*); |
| 113505 | 113558 | int (*value_nochange)(sqlite3_value*); |
| 113559 | + const char *(*vtab_collation)(sqlite3_index_info*,int); |
| 113506 | 113560 | }; |
| 113507 | 113561 | |
| 113508 | 113562 | /* |
| 113509 | 113563 | ** This is the function signature used for all extension entry points. It |
| 113510 | 113564 | ** is also defined in the file "loadext.c". |
| | @@ -113770,10 +113824,11 @@ |
| 113770 | 113824 | #define sqlite3_result_pointer sqlite3_api->result_pointer |
| 113771 | 113825 | #define sqlite3_value_pointer sqlite3_api->value_pointer |
| 113772 | 113826 | /* Version 3.22.0 and later */ |
| 113773 | 113827 | #define sqlite3_vtab_nochange sqlite3_api->vtab_nochange |
| 113774 | 113828 | #define sqlite3_value_nochange sqltie3_api->value_nochange |
| 113829 | +#define sqlite3_vtab_collation sqltie3_api->vtab_collation |
| 113775 | 113830 | #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ |
| 113776 | 113831 | |
| 113777 | 113832 | #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) |
| 113778 | 113833 | /* This case when the file really is being compiled as a loadable |
| 113779 | 113834 | ** extension */ |
| | @@ -114207,11 +114262,12 @@ |
| 114207 | 114262 | sqlite3_bind_pointer, |
| 114208 | 114263 | sqlite3_result_pointer, |
| 114209 | 114264 | sqlite3_value_pointer, |
| 114210 | 114265 | /* Version 3.22.0 and later */ |
| 114211 | 114266 | sqlite3_vtab_nochange, |
| 114212 | | - sqlite3_value_nochange |
| 114267 | + sqlite3_value_nochange, |
| 114268 | + sqlite3_vtab_collation |
| 114213 | 114269 | }; |
| 114214 | 114270 | |
| 114215 | 114271 | /* |
| 114216 | 114272 | ** Attempt to load an SQLite extension library contained in the file |
| 114217 | 114273 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| | @@ -140461,10 +140517,12 @@ |
| 140461 | 140517 | int yygoto; /* The next state */ |
| 140462 | 140518 | int yyact; /* The next action */ |
| 140463 | 140519 | yyStackEntry *yymsp; /* The top of the parser's stack */ |
| 140464 | 140520 | int yysize; /* Amount to pop the stack */ |
| 140465 | 140521 | sqlite3ParserARG_FETCH; |
| 140522 | + (void)yyLookahead; |
| 140523 | + (void)yyLookaheadToken; |
| 140466 | 140524 | yymsp = yypParser->yytos; |
| 140467 | 140525 | #ifndef NDEBUG |
| 140468 | 140526 | if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ |
| 140469 | 140527 | yysize = yyRuleInfo[yyruleno].nrhs; |
| 140470 | 140528 | if( yysize ){ |
| | @@ -143275,10 +143333,14 @@ |
| 143275 | 143333 | ** |
| 143276 | 143334 | ** This header file is used by programs that want to link against the |
| 143277 | 143335 | ** RTREE library. All it does is declare the sqlite3RtreeInit() interface. |
| 143278 | 143336 | */ |
| 143279 | 143337 | /* #include "sqlite3.h" */ |
| 143338 | + |
| 143339 | +#ifdef SQLITE_OMIT_VIRTUALTABLE |
| 143340 | +# undef SQLITE_ENABLE_RTREE |
| 143341 | +#endif |
| 143280 | 143342 | |
| 143281 | 143343 | #if 0 |
| 143282 | 143344 | extern "C" { |
| 143283 | 143345 | #endif /* __cplusplus */ |
| 143284 | 143346 | |
| | @@ -167030,11 +167092,12 @@ |
| 167030 | 167092 | ** of 4-byte coordinates. For leaf nodes the integer is the rowid |
| 167031 | 167093 | ** of a record. For internal nodes it is the node number of a |
| 167032 | 167094 | ** child page. |
| 167033 | 167095 | */ |
| 167034 | 167096 | |
| 167035 | | -#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RTREE) |
| 167097 | +#if !defined(SQLITE_CORE) \ |
| 167098 | + || (defined(SQLITE_ENABLE_RTREE) && !defined(SQLITE_OMIT_VIRTUALTABLE)) |
| 167036 | 167099 | |
| 167037 | 167100 | #ifndef SQLITE_CORE |
| 167038 | 167101 | /* #include "sqlite3ext.h" */ |
| 167039 | 167102 | SQLITE_EXTENSION_INIT1 |
| 167040 | 167103 | #else |
| | @@ -178688,10 +178751,11 @@ |
| 178688 | 178751 | int bIndirect; /* True if all changes are indirect */ |
| 178689 | 178752 | int bAutoAttach; /* True to auto-attach tables */ |
| 178690 | 178753 | int rc; /* Non-zero if an error has occurred */ |
| 178691 | 178754 | void *pFilterCtx; /* First argument to pass to xTableFilter */ |
| 178692 | 178755 | int (*xTableFilter)(void *pCtx, const char *zTab); |
| 178756 | + sqlite3_value *pZeroBlob; /* Value containing X'' */ |
| 178693 | 178757 | sqlite3_session *pNext; /* Next session object on same db. */ |
| 178694 | 178758 | SessionTable *pTable; /* List of attached tables */ |
| 178695 | 178759 | SessionHook hook; /* APIs to grab new and old data with */ |
| 178696 | 178760 | }; |
| 178697 | 178761 | |
| | @@ -178755,10 +178819,11 @@ |
| 178755 | 178819 | */ |
| 178756 | 178820 | struct SessionTable { |
| 178757 | 178821 | SessionTable *pNext; |
| 178758 | 178822 | char *zName; /* Local name of table */ |
| 178759 | 178823 | int nCol; /* Number of columns in table zName */ |
| 178824 | + int bStat1; /* True if this is sqlite_stat1 */ |
| 178760 | 178825 | const char **azCol; /* Column names */ |
| 178761 | 178826 | u8 *abPK; /* Array of primary key flags */ |
| 178762 | 178827 | int nEntry; /* Total number of entries in hash table */ |
| 178763 | 178828 | int nChange; /* Size of apChange[] array */ |
| 178764 | 178829 | SessionChange **apChange; /* Hash table buckets */ |
| | @@ -179138,10 +179203,11 @@ |
| 179138 | 179203 | n = sqlite3_value_bytes(pVal); |
| 179139 | 179204 | if( !z && (eType!=SQLITE_BLOB || n>0) ) return SQLITE_NOMEM; |
| 179140 | 179205 | h = sessionHashAppendBlob(h, n, z); |
| 179141 | 179206 | }else{ |
| 179142 | 179207 | assert( eType==SQLITE_NULL ); |
| 179208 | + assert( pTab->bStat1==0 || i!=1 ); |
| 179143 | 179209 | *pbNullPK = 1; |
| 179144 | 179210 | } |
| 179145 | 179211 | } |
| 179146 | 179212 | } |
| 179147 | 179213 | |
| | @@ -179480,11 +179546,10 @@ |
| 179480 | 179546 | }else{ |
| 179481 | 179547 | z = sqlite3_value_blob(pVal); |
| 179482 | 179548 | } |
| 179483 | 179549 | if( memcmp(a, z, n) ) return 0; |
| 179484 | 179550 | a += n; |
| 179485 | | - break; |
| 179486 | 179551 | } |
| 179487 | 179552 | } |
| 179488 | 179553 | } |
| 179489 | 179554 | |
| 179490 | 179555 | return 1; |
| | @@ -179690,14 +179755,58 @@ |
| 179690 | 179755 | if( abPK[i] ){ |
| 179691 | 179756 | pTab->abPK = abPK; |
| 179692 | 179757 | break; |
| 179693 | 179758 | } |
| 179694 | 179759 | } |
| 179760 | + if( 0==sqlite3_stricmp("sqlite_stat1", pTab->zName) ){ |
| 179761 | + pTab->bStat1 = 1; |
| 179762 | + } |
| 179695 | 179763 | } |
| 179696 | 179764 | } |
| 179697 | 179765 | return (pSession->rc || pTab->abPK==0); |
| 179698 | 179766 | } |
| 179767 | + |
| 179768 | +/* |
| 179769 | +** Versions of the four methods in object SessionHook for use with the |
| 179770 | +** sqlite_stat1 table. The purpose of this is to substitute a zero-length |
| 179771 | +** blob each time a NULL value is read from the "idx" column of the |
| 179772 | +** sqlite_stat1 table. |
| 179773 | +*/ |
| 179774 | +typedef struct SessionStat1Ctx SessionStat1Ctx; |
| 179775 | +struct SessionStat1Ctx { |
| 179776 | + SessionHook hook; |
| 179777 | + sqlite3_session *pSession; |
| 179778 | +}; |
| 179779 | +static int sessionStat1Old(void *pCtx, int iCol, sqlite3_value **ppVal){ |
| 179780 | + SessionStat1Ctx *p = (SessionStat1Ctx*)pCtx; |
| 179781 | + sqlite3_value *pVal = 0; |
| 179782 | + int rc = p->hook.xOld(p->hook.pCtx, iCol, &pVal); |
| 179783 | + if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){ |
| 179784 | + pVal = p->pSession->pZeroBlob; |
| 179785 | + } |
| 179786 | + *ppVal = pVal; |
| 179787 | + return rc; |
| 179788 | +} |
| 179789 | +static int sessionStat1New(void *pCtx, int iCol, sqlite3_value **ppVal){ |
| 179790 | + SessionStat1Ctx *p = (SessionStat1Ctx*)pCtx; |
| 179791 | + sqlite3_value *pVal = 0; |
| 179792 | + int rc = p->hook.xNew(p->hook.pCtx, iCol, &pVal); |
| 179793 | + if( rc==SQLITE_OK && iCol==1 && sqlite3_value_type(pVal)==SQLITE_NULL ){ |
| 179794 | + pVal = p->pSession->pZeroBlob; |
| 179795 | + } |
| 179796 | + *ppVal = pVal; |
| 179797 | + return rc; |
| 179798 | +} |
| 179799 | +static int sessionStat1Count(void *pCtx){ |
| 179800 | + SessionStat1Ctx *p = (SessionStat1Ctx*)pCtx; |
| 179801 | + return p->hook.xCount(p->hook.pCtx); |
| 179802 | +} |
| 179803 | +static int sessionStat1Depth(void *pCtx){ |
| 179804 | + SessionStat1Ctx *p = (SessionStat1Ctx*)pCtx; |
| 179805 | + return p->hook.xDepth(p->hook.pCtx); |
| 179806 | +} |
| 179807 | + |
| 179699 | 179808 | |
| 179700 | 179809 | /* |
| 179701 | 179810 | ** This function is only called from with a pre-update-hook reporting a |
| 179702 | 179811 | ** change on table pTab (attached to session pSession). The type of change |
| 179703 | 179812 | ** (UPDATE, INSERT, DELETE) is specified by the first argument. |
| | @@ -179711,10 +179820,11 @@ |
| 179711 | 179820 | SessionTable *pTab /* Table that change applies to */ |
| 179712 | 179821 | ){ |
| 179713 | 179822 | int iHash; |
| 179714 | 179823 | int bNull = 0; |
| 179715 | 179824 | int rc = SQLITE_OK; |
| 179825 | + SessionStat1Ctx stat1; |
| 179716 | 179826 | |
| 179717 | 179827 | if( pSession->rc ) return; |
| 179718 | 179828 | |
| 179719 | 179829 | /* Load table details if required */ |
| 179720 | 179830 | if( sessionInitTable(pSession, pTab) ) return; |
| | @@ -179729,10 +179839,29 @@ |
| 179729 | 179839 | /* Grow the hash table if required */ |
| 179730 | 179840 | if( sessionGrowHash(0, pTab) ){ |
| 179731 | 179841 | pSession->rc = SQLITE_NOMEM; |
| 179732 | 179842 | return; |
| 179733 | 179843 | } |
| 179844 | + |
| 179845 | + if( pTab->bStat1 ){ |
| 179846 | + stat1.hook = pSession->hook; |
| 179847 | + stat1.pSession = pSession; |
| 179848 | + pSession->hook.pCtx = (void*)&stat1; |
| 179849 | + pSession->hook.xNew = sessionStat1New; |
| 179850 | + pSession->hook.xOld = sessionStat1Old; |
| 179851 | + pSession->hook.xCount = sessionStat1Count; |
| 179852 | + pSession->hook.xDepth = sessionStat1Depth; |
| 179853 | + if( pSession->pZeroBlob==0 ){ |
| 179854 | + sqlite3_value *p = sqlite3ValueNew(0); |
| 179855 | + if( p==0 ){ |
| 179856 | + rc = SQLITE_NOMEM; |
| 179857 | + goto error_out; |
| 179858 | + } |
| 179859 | + sqlite3ValueSetStr(p, 0, "", 0, SQLITE_STATIC); |
| 179860 | + pSession->pZeroBlob = p; |
| 179861 | + } |
| 179862 | + } |
| 179734 | 179863 | |
| 179735 | 179864 | /* Calculate the hash-key for this change. If the primary key of the row |
| 179736 | 179865 | ** includes a NULL value, exit early. Such changes are ignored by the |
| 179737 | 179866 | ** session module. */ |
| 179738 | 179867 | rc = sessionPreupdateHash(pSession, pTab, op==SQLITE_INSERT, &iHash, &bNull); |
| | @@ -179819,10 +179948,13 @@ |
| 179819 | 179948 | } |
| 179820 | 179949 | } |
| 179821 | 179950 | |
| 179822 | 179951 | /* If an error has occurred, mark the session object as failed. */ |
| 179823 | 179952 | error_out: |
| 179953 | + if( pTab->bStat1 ){ |
| 179954 | + pSession->hook = stat1.hook; |
| 179955 | + } |
| 179824 | 179956 | if( rc!=SQLITE_OK ){ |
| 179825 | 179957 | pSession->rc = rc; |
| 179826 | 179958 | } |
| 179827 | 179959 | } |
| 179828 | 179960 | |
| | @@ -180280,10 +180412,11 @@ |
| 180280 | 180412 | if( pHead ) sqlite3_preupdate_hook(db, xPreUpdate, (void*)pHead); |
| 180281 | 180413 | break; |
| 180282 | 180414 | } |
| 180283 | 180415 | } |
| 180284 | 180416 | sqlite3_mutex_leave(sqlite3_db_mutex(db)); |
| 180417 | + sqlite3ValueFree(pSession->pZeroBlob); |
| 180285 | 180418 | |
| 180286 | 180419 | /* Delete all attached table objects. And the contents of their |
| 180287 | 180420 | ** associated hash-tables. */ |
| 180288 | 180421 | sessionDeleteTable(pSession->pTable); |
| 180289 | 180422 | |
| | @@ -180747,32 +180880,45 @@ |
| 180747 | 180880 | const char **azCol, /* Names of table columns */ |
| 180748 | 180881 | u8 *abPK, /* PRIMARY KEY array */ |
| 180749 | 180882 | sqlite3_stmt **ppStmt /* OUT: Prepared SELECT statement */ |
| 180750 | 180883 | ){ |
| 180751 | 180884 | int rc = SQLITE_OK; |
| 180752 | | - int i; |
| 180753 | | - const char *zSep = ""; |
| 180754 | | - SessionBuffer buf = {0, 0, 0}; |
| 180755 | | - |
| 180756 | | - sessionAppendStr(&buf, "SELECT * FROM ", &rc); |
| 180757 | | - sessionAppendIdent(&buf, zDb, &rc); |
| 180758 | | - sessionAppendStr(&buf, ".", &rc); |
| 180759 | | - sessionAppendIdent(&buf, zTab, &rc); |
| 180760 | | - sessionAppendStr(&buf, " WHERE ", &rc); |
| 180761 | | - for(i=0; i<nCol; i++){ |
| 180762 | | - if( abPK[i] ){ |
| 180763 | | - sessionAppendStr(&buf, zSep, &rc); |
| 180764 | | - sessionAppendIdent(&buf, azCol[i], &rc); |
| 180765 | | - sessionAppendStr(&buf, " = ?", &rc); |
| 180766 | | - sessionAppendInteger(&buf, i+1, &rc); |
| 180767 | | - zSep = " AND "; |
| 180768 | | - } |
| 180769 | | - } |
| 180770 | | - if( rc==SQLITE_OK ){ |
| 180771 | | - rc = sqlite3_prepare_v2(db, (char *)buf.aBuf, buf.nBuf, ppStmt, 0); |
| 180772 | | - } |
| 180773 | | - sqlite3_free(buf.aBuf); |
| 180885 | + char *zSql = 0; |
| 180886 | + int nSql = -1; |
| 180887 | + |
| 180888 | + if( 0==sqlite3_stricmp("sqlite_stat1", zTab) ){ |
| 180889 | + zSql = sqlite3_mprintf( |
| 180890 | + "SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND " |
| 180891 | + "idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)", zDb |
| 180892 | + ); |
| 180893 | + }else{ |
| 180894 | + int i; |
| 180895 | + const char *zSep = ""; |
| 180896 | + SessionBuffer buf = {0, 0, 0}; |
| 180897 | + |
| 180898 | + sessionAppendStr(&buf, "SELECT * FROM ", &rc); |
| 180899 | + sessionAppendIdent(&buf, zDb, &rc); |
| 180900 | + sessionAppendStr(&buf, ".", &rc); |
| 180901 | + sessionAppendIdent(&buf, zTab, &rc); |
| 180902 | + sessionAppendStr(&buf, " WHERE ", &rc); |
| 180903 | + for(i=0; i<nCol; i++){ |
| 180904 | + if( abPK[i] ){ |
| 180905 | + sessionAppendStr(&buf, zSep, &rc); |
| 180906 | + sessionAppendIdent(&buf, azCol[i], &rc); |
| 180907 | + sessionAppendStr(&buf, " IS ?", &rc); |
| 180908 | + sessionAppendInteger(&buf, i+1, &rc); |
| 180909 | + zSep = " AND "; |
| 180910 | + } |
| 180911 | + } |
| 180912 | + zSql = (char*)buf.aBuf; |
| 180913 | + nSql = buf.nBuf; |
| 180914 | + } |
| 180915 | + |
| 180916 | + if( rc==SQLITE_OK ){ |
| 180917 | + rc = sqlite3_prepare_v2(db, zSql, nSql, ppStmt, 0); |
| 180918 | + } |
| 180919 | + sqlite3_free(zSql); |
| 180774 | 180920 | return rc; |
| 180775 | 180921 | } |
| 180776 | 180922 | |
| 180777 | 180923 | /* |
| 180778 | 180924 | ** Bind the PRIMARY KEY values from the change passed in argument pChange |
| | @@ -181937,11 +182083,11 @@ |
| 181937 | 182083 | sqlite3_stmt *pInsert; /* INSERT statement */ |
| 181938 | 182084 | sqlite3_stmt *pSelect; /* SELECT statement */ |
| 181939 | 182085 | int nCol; /* Size of azCol[] and abPK[] arrays */ |
| 181940 | 182086 | const char **azCol; /* Array of column names */ |
| 181941 | 182087 | u8 *abPK; /* Boolean array - true if column is in PK */ |
| 181942 | | - |
| 182088 | + int bStat1; /* True if table is sqlite_stat1 */ |
| 181943 | 182089 | int bDeferConstraints; /* True to defer constraints */ |
| 181944 | 182090 | SessionBuffer constraints; /* Deferred constraints are stored here */ |
| 181945 | 182091 | }; |
| 181946 | 182092 | |
| 181947 | 182093 | /* |
| | @@ -182106,10 +182252,11 @@ |
| 182106 | 182252 | } |
| 182107 | 182253 | sqlite3_free(buf.aBuf); |
| 182108 | 182254 | |
| 182109 | 182255 | return rc; |
| 182110 | 182256 | } |
| 182257 | + |
| 182111 | 182258 | |
| 182112 | 182259 | /* |
| 182113 | 182260 | ** Formulate and prepare an SQL statement to query table zTab by primary |
| 182114 | 182261 | ** key. Assuming the following table structure: |
| 182115 | 182262 | ** |
| | @@ -182167,10 +182314,51 @@ |
| 182167 | 182314 | rc = sqlite3_prepare_v2(db, (char *)buf.aBuf, buf.nBuf, &p->pInsert, 0); |
| 182168 | 182315 | } |
| 182169 | 182316 | sqlite3_free(buf.aBuf); |
| 182170 | 182317 | return rc; |
| 182171 | 182318 | } |
| 182319 | + |
| 182320 | +static int sessionPrepare(sqlite3 *db, sqlite3_stmt **pp, const char *zSql){ |
| 182321 | + return sqlite3_prepare_v2(db, zSql, -1, pp, 0); |
| 182322 | +} |
| 182323 | + |
| 182324 | +/* |
| 182325 | +** Prepare statements for applying changes to the sqlite_stat1 table. |
| 182326 | +** These are similar to those created by sessionSelectRow(), |
| 182327 | +** sessionInsertRow(), sessionUpdateRow() and sessionDeleteRow() for |
| 182328 | +** other tables. |
| 182329 | +*/ |
| 182330 | +static int sessionStat1Sql(sqlite3 *db, SessionApplyCtx *p){ |
| 182331 | + int rc = sessionSelectRow(db, "sqlite_stat1", p); |
| 182332 | + if( rc==SQLITE_OK ){ |
| 182333 | + rc = sessionPrepare(db, &p->pInsert, |
| 182334 | + "INSERT INTO main.sqlite_stat1 VALUES(?1, " |
| 182335 | + "CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, " |
| 182336 | + "?3)" |
| 182337 | + ); |
| 182338 | + } |
| 182339 | + if( rc==SQLITE_OK ){ |
| 182340 | + rc = sessionPrepare(db, &p->pUpdate, |
| 182341 | + "UPDATE main.sqlite_stat1 SET " |
| 182342 | + "tbl = CASE WHEN ?2 THEN ?3 ELSE tbl END, " |
| 182343 | + "idx = CASE WHEN ?5 THEN ?6 ELSE idx END, " |
| 182344 | + "stat = CASE WHEN ?8 THEN ?9 ELSE stat END " |
| 182345 | + "WHERE tbl=?1 AND idx IS " |
| 182346 | + "CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END " |
| 182347 | + "AND (?10 OR ?8=0 OR stat IS ?7)" |
| 182348 | + ); |
| 182349 | + } |
| 182350 | + if( rc==SQLITE_OK ){ |
| 182351 | + rc = sessionPrepare(db, &p->pDelete, |
| 182352 | + "DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS " |
| 182353 | + "CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END " |
| 182354 | + "AND (?4 OR stat IS ?3)" |
| 182355 | + ); |
| 182356 | + } |
| 182357 | + assert( rc==SQLITE_OK ); |
| 182358 | + return rc; |
| 182359 | +} |
| 182172 | 182360 | |
| 182173 | 182361 | /* |
| 182174 | 182362 | ** A wrapper around sqlite3_bind_value() that detects an extra problem. |
| 182175 | 182363 | ** See comments in the body of this function for details. |
| 182176 | 182364 | */ |
| | @@ -182498,15 +182686,29 @@ |
| 182498 | 182686 | ); |
| 182499 | 182687 | } |
| 182500 | 182688 | |
| 182501 | 182689 | }else{ |
| 182502 | 182690 | assert( op==SQLITE_INSERT ); |
| 182503 | | - rc = sessionBindRow(pIter, sqlite3changeset_new, nCol, 0, p->pInsert); |
| 182504 | | - if( rc!=SQLITE_OK ) return rc; |
| 182691 | + if( p->bStat1 ){ |
| 182692 | + /* Check if there is a conflicting row. For sqlite_stat1, this needs |
| 182693 | + ** to be done using a SELECT, as there is no PRIMARY KEY in the |
| 182694 | + ** database schema to throw an exception if a duplicate is inserted. */ |
| 182695 | + rc = sessionSeekToRow(p->db, pIter, p->abPK, p->pSelect); |
| 182696 | + if( rc==SQLITE_ROW ){ |
| 182697 | + rc = SQLITE_CONSTRAINT; |
| 182698 | + sqlite3_reset(p->pSelect); |
| 182699 | + } |
| 182700 | + } |
| 182505 | 182701 | |
| 182506 | | - sqlite3_step(p->pInsert); |
| 182507 | | - rc = sqlite3_reset(p->pInsert); |
| 182702 | + if( rc==SQLITE_OK ){ |
| 182703 | + rc = sessionBindRow(pIter, sqlite3changeset_new, nCol, 0, p->pInsert); |
| 182704 | + if( rc!=SQLITE_OK ) return rc; |
| 182705 | + |
| 182706 | + sqlite3_step(p->pInsert); |
| 182707 | + rc = sqlite3_reset(p->pInsert); |
| 182708 | + } |
| 182709 | + |
| 182508 | 182710 | if( (rc&0xff)==SQLITE_CONSTRAINT ){ |
| 182509 | 182711 | rc = sessionConflictHandler( |
| 182510 | 182712 | SQLITE_CHANGESET_CONFLICT, p, pIter, xConflict, pCtx, pbReplace |
| 182511 | 182713 | ); |
| 182512 | 182714 | } |
| | @@ -182735,16 +182937,24 @@ |
| 182735 | 182937 | "primary key mismatch for table %s", zTab |
| 182736 | 182938 | ); |
| 182737 | 182939 | } |
| 182738 | 182940 | else{ |
| 182739 | 182941 | sApply.nCol = nCol; |
| 182740 | | - if((rc = sessionSelectRow(db, zTab, &sApply)) |
| 182741 | | - || (rc = sessionUpdateRow(db, zTab, &sApply)) |
| 182742 | | - || (rc = sessionDeleteRow(db, zTab, &sApply)) |
| 182743 | | - || (rc = sessionInsertRow(db, zTab, &sApply)) |
| 182744 | | - ){ |
| 182745 | | - break; |
| 182942 | + if( 0==sqlite3_stricmp(zTab, "sqlite_stat1") ){ |
| 182943 | + if( (rc = sessionStat1Sql(db, &sApply) ) ){ |
| 182944 | + break; |
| 182945 | + } |
| 182946 | + sApply.bStat1 = 1; |
| 182947 | + }else{ |
| 182948 | + if((rc = sessionSelectRow(db, zTab, &sApply)) |
| 182949 | + || (rc = sessionUpdateRow(db, zTab, &sApply)) |
| 182950 | + || (rc = sessionDeleteRow(db, zTab, &sApply)) |
| 182951 | + || (rc = sessionInsertRow(db, zTab, &sApply)) |
| 182952 | + ){ |
| 182953 | + break; |
| 182954 | + } |
| 182955 | + sApply.bStat1 = 0; |
| 182746 | 182956 | } |
| 182747 | 182957 | } |
| 182748 | 182958 | nTab = sqlite3Strlen30(zTab); |
| 182749 | 182959 | } |
| 182750 | 182960 | } |
| | @@ -188063,10 +188273,12 @@ |
| 188063 | 188273 | int fts5yygoto; /* The next state */ |
| 188064 | 188274 | int fts5yyact; /* The next action */ |
| 188065 | 188275 | fts5yyStackEntry *fts5yymsp; /* The top of the parser's stack */ |
| 188066 | 188276 | int fts5yysize; /* Amount to pop the stack */ |
| 188067 | 188277 | sqlite3Fts5ParserARG_FETCH; |
| 188278 | + (void)fts5yyLookahead; |
| 188279 | + (void)fts5yyLookaheadToken; |
| 188068 | 188280 | fts5yymsp = fts5yypParser->fts5yytos; |
| 188069 | 188281 | #ifndef NDEBUG |
| 188070 | 188282 | if( fts5yyTraceFILE && fts5yyruleno<(int)(sizeof(fts5yyRuleName)/sizeof(fts5yyRuleName[0])) ){ |
| 188071 | 188283 | fts5yysize = fts5yyRuleInfo[fts5yyruleno].nrhs; |
| 188072 | 188284 | if( fts5yysize ){ |
| | @@ -203116,11 +203328,11 @@ |
| 203116 | 203328 | int nArg, /* Number of args */ |
| 203117 | 203329 | sqlite3_value **apUnused /* Function arguments */ |
| 203118 | 203330 | ){ |
| 203119 | 203331 | assert( nArg==0 ); |
| 203120 | 203332 | UNUSED_PARAM2(nArg, apUnused); |
| 203121 | | - sqlite3_result_text(pCtx, "fts5: 2018-01-16 13:37:43 feb2c2b6f66b0f45490beb1642d99cdb89fa220e299a8c118929df557c814189", -1, SQLITE_TRANSIENT); |
| 203333 | + sqlite3_result_text(pCtx, "fts5: 2018-01-20 15:48:45 136bf323e42dc90e1780199a381bcbb084b069eca5c7343ee6fc6e2550831536", -1, SQLITE_TRANSIENT); |
| 203122 | 203334 | } |
| 203123 | 203335 | |
| 203124 | 203336 | static int fts5Init(sqlite3 *db){ |
| 203125 | 203337 | static const sqlite3_module fts5Mod = { |
| 203126 | 203338 | /* iVersion */ 2, |
| | @@ -207384,12 +207596,12 @@ |
| 207384 | 207596 | } |
| 207385 | 207597 | #endif /* SQLITE_CORE */ |
| 207386 | 207598 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 207387 | 207599 | |
| 207388 | 207600 | /************** End of stmt.c ************************************************/ |
| 207389 | | -#if __LINE__!=207389 |
| 207601 | +#if __LINE__!=207601 |
| 207390 | 207602 | #undef SQLITE_SOURCE_ID |
| 207391 | | -#define SQLITE_SOURCE_ID "2018-01-16 13:37:43 feb2c2b6f66b0f45490beb1642d99cdb89fa220e299a8c118929df557c81alt2" |
| 207603 | +#define SQLITE_SOURCE_ID "2018-01-20 15:48:45 136bf323e42dc90e1780199a381bcbb084b069eca5c7343ee6fc6e255083alt2" |
| 207392 | 207604 | #endif |
| 207393 | 207605 | /* Return the source-id for this library */ |
| 207394 | 207606 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 207395 | 207607 | /************************** End of sqlite3.c ******************************/ |
| 207396 | 207608 | |