Fossil SCM
Update to the latest pre-release of SQLite 3.18.0 that includes a fix for the harmless compiler warning on Macs.
Commit
9612d43f930926c42b352a7c5990a2d7fb8976fe2292083542da38f3d23fe758
Parent
8c22e1bbcd8ec04…
2 files changed
+94
-46
+5
-4
+94
-46
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -398,11 +398,11 @@ | ||
| 398 | 398 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 399 | 399 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 400 | 400 | */ |
| 401 | 401 | #define SQLITE_VERSION "3.18.0" |
| 402 | 402 | #define SQLITE_VERSION_NUMBER 3018000 |
| 403 | -#define SQLITE_SOURCE_ID "2017-03-16 14:28:52 6d85eb5736781b43aa674d9544c7523b849b4e634f371702f8764b33e22e1e9f" | |
| 403 | +#define SQLITE_SOURCE_ID "2017-03-18 13:59:46 4e6a03d9e12b120d15946b025f97a97697cb8e8af543c238ffda220c9e3f28f4" | |
| 404 | 404 | |
| 405 | 405 | /* |
| 406 | 406 | ** CAPI3REF: Run-Time Library Version Numbers |
| 407 | 407 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 408 | 408 | ** |
| @@ -3699,13 +3699,13 @@ | ||
| 3699 | 3699 | ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> |
| 3700 | 3700 | ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ |
| 3701 | 3701 | ** |
| 3702 | 3702 | ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> |
| 3703 | 3703 | ** <dd>The maximum number of instructions in a virtual machine program |
| 3704 | -** used to implement an SQL statement. This limit is not currently | |
| 3705 | -** enforced, though that might be added in some future release of | |
| 3706 | -** SQLite.</dd>)^ | |
| 3704 | +** used to implement an SQL statement. If [sqlite3_prepare_v2()] or | |
| 3705 | +** the equivalent tries to allocate space for more than this many opcodes | |
| 3706 | +** in a single prepared statement, an SQLITE_NOMEM error is returned.</dd>)^ | |
| 3707 | 3707 | ** |
| 3708 | 3708 | ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> |
| 3709 | 3709 | ** <dd>The maximum number of arguments on a function.</dd>)^ |
| 3710 | 3710 | ** |
| 3711 | 3711 | ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt> |
| @@ -3738,10 +3738,11 @@ | ||
| 3738 | 3738 | #define SQLITE_LIMIT_ATTACHED 7 |
| 3739 | 3739 | #define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 |
| 3740 | 3740 | #define SQLITE_LIMIT_VARIABLE_NUMBER 9 |
| 3741 | 3741 | #define SQLITE_LIMIT_TRIGGER_DEPTH 10 |
| 3742 | 3742 | #define SQLITE_LIMIT_WORKER_THREADS 11 |
| 3743 | + | |
| 3743 | 3744 | |
| 3744 | 3745 | /* |
| 3745 | 3746 | ** CAPI3REF: Compiling An SQL Statement |
| 3746 | 3747 | ** KEYWORDS: {SQL statement compiler} |
| 3747 | 3748 | ** METHOD: sqlite3 |
| @@ -10866,11 +10867,11 @@ | ||
| 10866 | 10867 | /* |
| 10867 | 10868 | ** The maximum number of opcodes in a VDBE program. |
| 10868 | 10869 | ** Not currently enforced. |
| 10869 | 10870 | */ |
| 10870 | 10871 | #ifndef SQLITE_MAX_VDBE_OP |
| 10871 | -# define SQLITE_MAX_VDBE_OP 25000 | |
| 10872 | +# define SQLITE_MAX_VDBE_OP 250000000 | |
| 10872 | 10873 | #endif |
| 10873 | 10874 | |
| 10874 | 10875 | /* |
| 10875 | 10876 | ** The maximum number of arguments to an SQL function. |
| 10876 | 10877 | */ |
| @@ -17487,10 +17488,16 @@ | ||
| 17487 | 17488 | "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE), |
| 17488 | 17489 | #endif |
| 17489 | 17490 | #if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc) |
| 17490 | 17491 | "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE), |
| 17491 | 17492 | #endif |
| 17493 | +#if SQLITE_DEFAULT_SYNCHRONOUS | |
| 17494 | + "DEFAULT_SYNCHRONOUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_SYNCHRONOUS), | |
| 17495 | +#endif | |
| 17496 | +#if SQLITE_DEFAULT_WAL_SYNCHRONOUS | |
| 17497 | + "DEFAULT_WAL_SYNCHRONOUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_WAL_SYNCHRONOUS), | |
| 17498 | +#endif | |
| 17492 | 17499 | #if SQLITE_DIRECT_OVERFLOW_READ |
| 17493 | 17500 | "DIRECT_OVERFLOW_READ", |
| 17494 | 17501 | #endif |
| 17495 | 17502 | #if SQLITE_DISABLE_DIRSYNC |
| 17496 | 17503 | "DISABLE_DIRSYNC", |
| @@ -20667,11 +20674,13 @@ | ||
| 20667 | 20674 | ** Use the zone allocator available on apple products unless the |
| 20668 | 20675 | ** SQLITE_WITHOUT_ZONEMALLOC symbol is defined. |
| 20669 | 20676 | */ |
| 20670 | 20677 | #include <sys/sysctl.h> |
| 20671 | 20678 | #include <malloc/malloc.h> |
| 20679 | +#ifdef SQLITE_MIGHT_BE_SINGLE_CORE | |
| 20672 | 20680 | #include <libkern/OSAtomic.h> |
| 20681 | +#endif /* SQLITE_MIGHT_BE_SINGLE_CORE */ | |
| 20673 | 20682 | static malloc_zone_t* _sqliteZone_; |
| 20674 | 20683 | #define SQLITE_MALLOC(x) malloc_zone_malloc(_sqliteZone_, (x)) |
| 20675 | 20684 | #define SQLITE_FREE(x) malloc_zone_free(_sqliteZone_, (x)); |
| 20676 | 20685 | #define SQLITE_REALLOC(x,y) malloc_zone_realloc(_sqliteZone_, (x), (y)) |
| 20677 | 20686 | #define SQLITE_MALLOCSIZE(x) \ |
| @@ -20846,37 +20855,50 @@ | ||
| 20846 | 20855 | /* |
| 20847 | 20856 | ** Initialize this module. |
| 20848 | 20857 | */ |
| 20849 | 20858 | static int sqlite3MemInit(void *NotUsed){ |
| 20850 | 20859 | #if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) |
| 20851 | - int cpuCount; | |
| 20852 | - size_t len; | |
| 20853 | 20860 | if( _sqliteZone_ ){ |
| 20854 | 20861 | return SQLITE_OK; |
| 20855 | 20862 | } |
| 20856 | - len = sizeof(cpuCount); | |
| 20857 | - /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ | |
| 20858 | - sysctlbyname("hw.ncpu", &cpuCount, &len, NULL, 0); | |
| 20859 | - if( cpuCount>1 ){ | |
| 20860 | - /* defer MT decisions to system malloc */ | |
| 20861 | - _sqliteZone_ = malloc_default_zone(); | |
| 20862 | - }else{ | |
| 20863 | - /* only 1 core, use our own zone to contention over global locks, | |
| 20864 | - ** e.g. we have our own dedicated locks */ | |
| 20865 | - bool success; | |
| 20866 | - malloc_zone_t* newzone = malloc_create_zone(4096, 0); | |
| 20867 | - malloc_set_zone_name(newzone, "Sqlite_Heap"); | |
| 20868 | - do{ | |
| 20869 | - success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, | |
| 20870 | - (void * volatile *)&_sqliteZone_); | |
| 20871 | - }while(!_sqliteZone_); | |
| 20872 | - if( !success ){ | |
| 20873 | - /* somebody registered a zone first */ | |
| 20874 | - malloc_destroy_zone(newzone); | |
| 20875 | - } | |
| 20876 | - } | |
| 20877 | -#endif | |
| 20863 | +#ifndef SQLITE_MIGHT_BE_SINGLE_CORE | |
| 20864 | + /* If not compiled with the SQLITE_MIGHT_BE_SINGLE_CORE flag, assume | |
| 20865 | + ** that multiple cores are always available. This is the default case. | |
| 20866 | + */ | |
| 20867 | + _sqliteZone_ = malloc_default_zone(); | |
| 20868 | +#else | |
| 20869 | + /* With the SQLITE_MIGHT_BE_SINGLE_CORE compile-time option, check the | |
| 20870 | + ** number of cores. Different malloc() strategies are used for single-core and | |
| 20871 | + ** multi-core machines. | |
| 20872 | + */ | |
| 20873 | + { | |
| 20874 | + int cpuCount; | |
| 20875 | + size_t len; | |
| 20876 | + len = sizeof(cpuCount); | |
| 20877 | + /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ | |
| 20878 | + sysctlbyname("hw.ncpu", &cpuCount, &len, NULL, 0); | |
| 20879 | + if( cpuCount>1 ){ | |
| 20880 | + /* defer MT decisions to system malloc */ | |
| 20881 | + _sqliteZone_ = malloc_default_zone(); | |
| 20882 | + }else{ | |
| 20883 | + /* only 1 core, use our own zone to contention over global locks, | |
| 20884 | + ** e.g. we have our own dedicated locks */ | |
| 20885 | + bool success; | |
| 20886 | + malloc_zone_t* newzone = malloc_create_zone(4096, 0); | |
| 20887 | + malloc_set_zone_name(newzone, "Sqlite_Heap"); | |
| 20888 | + do{ | |
| 20889 | + success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, | |
| 20890 | + (void * volatile *)&_sqliteZone_); | |
| 20891 | + }while(!_sqliteZone_); | |
| 20892 | + if( !success ){ | |
| 20893 | + /* somebody registered a zone first */ | |
| 20894 | + malloc_destroy_zone(newzone); | |
| 20895 | + } | |
| 20896 | + } | |
| 20897 | + } | |
| 20898 | +#endif /* SQLITE_MIGHT_BE_SINGLE_CORE */ | |
| 20899 | +#endif /* defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) */ | |
| 20878 | 20900 | UNUSED_PARAMETER(NotUsed); |
| 20879 | 20901 | return SQLITE_OK; |
| 20880 | 20902 | } |
| 20881 | 20903 | |
| 20882 | 20904 | /* |
| @@ -61814,10 +61836,35 @@ | ||
| 61814 | 61836 | sqlite3BtreeLeave(p); |
| 61815 | 61837 | return rc; |
| 61816 | 61838 | #endif |
| 61817 | 61839 | } |
| 61818 | 61840 | |
| 61841 | +/* | |
| 61842 | +** If the user has not set the safety-level for this database connection | |
| 61843 | +** using "PRAGMA synchronous", and if the safety-level is not already | |
| 61844 | +** set to the value passed to this function as the second parameter, | |
| 61845 | +** set it so. | |
| 61846 | +*/ | |
| 61847 | +#if SQLITE_DEFAULT_SYNCHRONOUS!=SQLITE_DEFAULT_WAL_SYNCHRONOUS | |
| 61848 | +static void setDefaultSyncFlag(BtShared *pBt, u8 safety_level){ | |
| 61849 | + sqlite3 *db; | |
| 61850 | + Db *pDb; | |
| 61851 | + if( (db=pBt->db)!=0 && (pDb=db->aDb)!=0 ){ | |
| 61852 | + while( pDb->pBt==0 || pDb->pBt->pBt!=pBt ){ pDb++; } | |
| 61853 | + if( pDb->bSyncSet==0 | |
| 61854 | + && pDb->safety_level!=safety_level | |
| 61855 | + && pDb!=&db->aDb[1] | |
| 61856 | + ){ | |
| 61857 | + pDb->safety_level = safety_level; | |
| 61858 | + sqlite3PagerSetFlags(pBt->pPager, | |
| 61859 | + pDb->safety_level | (db->flags & PAGER_FLAGS_MASK)); | |
| 61860 | + } | |
| 61861 | + } | |
| 61862 | +} | |
| 61863 | +#else | |
| 61864 | +# define setDefaultSyncFlag(pBt,safety_level) | |
| 61865 | +#endif | |
| 61819 | 61866 | |
| 61820 | 61867 | /* |
| 61821 | 61868 | ** Get a reference to pPage1 of the database file. This will |
| 61822 | 61869 | ** also acquire a readlock on that file. |
| 61823 | 61870 | ** |
| @@ -61887,30 +61934,19 @@ | ||
| 61887 | 61934 | int isOpen = 0; |
| 61888 | 61935 | rc = sqlite3PagerOpenWal(pBt->pPager, &isOpen); |
| 61889 | 61936 | if( rc!=SQLITE_OK ){ |
| 61890 | 61937 | goto page1_init_failed; |
| 61891 | 61938 | }else{ |
| 61892 | -#if SQLITE_DEFAULT_SYNCHRONOUS!=SQLITE_DEFAULT_WAL_SYNCHRONOUS | |
| 61893 | - sqlite3 *db; | |
| 61894 | - Db *pDb; | |
| 61895 | - if( (db=pBt->db)!=0 && (pDb=db->aDb)!=0 ){ | |
| 61896 | - while( pDb->pBt==0 || pDb->pBt->pBt!=pBt ){ pDb++; } | |
| 61897 | - if( pDb->bSyncSet==0 | |
| 61898 | - && pDb->safety_level==SQLITE_DEFAULT_SYNCHRONOUS+1 | |
| 61899 | - ){ | |
| 61900 | - pDb->safety_level = SQLITE_DEFAULT_WAL_SYNCHRONOUS+1; | |
| 61901 | - sqlite3PagerSetFlags(pBt->pPager, | |
| 61902 | - pDb->safety_level | (db->flags & PAGER_FLAGS_MASK)); | |
| 61903 | - } | |
| 61904 | - } | |
| 61905 | -#endif | |
| 61939 | + setDefaultSyncFlag(pBt, SQLITE_DEFAULT_WAL_SYNCHRONOUS+1); | |
| 61906 | 61940 | if( isOpen==0 ){ |
| 61907 | 61941 | releasePage(pPage1); |
| 61908 | 61942 | return SQLITE_OK; |
| 61909 | 61943 | } |
| 61910 | 61944 | } |
| 61911 | 61945 | rc = SQLITE_NOTADB; |
| 61946 | + }else{ | |
| 61947 | + setDefaultSyncFlag(pBt, SQLITE_DEFAULT_SYNCHRONOUS+1); | |
| 61912 | 61948 | } |
| 61913 | 61949 | #endif |
| 61914 | 61950 | |
| 61915 | 61951 | /* EVIDENCE-OF: R-15465-20813 The maximum and minimum embedded payload |
| 61916 | 61952 | ** fractions and the leaf payload fraction values must be 64, 32, and 32. |
| @@ -71426,10 +71462,16 @@ | ||
| 71426 | 71462 | int nNew = (p->nOpAlloc>=512 ? p->nOpAlloc*2 : p->nOpAlloc+nOp); |
| 71427 | 71463 | #else |
| 71428 | 71464 | int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op))); |
| 71429 | 71465 | UNUSED_PARAMETER(nOp); |
| 71430 | 71466 | #endif |
| 71467 | + | |
| 71468 | + /* Ensure that the size of a VDBE does not grow too large */ | |
| 71469 | + if( nNew > p->db->aLimit[SQLITE_LIMIT_VDBE_OP] ){ | |
| 71470 | + sqlite3OomFault(p->db); | |
| 71471 | + return SQLITE_NOMEM; | |
| 71472 | + } | |
| 71431 | 71473 | |
| 71432 | 71474 | assert( nOp<=(1024/sizeof(Op)) ); |
| 71433 | 71475 | assert( nNew>=(p->nOpAlloc+nOp) ); |
| 71434 | 71476 | pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op)); |
| 71435 | 71477 | if( pNew ){ |
| @@ -80816,12 +80858,17 @@ | ||
| 80816 | 80858 | /* Content is irrelevant for |
| 80817 | 80859 | ** 1. the typeof() function, |
| 80818 | 80860 | ** 2. the length(X) function if X is a blob, and |
| 80819 | 80861 | ** 3. if the content length is zero. |
| 80820 | 80862 | ** So we might as well use bogus content rather than reading |
| 80821 | - ** content from disk. */ | |
| 80822 | - static u8 aZero[8]; /* This is the bogus content */ | |
| 80863 | + ** content from disk. | |
| 80864 | + ** | |
| 80865 | + ** Although sqlite3VdbeSerialGet() may read at most 8 bytes from the | |
| 80866 | + ** buffer passed to it, debugging function VdbeMemPrettyPrint() may | |
| 80867 | + ** read up to 16. So 16 bytes of bogus content is supplied. | |
| 80868 | + */ | |
| 80869 | + static u8 aZero[16]; /* This is the bogus content */ | |
| 80823 | 80870 | sqlite3VdbeSerialGet(aZero, t, pDest); |
| 80824 | 80871 | }else{ |
| 80825 | 80872 | rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, aOffset[p2], len, pDest); |
| 80826 | 80873 | if( rc!=SQLITE_OK ) goto abort_due_to_error; |
| 80827 | 80874 | sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest); |
| @@ -114404,10 +114451,11 @@ | ||
| 114404 | 114451 | Index *pPrior = 0; |
| 114405 | 114452 | int loopTop; |
| 114406 | 114453 | int iDataCur, iIdxCur; |
| 114407 | 114454 | int r1 = -1; |
| 114408 | 114455 | |
| 114456 | + if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */ | |
| 114409 | 114457 | if( pTab->pCheck==0 |
| 114410 | 114458 | && (pTab->tabFlags & TF_HasNotNull)==0 |
| 114411 | 114459 | && (pTab->pIndex==0 || isQuick) |
| 114412 | 114460 | ){ |
| 114413 | 114461 | continue; /* No additional checks needed for this table */ |
| @@ -198072,11 +198120,11 @@ | ||
| 198072 | 198120 | int nArg, /* Number of args */ |
| 198073 | 198121 | sqlite3_value **apUnused /* Function arguments */ |
| 198074 | 198122 | ){ |
| 198075 | 198123 | assert( nArg==0 ); |
| 198076 | 198124 | UNUSED_PARAM2(nArg, apUnused); |
| 198077 | - sqlite3_result_text(pCtx, "fts5: 2017-03-16 14:28:52 6d85eb5736781b43aa674d9544c7523b849b4e634f371702f8764b33e22e1e9f", -1, SQLITE_TRANSIENT); | |
| 198125 | + sqlite3_result_text(pCtx, "fts5: 2017-03-17 14:59:40 626bdca98e0cd78ae873d97e75bb7d544ca18759c9f1e67f4adf03daca7fe5bf", -1, SQLITE_TRANSIENT); | |
| 198078 | 198126 | } |
| 198079 | 198127 | |
| 198080 | 198128 | static int fts5Init(sqlite3 *db){ |
| 198081 | 198129 | static const sqlite3_module fts5Mod = { |
| 198082 | 198130 | /* iVersion */ 2, |
| 198083 | 198131 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -398,11 +398,11 @@ | |
| 398 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 399 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 400 | */ |
| 401 | #define SQLITE_VERSION "3.18.0" |
| 402 | #define SQLITE_VERSION_NUMBER 3018000 |
| 403 | #define SQLITE_SOURCE_ID "2017-03-16 14:28:52 6d85eb5736781b43aa674d9544c7523b849b4e634f371702f8764b33e22e1e9f" |
| 404 | |
| 405 | /* |
| 406 | ** CAPI3REF: Run-Time Library Version Numbers |
| 407 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 408 | ** |
| @@ -3699,13 +3699,13 @@ | |
| 3699 | ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> |
| 3700 | ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ |
| 3701 | ** |
| 3702 | ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> |
| 3703 | ** <dd>The maximum number of instructions in a virtual machine program |
| 3704 | ** used to implement an SQL statement. This limit is not currently |
| 3705 | ** enforced, though that might be added in some future release of |
| 3706 | ** SQLite.</dd>)^ |
| 3707 | ** |
| 3708 | ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> |
| 3709 | ** <dd>The maximum number of arguments on a function.</dd>)^ |
| 3710 | ** |
| 3711 | ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt> |
| @@ -3738,10 +3738,11 @@ | |
| 3738 | #define SQLITE_LIMIT_ATTACHED 7 |
| 3739 | #define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 |
| 3740 | #define SQLITE_LIMIT_VARIABLE_NUMBER 9 |
| 3741 | #define SQLITE_LIMIT_TRIGGER_DEPTH 10 |
| 3742 | #define SQLITE_LIMIT_WORKER_THREADS 11 |
| 3743 | |
| 3744 | /* |
| 3745 | ** CAPI3REF: Compiling An SQL Statement |
| 3746 | ** KEYWORDS: {SQL statement compiler} |
| 3747 | ** METHOD: sqlite3 |
| @@ -10866,11 +10867,11 @@ | |
| 10866 | /* |
| 10867 | ** The maximum number of opcodes in a VDBE program. |
| 10868 | ** Not currently enforced. |
| 10869 | */ |
| 10870 | #ifndef SQLITE_MAX_VDBE_OP |
| 10871 | # define SQLITE_MAX_VDBE_OP 25000 |
| 10872 | #endif |
| 10873 | |
| 10874 | /* |
| 10875 | ** The maximum number of arguments to an SQL function. |
| 10876 | */ |
| @@ -17487,10 +17488,16 @@ | |
| 17487 | "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE), |
| 17488 | #endif |
| 17489 | #if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc) |
| 17490 | "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE), |
| 17491 | #endif |
| 17492 | #if SQLITE_DIRECT_OVERFLOW_READ |
| 17493 | "DIRECT_OVERFLOW_READ", |
| 17494 | #endif |
| 17495 | #if SQLITE_DISABLE_DIRSYNC |
| 17496 | "DISABLE_DIRSYNC", |
| @@ -20667,11 +20674,13 @@ | |
| 20667 | ** Use the zone allocator available on apple products unless the |
| 20668 | ** SQLITE_WITHOUT_ZONEMALLOC symbol is defined. |
| 20669 | */ |
| 20670 | #include <sys/sysctl.h> |
| 20671 | #include <malloc/malloc.h> |
| 20672 | #include <libkern/OSAtomic.h> |
| 20673 | static malloc_zone_t* _sqliteZone_; |
| 20674 | #define SQLITE_MALLOC(x) malloc_zone_malloc(_sqliteZone_, (x)) |
| 20675 | #define SQLITE_FREE(x) malloc_zone_free(_sqliteZone_, (x)); |
| 20676 | #define SQLITE_REALLOC(x,y) malloc_zone_realloc(_sqliteZone_, (x), (y)) |
| 20677 | #define SQLITE_MALLOCSIZE(x) \ |
| @@ -20846,37 +20855,50 @@ | |
| 20846 | /* |
| 20847 | ** Initialize this module. |
| 20848 | */ |
| 20849 | static int sqlite3MemInit(void *NotUsed){ |
| 20850 | #if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) |
| 20851 | int cpuCount; |
| 20852 | size_t len; |
| 20853 | if( _sqliteZone_ ){ |
| 20854 | return SQLITE_OK; |
| 20855 | } |
| 20856 | len = sizeof(cpuCount); |
| 20857 | /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ |
| 20858 | sysctlbyname("hw.ncpu", &cpuCount, &len, NULL, 0); |
| 20859 | if( cpuCount>1 ){ |
| 20860 | /* defer MT decisions to system malloc */ |
| 20861 | _sqliteZone_ = malloc_default_zone(); |
| 20862 | }else{ |
| 20863 | /* only 1 core, use our own zone to contention over global locks, |
| 20864 | ** e.g. we have our own dedicated locks */ |
| 20865 | bool success; |
| 20866 | malloc_zone_t* newzone = malloc_create_zone(4096, 0); |
| 20867 | malloc_set_zone_name(newzone, "Sqlite_Heap"); |
| 20868 | do{ |
| 20869 | success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, |
| 20870 | (void * volatile *)&_sqliteZone_); |
| 20871 | }while(!_sqliteZone_); |
| 20872 | if( !success ){ |
| 20873 | /* somebody registered a zone first */ |
| 20874 | malloc_destroy_zone(newzone); |
| 20875 | } |
| 20876 | } |
| 20877 | #endif |
| 20878 | UNUSED_PARAMETER(NotUsed); |
| 20879 | return SQLITE_OK; |
| 20880 | } |
| 20881 | |
| 20882 | /* |
| @@ -61814,10 +61836,35 @@ | |
| 61814 | sqlite3BtreeLeave(p); |
| 61815 | return rc; |
| 61816 | #endif |
| 61817 | } |
| 61818 | |
| 61819 | |
| 61820 | /* |
| 61821 | ** Get a reference to pPage1 of the database file. This will |
| 61822 | ** also acquire a readlock on that file. |
| 61823 | ** |
| @@ -61887,30 +61934,19 @@ | |
| 61887 | int isOpen = 0; |
| 61888 | rc = sqlite3PagerOpenWal(pBt->pPager, &isOpen); |
| 61889 | if( rc!=SQLITE_OK ){ |
| 61890 | goto page1_init_failed; |
| 61891 | }else{ |
| 61892 | #if SQLITE_DEFAULT_SYNCHRONOUS!=SQLITE_DEFAULT_WAL_SYNCHRONOUS |
| 61893 | sqlite3 *db; |
| 61894 | Db *pDb; |
| 61895 | if( (db=pBt->db)!=0 && (pDb=db->aDb)!=0 ){ |
| 61896 | while( pDb->pBt==0 || pDb->pBt->pBt!=pBt ){ pDb++; } |
| 61897 | if( pDb->bSyncSet==0 |
| 61898 | && pDb->safety_level==SQLITE_DEFAULT_SYNCHRONOUS+1 |
| 61899 | ){ |
| 61900 | pDb->safety_level = SQLITE_DEFAULT_WAL_SYNCHRONOUS+1; |
| 61901 | sqlite3PagerSetFlags(pBt->pPager, |
| 61902 | pDb->safety_level | (db->flags & PAGER_FLAGS_MASK)); |
| 61903 | } |
| 61904 | } |
| 61905 | #endif |
| 61906 | if( isOpen==0 ){ |
| 61907 | releasePage(pPage1); |
| 61908 | return SQLITE_OK; |
| 61909 | } |
| 61910 | } |
| 61911 | rc = SQLITE_NOTADB; |
| 61912 | } |
| 61913 | #endif |
| 61914 | |
| 61915 | /* EVIDENCE-OF: R-15465-20813 The maximum and minimum embedded payload |
| 61916 | ** fractions and the leaf payload fraction values must be 64, 32, and 32. |
| @@ -71426,10 +71462,16 @@ | |
| 71426 | int nNew = (p->nOpAlloc>=512 ? p->nOpAlloc*2 : p->nOpAlloc+nOp); |
| 71427 | #else |
| 71428 | int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op))); |
| 71429 | UNUSED_PARAMETER(nOp); |
| 71430 | #endif |
| 71431 | |
| 71432 | assert( nOp<=(1024/sizeof(Op)) ); |
| 71433 | assert( nNew>=(p->nOpAlloc+nOp) ); |
| 71434 | pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op)); |
| 71435 | if( pNew ){ |
| @@ -80816,12 +80858,17 @@ | |
| 80816 | /* Content is irrelevant for |
| 80817 | ** 1. the typeof() function, |
| 80818 | ** 2. the length(X) function if X is a blob, and |
| 80819 | ** 3. if the content length is zero. |
| 80820 | ** So we might as well use bogus content rather than reading |
| 80821 | ** content from disk. */ |
| 80822 | static u8 aZero[8]; /* This is the bogus content */ |
| 80823 | sqlite3VdbeSerialGet(aZero, t, pDest); |
| 80824 | }else{ |
| 80825 | rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, aOffset[p2], len, pDest); |
| 80826 | if( rc!=SQLITE_OK ) goto abort_due_to_error; |
| 80827 | sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest); |
| @@ -114404,10 +114451,11 @@ | |
| 114404 | Index *pPrior = 0; |
| 114405 | int loopTop; |
| 114406 | int iDataCur, iIdxCur; |
| 114407 | int r1 = -1; |
| 114408 | |
| 114409 | if( pTab->pCheck==0 |
| 114410 | && (pTab->tabFlags & TF_HasNotNull)==0 |
| 114411 | && (pTab->pIndex==0 || isQuick) |
| 114412 | ){ |
| 114413 | continue; /* No additional checks needed for this table */ |
| @@ -198072,11 +198120,11 @@ | |
| 198072 | int nArg, /* Number of args */ |
| 198073 | sqlite3_value **apUnused /* Function arguments */ |
| 198074 | ){ |
| 198075 | assert( nArg==0 ); |
| 198076 | UNUSED_PARAM2(nArg, apUnused); |
| 198077 | sqlite3_result_text(pCtx, "fts5: 2017-03-16 14:28:52 6d85eb5736781b43aa674d9544c7523b849b4e634f371702f8764b33e22e1e9f", -1, SQLITE_TRANSIENT); |
| 198078 | } |
| 198079 | |
| 198080 | static int fts5Init(sqlite3 *db){ |
| 198081 | static const sqlite3_module fts5Mod = { |
| 198082 | /* iVersion */ 2, |
| 198083 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -398,11 +398,11 @@ | |
| 398 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 399 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 400 | */ |
| 401 | #define SQLITE_VERSION "3.18.0" |
| 402 | #define SQLITE_VERSION_NUMBER 3018000 |
| 403 | #define SQLITE_SOURCE_ID "2017-03-18 13:59:46 4e6a03d9e12b120d15946b025f97a97697cb8e8af543c238ffda220c9e3f28f4" |
| 404 | |
| 405 | /* |
| 406 | ** CAPI3REF: Run-Time Library Version Numbers |
| 407 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 408 | ** |
| @@ -3699,13 +3699,13 @@ | |
| 3699 | ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> |
| 3700 | ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ |
| 3701 | ** |
| 3702 | ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> |
| 3703 | ** <dd>The maximum number of instructions in a virtual machine program |
| 3704 | ** used to implement an SQL statement. If [sqlite3_prepare_v2()] or |
| 3705 | ** the equivalent tries to allocate space for more than this many opcodes |
| 3706 | ** in a single prepared statement, an SQLITE_NOMEM error is returned.</dd>)^ |
| 3707 | ** |
| 3708 | ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> |
| 3709 | ** <dd>The maximum number of arguments on a function.</dd>)^ |
| 3710 | ** |
| 3711 | ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt> |
| @@ -3738,10 +3738,11 @@ | |
| 3738 | #define SQLITE_LIMIT_ATTACHED 7 |
| 3739 | #define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 |
| 3740 | #define SQLITE_LIMIT_VARIABLE_NUMBER 9 |
| 3741 | #define SQLITE_LIMIT_TRIGGER_DEPTH 10 |
| 3742 | #define SQLITE_LIMIT_WORKER_THREADS 11 |
| 3743 | |
| 3744 | |
| 3745 | /* |
| 3746 | ** CAPI3REF: Compiling An SQL Statement |
| 3747 | ** KEYWORDS: {SQL statement compiler} |
| 3748 | ** METHOD: sqlite3 |
| @@ -10866,11 +10867,11 @@ | |
| 10867 | /* |
| 10868 | ** The maximum number of opcodes in a VDBE program. |
| 10869 | ** Not currently enforced. |
| 10870 | */ |
| 10871 | #ifndef SQLITE_MAX_VDBE_OP |
| 10872 | # define SQLITE_MAX_VDBE_OP 250000000 |
| 10873 | #endif |
| 10874 | |
| 10875 | /* |
| 10876 | ** The maximum number of arguments to an SQL function. |
| 10877 | */ |
| @@ -17487,10 +17488,16 @@ | |
| 17488 | "DEFAULT_LOCKING_MODE=" CTIMEOPT_VAL(SQLITE_DEFAULT_LOCKING_MODE), |
| 17489 | #endif |
| 17490 | #if defined(SQLITE_DEFAULT_MMAP_SIZE) && !defined(SQLITE_DEFAULT_MMAP_SIZE_xc) |
| 17491 | "DEFAULT_MMAP_SIZE=" CTIMEOPT_VAL(SQLITE_DEFAULT_MMAP_SIZE), |
| 17492 | #endif |
| 17493 | #if SQLITE_DEFAULT_SYNCHRONOUS |
| 17494 | "DEFAULT_SYNCHRONOUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_SYNCHRONOUS), |
| 17495 | #endif |
| 17496 | #if SQLITE_DEFAULT_WAL_SYNCHRONOUS |
| 17497 | "DEFAULT_WAL_SYNCHRONOUS=" CTIMEOPT_VAL(SQLITE_DEFAULT_WAL_SYNCHRONOUS), |
| 17498 | #endif |
| 17499 | #if SQLITE_DIRECT_OVERFLOW_READ |
| 17500 | "DIRECT_OVERFLOW_READ", |
| 17501 | #endif |
| 17502 | #if SQLITE_DISABLE_DIRSYNC |
| 17503 | "DISABLE_DIRSYNC", |
| @@ -20667,11 +20674,13 @@ | |
| 20674 | ** Use the zone allocator available on apple products unless the |
| 20675 | ** SQLITE_WITHOUT_ZONEMALLOC symbol is defined. |
| 20676 | */ |
| 20677 | #include <sys/sysctl.h> |
| 20678 | #include <malloc/malloc.h> |
| 20679 | #ifdef SQLITE_MIGHT_BE_SINGLE_CORE |
| 20680 | #include <libkern/OSAtomic.h> |
| 20681 | #endif /* SQLITE_MIGHT_BE_SINGLE_CORE */ |
| 20682 | static malloc_zone_t* _sqliteZone_; |
| 20683 | #define SQLITE_MALLOC(x) malloc_zone_malloc(_sqliteZone_, (x)) |
| 20684 | #define SQLITE_FREE(x) malloc_zone_free(_sqliteZone_, (x)); |
| 20685 | #define SQLITE_REALLOC(x,y) malloc_zone_realloc(_sqliteZone_, (x), (y)) |
| 20686 | #define SQLITE_MALLOCSIZE(x) \ |
| @@ -20846,37 +20855,50 @@ | |
| 20855 | /* |
| 20856 | ** Initialize this module. |
| 20857 | */ |
| 20858 | static int sqlite3MemInit(void *NotUsed){ |
| 20859 | #if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) |
| 20860 | if( _sqliteZone_ ){ |
| 20861 | return SQLITE_OK; |
| 20862 | } |
| 20863 | #ifndef SQLITE_MIGHT_BE_SINGLE_CORE |
| 20864 | /* If not compiled with the SQLITE_MIGHT_BE_SINGLE_CORE flag, assume |
| 20865 | ** that multiple cores are always available. This is the default case. |
| 20866 | */ |
| 20867 | _sqliteZone_ = malloc_default_zone(); |
| 20868 | #else |
| 20869 | /* With the SQLITE_MIGHT_BE_SINGLE_CORE compile-time option, check the |
| 20870 | ** number of cores. Different malloc() strategies are used for single-core and |
| 20871 | ** multi-core machines. |
| 20872 | */ |
| 20873 | { |
| 20874 | int cpuCount; |
| 20875 | size_t len; |
| 20876 | len = sizeof(cpuCount); |
| 20877 | /* One usually wants to use hw.acctivecpu for MT decisions, but not here */ |
| 20878 | sysctlbyname("hw.ncpu", &cpuCount, &len, NULL, 0); |
| 20879 | if( cpuCount>1 ){ |
| 20880 | /* defer MT decisions to system malloc */ |
| 20881 | _sqliteZone_ = malloc_default_zone(); |
| 20882 | }else{ |
| 20883 | /* only 1 core, use our own zone to contention over global locks, |
| 20884 | ** e.g. we have our own dedicated locks */ |
| 20885 | bool success; |
| 20886 | malloc_zone_t* newzone = malloc_create_zone(4096, 0); |
| 20887 | malloc_set_zone_name(newzone, "Sqlite_Heap"); |
| 20888 | do{ |
| 20889 | success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, |
| 20890 | (void * volatile *)&_sqliteZone_); |
| 20891 | }while(!_sqliteZone_); |
| 20892 | if( !success ){ |
| 20893 | /* somebody registered a zone first */ |
| 20894 | malloc_destroy_zone(newzone); |
| 20895 | } |
| 20896 | } |
| 20897 | } |
| 20898 | #endif /* SQLITE_MIGHT_BE_SINGLE_CORE */ |
| 20899 | #endif /* defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) */ |
| 20900 | UNUSED_PARAMETER(NotUsed); |
| 20901 | return SQLITE_OK; |
| 20902 | } |
| 20903 | |
| 20904 | /* |
| @@ -61814,10 +61836,35 @@ | |
| 61836 | sqlite3BtreeLeave(p); |
| 61837 | return rc; |
| 61838 | #endif |
| 61839 | } |
| 61840 | |
| 61841 | /* |
| 61842 | ** If the user has not set the safety-level for this database connection |
| 61843 | ** using "PRAGMA synchronous", and if the safety-level is not already |
| 61844 | ** set to the value passed to this function as the second parameter, |
| 61845 | ** set it so. |
| 61846 | */ |
| 61847 | #if SQLITE_DEFAULT_SYNCHRONOUS!=SQLITE_DEFAULT_WAL_SYNCHRONOUS |
| 61848 | static void setDefaultSyncFlag(BtShared *pBt, u8 safety_level){ |
| 61849 | sqlite3 *db; |
| 61850 | Db *pDb; |
| 61851 | if( (db=pBt->db)!=0 && (pDb=db->aDb)!=0 ){ |
| 61852 | while( pDb->pBt==0 || pDb->pBt->pBt!=pBt ){ pDb++; } |
| 61853 | if( pDb->bSyncSet==0 |
| 61854 | && pDb->safety_level!=safety_level |
| 61855 | && pDb!=&db->aDb[1] |
| 61856 | ){ |
| 61857 | pDb->safety_level = safety_level; |
| 61858 | sqlite3PagerSetFlags(pBt->pPager, |
| 61859 | pDb->safety_level | (db->flags & PAGER_FLAGS_MASK)); |
| 61860 | } |
| 61861 | } |
| 61862 | } |
| 61863 | #else |
| 61864 | # define setDefaultSyncFlag(pBt,safety_level) |
| 61865 | #endif |
| 61866 | |
| 61867 | /* |
| 61868 | ** Get a reference to pPage1 of the database file. This will |
| 61869 | ** also acquire a readlock on that file. |
| 61870 | ** |
| @@ -61887,30 +61934,19 @@ | |
| 61934 | int isOpen = 0; |
| 61935 | rc = sqlite3PagerOpenWal(pBt->pPager, &isOpen); |
| 61936 | if( rc!=SQLITE_OK ){ |
| 61937 | goto page1_init_failed; |
| 61938 | }else{ |
| 61939 | setDefaultSyncFlag(pBt, SQLITE_DEFAULT_WAL_SYNCHRONOUS+1); |
| 61940 | if( isOpen==0 ){ |
| 61941 | releasePage(pPage1); |
| 61942 | return SQLITE_OK; |
| 61943 | } |
| 61944 | } |
| 61945 | rc = SQLITE_NOTADB; |
| 61946 | }else{ |
| 61947 | setDefaultSyncFlag(pBt, SQLITE_DEFAULT_SYNCHRONOUS+1); |
| 61948 | } |
| 61949 | #endif |
| 61950 | |
| 61951 | /* EVIDENCE-OF: R-15465-20813 The maximum and minimum embedded payload |
| 61952 | ** fractions and the leaf payload fraction values must be 64, 32, and 32. |
| @@ -71426,10 +71462,16 @@ | |
| 71462 | int nNew = (p->nOpAlloc>=512 ? p->nOpAlloc*2 : p->nOpAlloc+nOp); |
| 71463 | #else |
| 71464 | int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op))); |
| 71465 | UNUSED_PARAMETER(nOp); |
| 71466 | #endif |
| 71467 | |
| 71468 | /* Ensure that the size of a VDBE does not grow too large */ |
| 71469 | if( nNew > p->db->aLimit[SQLITE_LIMIT_VDBE_OP] ){ |
| 71470 | sqlite3OomFault(p->db); |
| 71471 | return SQLITE_NOMEM; |
| 71472 | } |
| 71473 | |
| 71474 | assert( nOp<=(1024/sizeof(Op)) ); |
| 71475 | assert( nNew>=(p->nOpAlloc+nOp) ); |
| 71476 | pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op)); |
| 71477 | if( pNew ){ |
| @@ -80816,12 +80858,17 @@ | |
| 80858 | /* Content is irrelevant for |
| 80859 | ** 1. the typeof() function, |
| 80860 | ** 2. the length(X) function if X is a blob, and |
| 80861 | ** 3. if the content length is zero. |
| 80862 | ** So we might as well use bogus content rather than reading |
| 80863 | ** content from disk. |
| 80864 | ** |
| 80865 | ** Although sqlite3VdbeSerialGet() may read at most 8 bytes from the |
| 80866 | ** buffer passed to it, debugging function VdbeMemPrettyPrint() may |
| 80867 | ** read up to 16. So 16 bytes of bogus content is supplied. |
| 80868 | */ |
| 80869 | static u8 aZero[16]; /* This is the bogus content */ |
| 80870 | sqlite3VdbeSerialGet(aZero, t, pDest); |
| 80871 | }else{ |
| 80872 | rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, aOffset[p2], len, pDest); |
| 80873 | if( rc!=SQLITE_OK ) goto abort_due_to_error; |
| 80874 | sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest); |
| @@ -114404,10 +114451,11 @@ | |
| 114451 | Index *pPrior = 0; |
| 114452 | int loopTop; |
| 114453 | int iDataCur, iIdxCur; |
| 114454 | int r1 = -1; |
| 114455 | |
| 114456 | if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */ |
| 114457 | if( pTab->pCheck==0 |
| 114458 | && (pTab->tabFlags & TF_HasNotNull)==0 |
| 114459 | && (pTab->pIndex==0 || isQuick) |
| 114460 | ){ |
| 114461 | continue; /* No additional checks needed for this table */ |
| @@ -198072,11 +198120,11 @@ | |
| 198120 | int nArg, /* Number of args */ |
| 198121 | sqlite3_value **apUnused /* Function arguments */ |
| 198122 | ){ |
| 198123 | assert( nArg==0 ); |
| 198124 | UNUSED_PARAM2(nArg, apUnused); |
| 198125 | sqlite3_result_text(pCtx, "fts5: 2017-03-17 14:59:40 626bdca98e0cd78ae873d97e75bb7d544ca18759c9f1e67f4adf03daca7fe5bf", -1, SQLITE_TRANSIENT); |
| 198126 | } |
| 198127 | |
| 198128 | static int fts5Init(sqlite3 *db){ |
| 198129 | static const sqlite3_module fts5Mod = { |
| 198130 | /* iVersion */ 2, |
| 198131 |
+5
-4
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -121,11 +121,11 @@ | ||
| 121 | 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | 123 | */ |
| 124 | 124 | #define SQLITE_VERSION "3.18.0" |
| 125 | 125 | #define SQLITE_VERSION_NUMBER 3018000 |
| 126 | -#define SQLITE_SOURCE_ID "2017-03-16 14:28:52 6d85eb5736781b43aa674d9544c7523b849b4e634f371702f8764b33e22e1e9f" | |
| 126 | +#define SQLITE_SOURCE_ID "2017-03-18 13:59:46 4e6a03d9e12b120d15946b025f97a97697cb8e8af543c238ffda220c9e3f28f4" | |
| 127 | 127 | |
| 128 | 128 | /* |
| 129 | 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | 131 | ** |
| @@ -3422,13 +3422,13 @@ | ||
| 3422 | 3422 | ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> |
| 3423 | 3423 | ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ |
| 3424 | 3424 | ** |
| 3425 | 3425 | ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> |
| 3426 | 3426 | ** <dd>The maximum number of instructions in a virtual machine program |
| 3427 | -** used to implement an SQL statement. This limit is not currently | |
| 3428 | -** enforced, though that might be added in some future release of | |
| 3429 | -** SQLite.</dd>)^ | |
| 3427 | +** used to implement an SQL statement. If [sqlite3_prepare_v2()] or | |
| 3428 | +** the equivalent tries to allocate space for more than this many opcodes | |
| 3429 | +** in a single prepared statement, an SQLITE_NOMEM error is returned.</dd>)^ | |
| 3430 | 3430 | ** |
| 3431 | 3431 | ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> |
| 3432 | 3432 | ** <dd>The maximum number of arguments on a function.</dd>)^ |
| 3433 | 3433 | ** |
| 3434 | 3434 | ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt> |
| @@ -3461,10 +3461,11 @@ | ||
| 3461 | 3461 | #define SQLITE_LIMIT_ATTACHED 7 |
| 3462 | 3462 | #define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 |
| 3463 | 3463 | #define SQLITE_LIMIT_VARIABLE_NUMBER 9 |
| 3464 | 3464 | #define SQLITE_LIMIT_TRIGGER_DEPTH 10 |
| 3465 | 3465 | #define SQLITE_LIMIT_WORKER_THREADS 11 |
| 3466 | + | |
| 3466 | 3467 | |
| 3467 | 3468 | /* |
| 3468 | 3469 | ** CAPI3REF: Compiling An SQL Statement |
| 3469 | 3470 | ** KEYWORDS: {SQL statement compiler} |
| 3470 | 3471 | ** METHOD: sqlite3 |
| 3471 | 3472 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -121,11 +121,11 @@ | |
| 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | */ |
| 124 | #define SQLITE_VERSION "3.18.0" |
| 125 | #define SQLITE_VERSION_NUMBER 3018000 |
| 126 | #define SQLITE_SOURCE_ID "2017-03-16 14:28:52 6d85eb5736781b43aa674d9544c7523b849b4e634f371702f8764b33e22e1e9f" |
| 127 | |
| 128 | /* |
| 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | ** |
| @@ -3422,13 +3422,13 @@ | |
| 3422 | ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> |
| 3423 | ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ |
| 3424 | ** |
| 3425 | ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> |
| 3426 | ** <dd>The maximum number of instructions in a virtual machine program |
| 3427 | ** used to implement an SQL statement. This limit is not currently |
| 3428 | ** enforced, though that might be added in some future release of |
| 3429 | ** SQLite.</dd>)^ |
| 3430 | ** |
| 3431 | ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> |
| 3432 | ** <dd>The maximum number of arguments on a function.</dd>)^ |
| 3433 | ** |
| 3434 | ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt> |
| @@ -3461,10 +3461,11 @@ | |
| 3461 | #define SQLITE_LIMIT_ATTACHED 7 |
| 3462 | #define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 |
| 3463 | #define SQLITE_LIMIT_VARIABLE_NUMBER 9 |
| 3464 | #define SQLITE_LIMIT_TRIGGER_DEPTH 10 |
| 3465 | #define SQLITE_LIMIT_WORKER_THREADS 11 |
| 3466 | |
| 3467 | /* |
| 3468 | ** CAPI3REF: Compiling An SQL Statement |
| 3469 | ** KEYWORDS: {SQL statement compiler} |
| 3470 | ** METHOD: sqlite3 |
| 3471 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -121,11 +121,11 @@ | |
| 121 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 122 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 123 | */ |
| 124 | #define SQLITE_VERSION "3.18.0" |
| 125 | #define SQLITE_VERSION_NUMBER 3018000 |
| 126 | #define SQLITE_SOURCE_ID "2017-03-18 13:59:46 4e6a03d9e12b120d15946b025f97a97697cb8e8af543c238ffda220c9e3f28f4" |
| 127 | |
| 128 | /* |
| 129 | ** CAPI3REF: Run-Time Library Version Numbers |
| 130 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 131 | ** |
| @@ -3422,13 +3422,13 @@ | |
| 3422 | ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> |
| 3423 | ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ |
| 3424 | ** |
| 3425 | ** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> |
| 3426 | ** <dd>The maximum number of instructions in a virtual machine program |
| 3427 | ** used to implement an SQL statement. If [sqlite3_prepare_v2()] or |
| 3428 | ** the equivalent tries to allocate space for more than this many opcodes |
| 3429 | ** in a single prepared statement, an SQLITE_NOMEM error is returned.</dd>)^ |
| 3430 | ** |
| 3431 | ** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> |
| 3432 | ** <dd>The maximum number of arguments on a function.</dd>)^ |
| 3433 | ** |
| 3434 | ** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt> |
| @@ -3461,10 +3461,11 @@ | |
| 3461 | #define SQLITE_LIMIT_ATTACHED 7 |
| 3462 | #define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8 |
| 3463 | #define SQLITE_LIMIT_VARIABLE_NUMBER 9 |
| 3464 | #define SQLITE_LIMIT_TRIGGER_DEPTH 10 |
| 3465 | #define SQLITE_LIMIT_WORKER_THREADS 11 |
| 3466 | |
| 3467 | |
| 3468 | /* |
| 3469 | ** CAPI3REF: Compiling An SQL Statement |
| 3470 | ** KEYWORDS: {SQL statement compiler} |
| 3471 | ** METHOD: sqlite3 |
| 3472 |