Fossil SCM
Update the built-in SQLite to the latest 3.7.6 beta.
Commit
8caf7e169164fdd8159efc55959b011a7368c6c9
Parent
19cf613123244fd…
2 files changed
+79
-53
+14
-14
+79
-53
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -198,11 +198,11 @@ | ||
| 198 | 198 | # define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 1000 |
| 199 | 199 | #endif |
| 200 | 200 | |
| 201 | 201 | /* |
| 202 | 202 | ** The maximum number of attached databases. This must be between 0 |
| 203 | -** and 30. The upper bound on 30 is because a 32-bit integer bitmap | |
| 203 | +** and 62. The upper bound on 62 is because a 64-bit integer bitmap | |
| 204 | 204 | ** is used internally to track attached databases. |
| 205 | 205 | */ |
| 206 | 206 | #ifndef SQLITE_MAX_ATTACHED |
| 207 | 207 | # define SQLITE_MAX_ATTACHED 10 |
| 208 | 208 | #endif |
| @@ -650,11 +650,11 @@ | ||
| 650 | 650 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 651 | 651 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 652 | 652 | */ |
| 653 | 653 | #define SQLITE_VERSION "3.7.6" |
| 654 | 654 | #define SQLITE_VERSION_NUMBER 3007006 |
| 655 | -#define SQLITE_SOURCE_ID "2011-04-05 22:08:24 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81" | |
| 655 | +#define SQLITE_SOURCE_ID "2011-04-07 15:24:08 bf78acb9dfacde0f08a5b3ceac13480f12a06168" | |
| 656 | 656 | |
| 657 | 657 | /* |
| 658 | 658 | ** CAPI3REF: Run-Time Library Version Numbers |
| 659 | 659 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 660 | 660 | ** |
| @@ -1273,11 +1273,11 @@ | ||
| 1273 | 1273 | ** when the database connection has [PRAGMA synchronous] set to OFF.)^ |
| 1274 | 1274 | ** Some specialized VFSes need this signal in order to operate correctly |
| 1275 | 1275 | ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most |
| 1276 | 1276 | ** VFSes do not need this signal and should silently ignore this opcode. |
| 1277 | 1277 | ** Applications should not call [sqlite3_file_control()] with this |
| 1278 | -** opcode as doing so may disrupt the operation of the specilized VFSes | |
| 1278 | +** opcode as doing so may disrupt the operation of the specialized VFSes | |
| 1279 | 1279 | ** that do require it. |
| 1280 | 1280 | */ |
| 1281 | 1281 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1282 | 1282 | #define SQLITE_GET_LOCKPROXYFILE 2 |
| 1283 | 1283 | #define SQLITE_SET_LOCKPROXYFILE 3 |
| @@ -1855,11 +1855,11 @@ | ||
| 1855 | 1855 | ** </dd> |
| 1856 | 1856 | ** |
| 1857 | 1857 | ** <dt>SQLITE_CONFIG_SCRATCH</dt> |
| 1858 | 1858 | ** <dd> ^This option specifies a static memory buffer that SQLite can use for |
| 1859 | 1859 | ** scratch memory. There are three arguments: A pointer an 8-byte |
| 1860 | -** aligned memory buffer from which the scrach allocations will be | |
| 1860 | +** aligned memory buffer from which the scratch allocations will be | |
| 1861 | 1861 | ** drawn, the size of each scratch allocation (sz), |
| 1862 | 1862 | ** and the maximum number of scratch allocations (N). The sz |
| 1863 | 1863 | ** argument must be a multiple of 16. |
| 1864 | 1864 | ** The first argument must be a pointer to an 8-byte aligned buffer |
| 1865 | 1865 | ** of at least sz*N bytes of memory. |
| @@ -2007,11 +2007,11 @@ | ||
| 2007 | 2007 | ** <dl> |
| 2008 | 2008 | ** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> |
| 2009 | 2009 | ** <dd> ^This option takes three additional arguments that determine the |
| 2010 | 2010 | ** [lookaside memory allocator] configuration for the [database connection]. |
| 2011 | 2011 | ** ^The first argument (the third parameter to [sqlite3_db_config()] is a |
| 2012 | -** pointer to an memory buffer to use for lookaside memory. | |
| 2012 | +** pointer to a memory buffer to use for lookaside memory. | |
| 2013 | 2013 | ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb |
| 2014 | 2014 | ** may be NULL in which case SQLite will allocate the |
| 2015 | 2015 | ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the |
| 2016 | 2016 | ** size of each lookaside buffer slot. ^The third argument is the number of |
| 2017 | 2017 | ** slots. The size of the buffer in the first argument must be greater than |
| @@ -2039,11 +2039,11 @@ | ||
| 2039 | 2039 | ** |
| 2040 | 2040 | ** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt> |
| 2041 | 2041 | ** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers]. |
| 2042 | 2042 | ** There should be two additional arguments. |
| 2043 | 2043 | ** The first argument is an integer which is 0 to disable triggers, |
| 2044 | -** positive to enable trigers or negative to leave the setting unchanged. | |
| 2044 | +** positive to enable triggers or negative to leave the setting unchanged. | |
| 2045 | 2045 | ** The second parameter is a pointer to an integer into which |
| 2046 | 2046 | ** is written 0 or 1 to indicate whether triggers are disabled or enabled |
| 2047 | 2047 | ** following this call. The second parameter may be a NULL pointer, in |
| 2048 | 2048 | ** which case the trigger setting is not reported back. </dd> |
| 2049 | 2049 | ** |
| @@ -2651,11 +2651,11 @@ | ||
| 2651 | 2651 | SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2652 | 2652 | |
| 2653 | 2653 | /* |
| 2654 | 2654 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2655 | 2655 | ** |
| 2656 | -** ^This routine registers a authorizer callback with a particular | |
| 2656 | +** ^This routine registers an authorizer callback with a particular | |
| 2657 | 2657 | ** [database connection], supplied in the first argument. |
| 2658 | 2658 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 2659 | 2659 | ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], |
| 2660 | 2660 | ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various |
| 2661 | 2661 | ** points during the compilation process, as logic is being created |
| @@ -3297,11 +3297,11 @@ | ||
| 3297 | 3297 | ** will accept either a protected or an unprotected sqlite3_value. |
| 3298 | 3298 | ** Every interface that accepts sqlite3_value arguments specifies |
| 3299 | 3299 | ** whether or not it requires a protected sqlite3_value. |
| 3300 | 3300 | ** |
| 3301 | 3301 | ** The terms "protected" and "unprotected" refer to whether or not |
| 3302 | -** a mutex is held. A internal mutex is held for a protected | |
| 3302 | +** a mutex is held. An internal mutex is held for a protected | |
| 3303 | 3303 | ** sqlite3_value object but no mutex is held for an unprotected |
| 3304 | 3304 | ** sqlite3_value object. If SQLite is compiled to be single-threaded |
| 3305 | 3305 | ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) |
| 3306 | 3306 | ** or if SQLite is run in one of reduced mutex modes |
| 3307 | 3307 | ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] |
| @@ -3983,11 +3983,11 @@ | ||
| 3983 | 3983 | ** |
| 3984 | 3984 | ** ^These functions (collectively known as "function creation routines") |
| 3985 | 3985 | ** are used to add SQL functions or aggregates or to redefine the behavior |
| 3986 | 3986 | ** of existing SQL functions or aggregates. The only differences between |
| 3987 | 3987 | ** these routines are the text encoding expected for |
| 3988 | -** the the second parameter (the name of the function being created) | |
| 3988 | +** the second parameter (the name of the function being created) | |
| 3989 | 3989 | ** and the presence or absence of a destructor callback for |
| 3990 | 3990 | ** the application data pointer. |
| 3991 | 3991 | ** |
| 3992 | 3992 | ** ^The first parameter is the [database connection] to which the SQL |
| 3993 | 3993 | ** function is to be added. ^If an application uses more than one database |
| @@ -4028,11 +4028,11 @@ | ||
| 4028 | 4028 | ** pointers to C-language functions that implement the SQL function or |
| 4029 | 4029 | ** aggregate. ^A scalar SQL function requires an implementation of the xFunc |
| 4030 | 4030 | ** callback only; NULL pointers must be passed as the xStep and xFinal |
| 4031 | 4031 | ** parameters. ^An aggregate SQL function requires an implementation of xStep |
| 4032 | 4032 | ** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing |
| 4033 | -** SQL function or aggregate, pass NULL poiners for all three function | |
| 4033 | +** SQL function or aggregate, pass NULL pointers for all three function | |
| 4034 | 4034 | ** callbacks. |
| 4035 | 4035 | ** |
| 4036 | 4036 | ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, |
| 4037 | 4037 | ** then it is destructor for the application data pointer. |
| 4038 | 4038 | ** The destructor is invoked when the function is deleted, either by being |
| @@ -4462,11 +4462,11 @@ | ||
| 4462 | 4462 | ** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep |
| 4463 | 4463 | ** force strings to be UTF16 with native byte order. |
| 4464 | 4464 | ** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin |
| 4465 | 4465 | ** on an even byte address. |
| 4466 | 4466 | ** |
| 4467 | -** ^The fourth argument, pArg, is a application data pointer that is passed | |
| 4467 | +** ^The fourth argument, pArg, is an application data pointer that is passed | |
| 4468 | 4468 | ** through as the first argument to the collating function callback. |
| 4469 | 4469 | ** |
| 4470 | 4470 | ** ^The fifth argument, xCallback, is a pointer to the collating function. |
| 4471 | 4471 | ** ^Multiple collating functions can be registered using the same name but |
| 4472 | 4472 | ** with different eTextRep parameters and SQLite will use whichever |
| @@ -4478,11 +4478,11 @@ | ||
| 4478 | 4478 | ** ^The collating function callback is invoked with a copy of the pArg |
| 4479 | 4479 | ** application data pointer and with two strings in the encoding specified |
| 4480 | 4480 | ** by the eTextRep argument. The collating function must return an |
| 4481 | 4481 | ** integer that is negative, zero, or positive |
| 4482 | 4482 | ** if the first string is less than, equal to, or greater than the second, |
| 4483 | -** respectively. A collating function must alway return the same answer | |
| 4483 | +** respectively. A collating function must always return the same answer | |
| 4484 | 4484 | ** given the same inputs. If two or more collating functions are registered |
| 4485 | 4485 | ** to the same collation name (using different eTextRep values) then all |
| 4486 | 4486 | ** must give an equivalent answer when invoked with equivalent strings. |
| 4487 | 4487 | ** The collating function must obey the following properties for all |
| 4488 | 4488 | ** strings A, B, and C: |
| @@ -4890,11 +4890,11 @@ | ||
| 4890 | 4890 | ** <ul> |
| 4891 | 4891 | ** <li> The soft heap limit is set to zero. |
| 4892 | 4892 | ** <li> Memory accounting is disabled using a combination of the |
| 4893 | 4893 | ** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and |
| 4894 | 4894 | ** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. |
| 4895 | -** <li> An alternative page cache implementation is specifed using | |
| 4895 | +** <li> An alternative page cache implementation is specified using | |
| 4896 | 4896 | ** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). |
| 4897 | 4897 | ** <li> The page cache allocates from its own memory pool supplied |
| 4898 | 4898 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 4899 | 4899 | ** from the heap. |
| 4900 | 4900 | ** </ul>)^ |
| @@ -5111,11 +5111,11 @@ | ||
| 5111 | 5111 | |
| 5112 | 5112 | /* |
| 5113 | 5113 | ** CAPI3REF: Virtual Table Object |
| 5114 | 5114 | ** KEYWORDS: sqlite3_module {virtual table module} |
| 5115 | 5115 | ** |
| 5116 | -** This structure, sometimes called a a "virtual table module", | |
| 5116 | +** This structure, sometimes called a "virtual table module", | |
| 5117 | 5117 | ** defines the implementation of a [virtual tables]. |
| 5118 | 5118 | ** This structure consists mostly of methods for the module. |
| 5119 | 5119 | ** |
| 5120 | 5120 | ** ^A virtual table module is created by filling in a persistent |
| 5121 | 5121 | ** instance of this structure and passing a pointer to that instance |
| @@ -5423,11 +5423,11 @@ | ||
| 5423 | 5423 | ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects |
| 5424 | 5424 | ** then the BLOB handle is marked as "expired". |
| 5425 | 5425 | ** This is true if any column of the row is changed, even a column |
| 5426 | 5426 | ** other than the one the BLOB handle is open on.)^ |
| 5427 | 5427 | ** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for |
| 5428 | -** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. | |
| 5428 | +** an expired BLOB handle fail with a return code of [SQLITE_ABORT]. | |
| 5429 | 5429 | ** ^(Changes written into a BLOB prior to the BLOB expiring are not |
| 5430 | 5430 | ** rolled back by the expiration of the BLOB. Such changes will eventually |
| 5431 | 5431 | ** commit if the transaction continues to completion.)^ |
| 5432 | 5432 | ** |
| 5433 | 5433 | ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of |
| @@ -7825,10 +7825,11 @@ | ||
| 7825 | 7825 | # define sqlite3BtreeEnter(X) |
| 7826 | 7826 | # define sqlite3BtreeEnterAll(X) |
| 7827 | 7827 | #endif |
| 7828 | 7828 | |
| 7829 | 7829 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE |
| 7830 | +SQLITE_PRIVATE int sqlite3BtreeSharable(Btree*); | |
| 7830 | 7831 | SQLITE_PRIVATE void sqlite3BtreeLeave(Btree*); |
| 7831 | 7832 | SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor*); |
| 7832 | 7833 | SQLITE_PRIVATE void sqlite3BtreeLeaveCursor(BtCursor*); |
| 7833 | 7834 | SQLITE_PRIVATE void sqlite3BtreeLeaveAll(sqlite3*); |
| 7834 | 7835 | #ifndef NDEBUG |
| @@ -7837,10 +7838,11 @@ | ||
| 7837 | 7838 | SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3*); |
| 7838 | 7839 | SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*); |
| 7839 | 7840 | #endif |
| 7840 | 7841 | #else |
| 7841 | 7842 | |
| 7843 | +# define sqlite3BtreeSharable(X) 0 | |
| 7842 | 7844 | # define sqlite3BtreeLeave(X) |
| 7843 | 7845 | # define sqlite3BtreeEnterCursor(X) |
| 7844 | 7846 | # define sqlite3BtreeLeaveCursor(X) |
| 7845 | 7847 | # define sqlite3BtreeLeaveAll(X) |
| 7846 | 7848 | |
| @@ -12493,10 +12495,11 @@ | ||
| 12493 | 12495 | u8 usesStmtJournal; /* True if uses a statement journal */ |
| 12494 | 12496 | u8 readOnly; /* True for read-only statements */ |
| 12495 | 12497 | u8 isPrepareV2; /* True if prepared with prepare_v2() */ |
| 12496 | 12498 | int nChange; /* Number of db changes made since last reset */ |
| 12497 | 12499 | yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */ |
| 12500 | + yDbMask lockMask; /* Subset of btreeMask that requires a lock */ | |
| 12498 | 12501 | int iStatement; /* Statement number (or 0 if has not opened stmt) */ |
| 12499 | 12502 | int aCounter[3]; /* Counters used by sqlite3_stmt_status() */ |
| 12500 | 12503 | #ifndef SQLITE_OMIT_TRACE |
| 12501 | 12504 | i64 startTime; /* Time when query started - used for profiling */ |
| 12502 | 12505 | #endif |
| @@ -26784,22 +26787,21 @@ | ||
| 26784 | 26787 | ** is the same technique used by glibc to implement posix_fallocate() |
| 26785 | 26788 | ** on systems that do not have a real fallocate() system call. |
| 26786 | 26789 | */ |
| 26787 | 26790 | int nBlk = buf.st_blksize; /* File-system block size */ |
| 26788 | 26791 | i64 iWrite; /* Next offset to write to */ |
| 26789 | - int nWrite; /* Return value from seekAndWrite() */ | |
| 26790 | 26792 | |
| 26791 | 26793 | if( robust_ftruncate(pFile->h, nSize) ){ |
| 26792 | 26794 | pFile->lastErrno = errno; |
| 26793 | 26795 | return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); |
| 26794 | 26796 | } |
| 26795 | 26797 | iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; |
| 26796 | - do { | |
| 26797 | - nWrite = seekAndWrite(pFile, iWrite, "", 1); | |
| 26798 | + while( iWrite<nSize ){ | |
| 26799 | + int nWrite = seekAndWrite(pFile, iWrite, "", 1); | |
| 26800 | + if( nWrite!=1 ) return SQLITE_IOERR_WRITE; | |
| 26798 | 26801 | iWrite += nBlk; |
| 26799 | - } while( nWrite==1 && iWrite<nSize ); | |
| 26800 | - if( nWrite!=1 ) return SQLITE_IOERR_WRITE; | |
| 26802 | + } | |
| 26801 | 26803 | #endif |
| 26802 | 26804 | } |
| 26803 | 26805 | } |
| 26804 | 26806 | |
| 26805 | 26807 | return SQLITE_OK; |
| @@ -46156,10 +46158,18 @@ | ||
| 46156 | 46158 | for(i=0; i<db->nDb; i++){ |
| 46157 | 46159 | p = db->aDb[i].pBt; |
| 46158 | 46160 | if( p ) sqlite3BtreeLeave(p); |
| 46159 | 46161 | } |
| 46160 | 46162 | } |
| 46163 | + | |
| 46164 | +/* | |
| 46165 | +** Return true if a particular Btree requires a lock. Return FALSE if | |
| 46166 | +** no lock is ever required since it is not sharable. | |
| 46167 | +*/ | |
| 46168 | +SQLITE_PRIVATE int sqlite3BtreeSharable(Btree *p){ | |
| 46169 | + return p->sharable; | |
| 46170 | +} | |
| 46161 | 46171 | |
| 46162 | 46172 | #ifndef NDEBUG |
| 46163 | 46173 | /* |
| 46164 | 46174 | ** Return true if the current thread holds the database connection |
| 46165 | 46175 | ** mutex and all required BtShared mutexes. |
| @@ -48362,11 +48372,10 @@ | ||
| 48362 | 48372 | rc = sqlite3PagerNosync(pBt->pPager); |
| 48363 | 48373 | sqlite3BtreeLeave(p); |
| 48364 | 48374 | return rc; |
| 48365 | 48375 | } |
| 48366 | 48376 | |
| 48367 | -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) | |
| 48368 | 48377 | /* |
| 48369 | 48378 | ** Change the default pages size and the number of reserved bytes per page. |
| 48370 | 48379 | ** Or, if the page size has already been fixed, return SQLITE_READONLY |
| 48371 | 48380 | ** without changing anything. |
| 48372 | 48381 | ** |
| @@ -48417,10 +48426,11 @@ | ||
| 48417 | 48426 | */ |
| 48418 | 48427 | SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){ |
| 48419 | 48428 | return p->pBt->pageSize; |
| 48420 | 48429 | } |
| 48421 | 48430 | |
| 48431 | +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) | |
| 48422 | 48432 | /* |
| 48423 | 48433 | ** Return the number of bytes of space at the end of every page that |
| 48424 | 48434 | ** are intentually left unused. This is the "reserved" space that is |
| 48425 | 48435 | ** sometimes used by extensions. |
| 48426 | 48436 | */ |
| @@ -51054,11 +51064,11 @@ | ||
| 51054 | 51064 | if( rc ){ |
| 51055 | 51065 | pTrunk = 0; |
| 51056 | 51066 | goto end_allocate_page; |
| 51057 | 51067 | } |
| 51058 | 51068 | |
| 51059 | - k = get4byte(&pTrunk->aData[4]); | |
| 51069 | + k = get4byte(&pTrunk->aData[4]); /* # of leaves on this trunk page */ | |
| 51060 | 51070 | if( k==0 && !searchList ){ |
| 51061 | 51071 | /* The trunk has no leaves and the list is not being searched. |
| 51062 | 51072 | ** So extract the trunk page itself and use it as the newly |
| 51063 | 51073 | ** allocated page */ |
| 51064 | 51074 | assert( pPrevTrunk==0 ); |
| @@ -51139,14 +51149,10 @@ | ||
| 51139 | 51149 | }else if( k>0 ){ |
| 51140 | 51150 | /* Extract a leaf from the trunk */ |
| 51141 | 51151 | u32 closest; |
| 51142 | 51152 | Pgno iPage; |
| 51143 | 51153 | unsigned char *aData = pTrunk->aData; |
| 51144 | - rc = sqlite3PagerWrite(pTrunk->pDbPage); | |
| 51145 | - if( rc ){ | |
| 51146 | - goto end_allocate_page; | |
| 51147 | - } | |
| 51148 | 51154 | if( nearby>0 ){ |
| 51149 | 51155 | u32 i; |
| 51150 | 51156 | int dist; |
| 51151 | 51157 | closest = 0; |
| 51152 | 51158 | dist = sqlite3AbsInt32(get4byte(&aData[8]) - nearby); |
| @@ -51172,15 +51178,16 @@ | ||
| 51172 | 51178 | int noContent; |
| 51173 | 51179 | *pPgno = iPage; |
| 51174 | 51180 | TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d" |
| 51175 | 51181 | ": %d more free pages\n", |
| 51176 | 51182 | *pPgno, closest+1, k, pTrunk->pgno, n-1)); |
| 51183 | + rc = sqlite3PagerWrite(pTrunk->pDbPage); | |
| 51184 | + if( rc ) goto end_allocate_page; | |
| 51177 | 51185 | if( closest<k-1 ){ |
| 51178 | 51186 | memcpy(&aData[8+closest*4], &aData[4+k*4], 4); |
| 51179 | 51187 | } |
| 51180 | 51188 | put4byte(&aData[4], k-1); |
| 51181 | - assert( sqlite3PagerIswriteable(pTrunk->pDbPage) ); | |
| 51182 | 51189 | noContent = !btreeGetHasContent(pBt, *pPgno); |
| 51183 | 51190 | rc = btreeGetPage(pBt, *pPgno, ppPage, noContent); |
| 51184 | 51191 | if( rc==SQLITE_OK ){ |
| 51185 | 51192 | rc = sqlite3PagerWrite((*ppPage)->pDbPage); |
| 51186 | 51193 | if( rc!=SQLITE_OK ){ |
| @@ -51245,10 +51252,11 @@ | ||
| 51245 | 51252 | } |
| 51246 | 51253 | (*ppPage)->isInit = 0; |
| 51247 | 51254 | }else{ |
| 51248 | 51255 | *ppPage = 0; |
| 51249 | 51256 | } |
| 51257 | + assert( rc!=SQLITE_OK || sqlite3PagerIswriteable((*ppPage)->pDbPage) ); | |
| 51250 | 51258 | return rc; |
| 51251 | 51259 | } |
| 51252 | 51260 | |
| 51253 | 51261 | /* |
| 51254 | 51262 | ** This function is used to add page iPage to the database file free-list. |
| @@ -56384,11 +56392,12 @@ | ||
| 56384 | 56392 | pOp->p4type = P4_NOTUSED; |
| 56385 | 56393 | p->expired = 0; |
| 56386 | 56394 | if( op==OP_ParseSchema ){ |
| 56387 | 56395 | /* Any program that uses the OP_ParseSchema opcode needs to lock |
| 56388 | 56396 | ** all btrees. */ |
| 56389 | - p->btreeMask = ~(yDbMask)0; | |
| 56397 | + int j; | |
| 56398 | + for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j); | |
| 56390 | 56399 | } |
| 56391 | 56400 | #ifdef SQLITE_DEBUG |
| 56392 | 56401 | pOp->zComment = 0; |
| 56393 | 56402 | if( sqlite3VdbeAddopTrace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]); |
| 56394 | 56403 | #endif |
| @@ -57182,10 +57191,13 @@ | ||
| 57182 | 57191 | */ |
| 57183 | 57192 | SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){ |
| 57184 | 57193 | assert( i>=0 && i<p->db->nDb && i<(int)sizeof(yDbMask)*8 ); |
| 57185 | 57194 | assert( i<(int)sizeof(p->btreeMask)*8 ); |
| 57186 | 57195 | p->btreeMask |= ((yDbMask)1)<<i; |
| 57196 | + if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){ | |
| 57197 | + p->lockMask |= ((yDbMask)1)<<i; | |
| 57198 | + } | |
| 57187 | 57199 | } |
| 57188 | 57200 | |
| 57189 | 57201 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0 |
| 57190 | 57202 | /* |
| 57191 | 57203 | ** If SQLite is compiled to support shared-cache mode and to be threadsafe, |
| @@ -57209,15 +57221,19 @@ | ||
| 57209 | 57221 | ** be a problem. |
| 57210 | 57222 | */ |
| 57211 | 57223 | SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe *p){ |
| 57212 | 57224 | int i; |
| 57213 | 57225 | yDbMask mask; |
| 57214 | - sqlite3 *db = p->db; | |
| 57215 | - Db *aDb = db->aDb; | |
| 57216 | - int nDb = db->nDb; | |
| 57226 | + sqlite3 *db; | |
| 57227 | + Db *aDb; | |
| 57228 | + int nDb; | |
| 57229 | + if( p->lockMask==0 ) return; /* The common case */ | |
| 57230 | + db = p->db; | |
| 57231 | + aDb = db->aDb; | |
| 57232 | + nDb = db->nDb; | |
| 57217 | 57233 | for(i=0, mask=1; i<nDb; i++, mask += mask){ |
| 57218 | - if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ | |
| 57234 | + if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ | |
| 57219 | 57235 | sqlite3BtreeEnter(aDb[i].pBt); |
| 57220 | 57236 | } |
| 57221 | 57237 | } |
| 57222 | 57238 | } |
| 57223 | 57239 | #endif |
| @@ -57227,16 +57243,19 @@ | ||
| 57227 | 57243 | ** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). |
| 57228 | 57244 | */ |
| 57229 | 57245 | SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){ |
| 57230 | 57246 | int i; |
| 57231 | 57247 | yDbMask mask; |
| 57232 | - sqlite3 *db = p->db; | |
| 57233 | - Db *aDb = db->aDb; | |
| 57234 | - int nDb = db->nDb; | |
| 57235 | - | |
| 57248 | + sqlite3 *db; | |
| 57249 | + Db *aDb; | |
| 57250 | + int nDb; | |
| 57251 | + if( p->lockMask==0 ) return; /* The common case */ | |
| 57252 | + db = p->db; | |
| 57253 | + aDb = db->aDb; | |
| 57254 | + nDb = db->nDb; | |
| 57236 | 57255 | for(i=0, mask=1; i<nDb; i++, mask += mask){ |
| 57237 | - if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ | |
| 57256 | + if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ | |
| 57238 | 57257 | sqlite3BtreeLeave(aDb[i].pBt); |
| 57239 | 57258 | } |
| 57240 | 57259 | } |
| 57241 | 57260 | } |
| 57242 | 57261 | #endif |
| @@ -60834,11 +60853,11 @@ | ||
| 60834 | 60853 | if( db->vdbeExecCnt>1 ){ |
| 60835 | 60854 | while( *zRawSql ){ |
| 60836 | 60855 | const char *zStart = zRawSql; |
| 60837 | 60856 | while( *(zRawSql++)!='\n' && *zRawSql ); |
| 60838 | 60857 | sqlite3StrAccumAppend(&out, "-- ", 3); |
| 60839 | - sqlite3StrAccumAppend(&out, zStart, zRawSql-zStart); | |
| 60858 | + sqlite3StrAccumAppend(&out, zStart, (int)(zRawSql-zStart)); | |
| 60840 | 60859 | } |
| 60841 | 60860 | }else{ |
| 60842 | 60861 | while( zRawSql[0] ){ |
| 60843 | 60862 | n = findNextHostParameter(zRawSql, &nToken); |
| 60844 | 60863 | assert( n>0 ); |
| @@ -66139,12 +66158,10 @@ | ||
| 66139 | 66158 | #ifdef SQLITE_DEBUG |
| 66140 | 66159 | for(u.bu.iDb=0; u.bu.iDb<db->nDb; u.bu.iDb++){ |
| 66141 | 66160 | assert( u.bu.iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[u.bu.iDb].pBt) ); |
| 66142 | 66161 | } |
| 66143 | 66162 | #endif |
| 66144 | - assert( p->btreeMask == ~(yDbMask)0 ); | |
| 66145 | - | |
| 66146 | 66163 | |
| 66147 | 66164 | u.bu.iDb = pOp->p1; |
| 66148 | 66165 | assert( u.bu.iDb>=0 && u.bu.iDb<db->nDb ); |
| 66149 | 66166 | assert( DbHasProperty(db, u.bu.iDb, DB_SchemaLoaded) ); |
| 66150 | 66167 | /* Used to be a conditional */ { |
| @@ -86021,10 +86038,15 @@ | ||
| 86021 | 86038 | |
| 86022 | 86039 | #ifdef SQLITE_OMIT_COMPLETE |
| 86023 | 86040 | # define sqlite3_complete 0 |
| 86024 | 86041 | # define sqlite3_complete16 0 |
| 86025 | 86042 | #endif |
| 86043 | + | |
| 86044 | +#ifdef SQLITE_OMIT_DECLTYPE | |
| 86045 | +# define sqlite3_column_decltype16 0 | |
| 86046 | +# define sqlite3_column_decltype 0 | |
| 86047 | +#endif | |
| 86026 | 86048 | |
| 86027 | 86049 | #ifdef SQLITE_OMIT_PROGRESS_CALLBACK |
| 86028 | 86050 | # define sqlite3_progress_handler 0 |
| 86029 | 86051 | #endif |
| 86030 | 86052 | |
| @@ -89790,10 +89812,26 @@ | ||
| 89790 | 89812 | char *zMsg = sqlite3MPrintf(pParse->db, "USE TEMP B-TREE FOR %s", zUsage); |
| 89791 | 89813 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 89792 | 89814 | } |
| 89793 | 89815 | } |
| 89794 | 89816 | |
| 89817 | +/* | |
| 89818 | +** Assign expression b to lvalue a. A second, no-op, version of this macro | |
| 89819 | +** is provided when SQLITE_OMIT_EXPLAIN is defined. This allows the code | |
| 89820 | +** in sqlite3Select() to assign values to structure member variables that | |
| 89821 | +** only exist if SQLITE_OMIT_EXPLAIN is not defined without polluting the | |
| 89822 | +** code with #ifndef directives. | |
| 89823 | +*/ | |
| 89824 | +# define explainSetInteger(a, b) a = b | |
| 89825 | + | |
| 89826 | +#else | |
| 89827 | +/* No-op versions of the explainXXX() functions and macros. */ | |
| 89828 | +# define explainTempTable(y,z) | |
| 89829 | +# define explainSetInteger(y,z) | |
| 89830 | +#endif | |
| 89831 | + | |
| 89832 | +#if !defined(SQLITE_OMIT_EXPLAIN) && !defined(SQLITE_OMIT_COMPOUND_SELECT) | |
| 89795 | 89833 | /* |
| 89796 | 89834 | ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function |
| 89797 | 89835 | ** is a no-op. Otherwise, it adds a single row of output to the EQP result, |
| 89798 | 89836 | ** where the caption is of one of the two forms: |
| 89799 | 89837 | ** |
| @@ -89821,25 +89859,13 @@ | ||
| 89821 | 89859 | bUseTmp?"USING TEMP B-TREE ":"", selectOpName(op) |
| 89822 | 89860 | ); |
| 89823 | 89861 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 89824 | 89862 | } |
| 89825 | 89863 | } |
| 89826 | - | |
| 89827 | -/* | |
| 89828 | -** Assign expression b to lvalue a. A second, no-op, version of this macro | |
| 89829 | -** is provided when SQLITE_OMIT_EXPLAIN is defined. This allows the code | |
| 89830 | -** in sqlite3Select() to assign values to structure member variables that | |
| 89831 | -** only exist if SQLITE_OMIT_EXPLAIN is not defined without polluting the | |
| 89832 | -** code with #ifndef directives. | |
| 89833 | -*/ | |
| 89834 | -# define explainSetInteger(a, b) a = b | |
| 89835 | - | |
| 89836 | 89864 | #else |
| 89837 | 89865 | /* No-op versions of the explainXXX() functions and macros. */ |
| 89838 | -# define explainTempTable(y,z) | |
| 89839 | 89866 | # define explainComposite(v,w,x,y,z) |
| 89840 | -# define explainSetInteger(y,z) | |
| 89841 | 89867 | #endif |
| 89842 | 89868 | |
| 89843 | 89869 | /* |
| 89844 | 89870 | ** If the inner loop was generated using a non-null pOrderBy argument, |
| 89845 | 89871 | ** then the results were placed in a sorter. After the loop is terminated |
| @@ -106809,11 +106835,11 @@ | ||
| 106809 | 106835 | va_list ap; |
| 106810 | 106836 | int rc; |
| 106811 | 106837 | va_start(ap, op); |
| 106812 | 106838 | switch( op ){ |
| 106813 | 106839 | case SQLITE_DBCONFIG_LOOKASIDE: { |
| 106814 | - void *pBuf = va_arg(ap, void*); /* IMP: R-21112-12275 */ | |
| 106840 | + void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */ | |
| 106815 | 106841 | int sz = va_arg(ap, int); /* IMP: R-47871-25994 */ |
| 106816 | 106842 | int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */ |
| 106817 | 106843 | rc = setupLookaside(db, pBuf, sz, cnt); |
| 106818 | 106844 | break; |
| 106819 | 106845 | } |
| 106820 | 106846 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -198,11 +198,11 @@ | |
| 198 | # define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 1000 |
| 199 | #endif |
| 200 | |
| 201 | /* |
| 202 | ** The maximum number of attached databases. This must be between 0 |
| 203 | ** and 30. The upper bound on 30 is because a 32-bit integer bitmap |
| 204 | ** is used internally to track attached databases. |
| 205 | */ |
| 206 | #ifndef SQLITE_MAX_ATTACHED |
| 207 | # define SQLITE_MAX_ATTACHED 10 |
| 208 | #endif |
| @@ -650,11 +650,11 @@ | |
| 650 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 651 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 652 | */ |
| 653 | #define SQLITE_VERSION "3.7.6" |
| 654 | #define SQLITE_VERSION_NUMBER 3007006 |
| 655 | #define SQLITE_SOURCE_ID "2011-04-05 22:08:24 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81" |
| 656 | |
| 657 | /* |
| 658 | ** CAPI3REF: Run-Time Library Version Numbers |
| 659 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 660 | ** |
| @@ -1273,11 +1273,11 @@ | |
| 1273 | ** when the database connection has [PRAGMA synchronous] set to OFF.)^ |
| 1274 | ** Some specialized VFSes need this signal in order to operate correctly |
| 1275 | ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most |
| 1276 | ** VFSes do not need this signal and should silently ignore this opcode. |
| 1277 | ** Applications should not call [sqlite3_file_control()] with this |
| 1278 | ** opcode as doing so may disrupt the operation of the specilized VFSes |
| 1279 | ** that do require it. |
| 1280 | */ |
| 1281 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1282 | #define SQLITE_GET_LOCKPROXYFILE 2 |
| 1283 | #define SQLITE_SET_LOCKPROXYFILE 3 |
| @@ -1855,11 +1855,11 @@ | |
| 1855 | ** </dd> |
| 1856 | ** |
| 1857 | ** <dt>SQLITE_CONFIG_SCRATCH</dt> |
| 1858 | ** <dd> ^This option specifies a static memory buffer that SQLite can use for |
| 1859 | ** scratch memory. There are three arguments: A pointer an 8-byte |
| 1860 | ** aligned memory buffer from which the scrach allocations will be |
| 1861 | ** drawn, the size of each scratch allocation (sz), |
| 1862 | ** and the maximum number of scratch allocations (N). The sz |
| 1863 | ** argument must be a multiple of 16. |
| 1864 | ** The first argument must be a pointer to an 8-byte aligned buffer |
| 1865 | ** of at least sz*N bytes of memory. |
| @@ -2007,11 +2007,11 @@ | |
| 2007 | ** <dl> |
| 2008 | ** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> |
| 2009 | ** <dd> ^This option takes three additional arguments that determine the |
| 2010 | ** [lookaside memory allocator] configuration for the [database connection]. |
| 2011 | ** ^The first argument (the third parameter to [sqlite3_db_config()] is a |
| 2012 | ** pointer to an memory buffer to use for lookaside memory. |
| 2013 | ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb |
| 2014 | ** may be NULL in which case SQLite will allocate the |
| 2015 | ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the |
| 2016 | ** size of each lookaside buffer slot. ^The third argument is the number of |
| 2017 | ** slots. The size of the buffer in the first argument must be greater than |
| @@ -2039,11 +2039,11 @@ | |
| 2039 | ** |
| 2040 | ** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt> |
| 2041 | ** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers]. |
| 2042 | ** There should be two additional arguments. |
| 2043 | ** The first argument is an integer which is 0 to disable triggers, |
| 2044 | ** positive to enable trigers or negative to leave the setting unchanged. |
| 2045 | ** The second parameter is a pointer to an integer into which |
| 2046 | ** is written 0 or 1 to indicate whether triggers are disabled or enabled |
| 2047 | ** following this call. The second parameter may be a NULL pointer, in |
| 2048 | ** which case the trigger setting is not reported back. </dd> |
| 2049 | ** |
| @@ -2651,11 +2651,11 @@ | |
| 2651 | SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2652 | |
| 2653 | /* |
| 2654 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2655 | ** |
| 2656 | ** ^This routine registers a authorizer callback with a particular |
| 2657 | ** [database connection], supplied in the first argument. |
| 2658 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 2659 | ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], |
| 2660 | ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various |
| 2661 | ** points during the compilation process, as logic is being created |
| @@ -3297,11 +3297,11 @@ | |
| 3297 | ** will accept either a protected or an unprotected sqlite3_value. |
| 3298 | ** Every interface that accepts sqlite3_value arguments specifies |
| 3299 | ** whether or not it requires a protected sqlite3_value. |
| 3300 | ** |
| 3301 | ** The terms "protected" and "unprotected" refer to whether or not |
| 3302 | ** a mutex is held. A internal mutex is held for a protected |
| 3303 | ** sqlite3_value object but no mutex is held for an unprotected |
| 3304 | ** sqlite3_value object. If SQLite is compiled to be single-threaded |
| 3305 | ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) |
| 3306 | ** or if SQLite is run in one of reduced mutex modes |
| 3307 | ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] |
| @@ -3983,11 +3983,11 @@ | |
| 3983 | ** |
| 3984 | ** ^These functions (collectively known as "function creation routines") |
| 3985 | ** are used to add SQL functions or aggregates or to redefine the behavior |
| 3986 | ** of existing SQL functions or aggregates. The only differences between |
| 3987 | ** these routines are the text encoding expected for |
| 3988 | ** the the second parameter (the name of the function being created) |
| 3989 | ** and the presence or absence of a destructor callback for |
| 3990 | ** the application data pointer. |
| 3991 | ** |
| 3992 | ** ^The first parameter is the [database connection] to which the SQL |
| 3993 | ** function is to be added. ^If an application uses more than one database |
| @@ -4028,11 +4028,11 @@ | |
| 4028 | ** pointers to C-language functions that implement the SQL function or |
| 4029 | ** aggregate. ^A scalar SQL function requires an implementation of the xFunc |
| 4030 | ** callback only; NULL pointers must be passed as the xStep and xFinal |
| 4031 | ** parameters. ^An aggregate SQL function requires an implementation of xStep |
| 4032 | ** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing |
| 4033 | ** SQL function or aggregate, pass NULL poiners for all three function |
| 4034 | ** callbacks. |
| 4035 | ** |
| 4036 | ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, |
| 4037 | ** then it is destructor for the application data pointer. |
| 4038 | ** The destructor is invoked when the function is deleted, either by being |
| @@ -4462,11 +4462,11 @@ | |
| 4462 | ** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep |
| 4463 | ** force strings to be UTF16 with native byte order. |
| 4464 | ** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin |
| 4465 | ** on an even byte address. |
| 4466 | ** |
| 4467 | ** ^The fourth argument, pArg, is a application data pointer that is passed |
| 4468 | ** through as the first argument to the collating function callback. |
| 4469 | ** |
| 4470 | ** ^The fifth argument, xCallback, is a pointer to the collating function. |
| 4471 | ** ^Multiple collating functions can be registered using the same name but |
| 4472 | ** with different eTextRep parameters and SQLite will use whichever |
| @@ -4478,11 +4478,11 @@ | |
| 4478 | ** ^The collating function callback is invoked with a copy of the pArg |
| 4479 | ** application data pointer and with two strings in the encoding specified |
| 4480 | ** by the eTextRep argument. The collating function must return an |
| 4481 | ** integer that is negative, zero, or positive |
| 4482 | ** if the first string is less than, equal to, or greater than the second, |
| 4483 | ** respectively. A collating function must alway return the same answer |
| 4484 | ** given the same inputs. If two or more collating functions are registered |
| 4485 | ** to the same collation name (using different eTextRep values) then all |
| 4486 | ** must give an equivalent answer when invoked with equivalent strings. |
| 4487 | ** The collating function must obey the following properties for all |
| 4488 | ** strings A, B, and C: |
| @@ -4890,11 +4890,11 @@ | |
| 4890 | ** <ul> |
| 4891 | ** <li> The soft heap limit is set to zero. |
| 4892 | ** <li> Memory accounting is disabled using a combination of the |
| 4893 | ** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and |
| 4894 | ** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. |
| 4895 | ** <li> An alternative page cache implementation is specifed using |
| 4896 | ** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). |
| 4897 | ** <li> The page cache allocates from its own memory pool supplied |
| 4898 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 4899 | ** from the heap. |
| 4900 | ** </ul>)^ |
| @@ -5111,11 +5111,11 @@ | |
| 5111 | |
| 5112 | /* |
| 5113 | ** CAPI3REF: Virtual Table Object |
| 5114 | ** KEYWORDS: sqlite3_module {virtual table module} |
| 5115 | ** |
| 5116 | ** This structure, sometimes called a a "virtual table module", |
| 5117 | ** defines the implementation of a [virtual tables]. |
| 5118 | ** This structure consists mostly of methods for the module. |
| 5119 | ** |
| 5120 | ** ^A virtual table module is created by filling in a persistent |
| 5121 | ** instance of this structure and passing a pointer to that instance |
| @@ -5423,11 +5423,11 @@ | |
| 5423 | ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects |
| 5424 | ** then the BLOB handle is marked as "expired". |
| 5425 | ** This is true if any column of the row is changed, even a column |
| 5426 | ** other than the one the BLOB handle is open on.)^ |
| 5427 | ** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for |
| 5428 | ** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. |
| 5429 | ** ^(Changes written into a BLOB prior to the BLOB expiring are not |
| 5430 | ** rolled back by the expiration of the BLOB. Such changes will eventually |
| 5431 | ** commit if the transaction continues to completion.)^ |
| 5432 | ** |
| 5433 | ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of |
| @@ -7825,10 +7825,11 @@ | |
| 7825 | # define sqlite3BtreeEnter(X) |
| 7826 | # define sqlite3BtreeEnterAll(X) |
| 7827 | #endif |
| 7828 | |
| 7829 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE |
| 7830 | SQLITE_PRIVATE void sqlite3BtreeLeave(Btree*); |
| 7831 | SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor*); |
| 7832 | SQLITE_PRIVATE void sqlite3BtreeLeaveCursor(BtCursor*); |
| 7833 | SQLITE_PRIVATE void sqlite3BtreeLeaveAll(sqlite3*); |
| 7834 | #ifndef NDEBUG |
| @@ -7837,10 +7838,11 @@ | |
| 7837 | SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3*); |
| 7838 | SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*); |
| 7839 | #endif |
| 7840 | #else |
| 7841 | |
| 7842 | # define sqlite3BtreeLeave(X) |
| 7843 | # define sqlite3BtreeEnterCursor(X) |
| 7844 | # define sqlite3BtreeLeaveCursor(X) |
| 7845 | # define sqlite3BtreeLeaveAll(X) |
| 7846 | |
| @@ -12493,10 +12495,11 @@ | |
| 12493 | u8 usesStmtJournal; /* True if uses a statement journal */ |
| 12494 | u8 readOnly; /* True for read-only statements */ |
| 12495 | u8 isPrepareV2; /* True if prepared with prepare_v2() */ |
| 12496 | int nChange; /* Number of db changes made since last reset */ |
| 12497 | yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */ |
| 12498 | int iStatement; /* Statement number (or 0 if has not opened stmt) */ |
| 12499 | int aCounter[3]; /* Counters used by sqlite3_stmt_status() */ |
| 12500 | #ifndef SQLITE_OMIT_TRACE |
| 12501 | i64 startTime; /* Time when query started - used for profiling */ |
| 12502 | #endif |
| @@ -26784,22 +26787,21 @@ | |
| 26784 | ** is the same technique used by glibc to implement posix_fallocate() |
| 26785 | ** on systems that do not have a real fallocate() system call. |
| 26786 | */ |
| 26787 | int nBlk = buf.st_blksize; /* File-system block size */ |
| 26788 | i64 iWrite; /* Next offset to write to */ |
| 26789 | int nWrite; /* Return value from seekAndWrite() */ |
| 26790 | |
| 26791 | if( robust_ftruncate(pFile->h, nSize) ){ |
| 26792 | pFile->lastErrno = errno; |
| 26793 | return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); |
| 26794 | } |
| 26795 | iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; |
| 26796 | do { |
| 26797 | nWrite = seekAndWrite(pFile, iWrite, "", 1); |
| 26798 | iWrite += nBlk; |
| 26799 | } while( nWrite==1 && iWrite<nSize ); |
| 26800 | if( nWrite!=1 ) return SQLITE_IOERR_WRITE; |
| 26801 | #endif |
| 26802 | } |
| 26803 | } |
| 26804 | |
| 26805 | return SQLITE_OK; |
| @@ -46156,10 +46158,18 @@ | |
| 46156 | for(i=0; i<db->nDb; i++){ |
| 46157 | p = db->aDb[i].pBt; |
| 46158 | if( p ) sqlite3BtreeLeave(p); |
| 46159 | } |
| 46160 | } |
| 46161 | |
| 46162 | #ifndef NDEBUG |
| 46163 | /* |
| 46164 | ** Return true if the current thread holds the database connection |
| 46165 | ** mutex and all required BtShared mutexes. |
| @@ -48362,11 +48372,10 @@ | |
| 48362 | rc = sqlite3PagerNosync(pBt->pPager); |
| 48363 | sqlite3BtreeLeave(p); |
| 48364 | return rc; |
| 48365 | } |
| 48366 | |
| 48367 | #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) |
| 48368 | /* |
| 48369 | ** Change the default pages size and the number of reserved bytes per page. |
| 48370 | ** Or, if the page size has already been fixed, return SQLITE_READONLY |
| 48371 | ** without changing anything. |
| 48372 | ** |
| @@ -48417,10 +48426,11 @@ | |
| 48417 | */ |
| 48418 | SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){ |
| 48419 | return p->pBt->pageSize; |
| 48420 | } |
| 48421 | |
| 48422 | /* |
| 48423 | ** Return the number of bytes of space at the end of every page that |
| 48424 | ** are intentually left unused. This is the "reserved" space that is |
| 48425 | ** sometimes used by extensions. |
| 48426 | */ |
| @@ -51054,11 +51064,11 @@ | |
| 51054 | if( rc ){ |
| 51055 | pTrunk = 0; |
| 51056 | goto end_allocate_page; |
| 51057 | } |
| 51058 | |
| 51059 | k = get4byte(&pTrunk->aData[4]); |
| 51060 | if( k==0 && !searchList ){ |
| 51061 | /* The trunk has no leaves and the list is not being searched. |
| 51062 | ** So extract the trunk page itself and use it as the newly |
| 51063 | ** allocated page */ |
| 51064 | assert( pPrevTrunk==0 ); |
| @@ -51139,14 +51149,10 @@ | |
| 51139 | }else if( k>0 ){ |
| 51140 | /* Extract a leaf from the trunk */ |
| 51141 | u32 closest; |
| 51142 | Pgno iPage; |
| 51143 | unsigned char *aData = pTrunk->aData; |
| 51144 | rc = sqlite3PagerWrite(pTrunk->pDbPage); |
| 51145 | if( rc ){ |
| 51146 | goto end_allocate_page; |
| 51147 | } |
| 51148 | if( nearby>0 ){ |
| 51149 | u32 i; |
| 51150 | int dist; |
| 51151 | closest = 0; |
| 51152 | dist = sqlite3AbsInt32(get4byte(&aData[8]) - nearby); |
| @@ -51172,15 +51178,16 @@ | |
| 51172 | int noContent; |
| 51173 | *pPgno = iPage; |
| 51174 | TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d" |
| 51175 | ": %d more free pages\n", |
| 51176 | *pPgno, closest+1, k, pTrunk->pgno, n-1)); |
| 51177 | if( closest<k-1 ){ |
| 51178 | memcpy(&aData[8+closest*4], &aData[4+k*4], 4); |
| 51179 | } |
| 51180 | put4byte(&aData[4], k-1); |
| 51181 | assert( sqlite3PagerIswriteable(pTrunk->pDbPage) ); |
| 51182 | noContent = !btreeGetHasContent(pBt, *pPgno); |
| 51183 | rc = btreeGetPage(pBt, *pPgno, ppPage, noContent); |
| 51184 | if( rc==SQLITE_OK ){ |
| 51185 | rc = sqlite3PagerWrite((*ppPage)->pDbPage); |
| 51186 | if( rc!=SQLITE_OK ){ |
| @@ -51245,10 +51252,11 @@ | |
| 51245 | } |
| 51246 | (*ppPage)->isInit = 0; |
| 51247 | }else{ |
| 51248 | *ppPage = 0; |
| 51249 | } |
| 51250 | return rc; |
| 51251 | } |
| 51252 | |
| 51253 | /* |
| 51254 | ** This function is used to add page iPage to the database file free-list. |
| @@ -56384,11 +56392,12 @@ | |
| 56384 | pOp->p4type = P4_NOTUSED; |
| 56385 | p->expired = 0; |
| 56386 | if( op==OP_ParseSchema ){ |
| 56387 | /* Any program that uses the OP_ParseSchema opcode needs to lock |
| 56388 | ** all btrees. */ |
| 56389 | p->btreeMask = ~(yDbMask)0; |
| 56390 | } |
| 56391 | #ifdef SQLITE_DEBUG |
| 56392 | pOp->zComment = 0; |
| 56393 | if( sqlite3VdbeAddopTrace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]); |
| 56394 | #endif |
| @@ -57182,10 +57191,13 @@ | |
| 57182 | */ |
| 57183 | SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){ |
| 57184 | assert( i>=0 && i<p->db->nDb && i<(int)sizeof(yDbMask)*8 ); |
| 57185 | assert( i<(int)sizeof(p->btreeMask)*8 ); |
| 57186 | p->btreeMask |= ((yDbMask)1)<<i; |
| 57187 | } |
| 57188 | |
| 57189 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0 |
| 57190 | /* |
| 57191 | ** If SQLite is compiled to support shared-cache mode and to be threadsafe, |
| @@ -57209,15 +57221,19 @@ | |
| 57209 | ** be a problem. |
| 57210 | */ |
| 57211 | SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe *p){ |
| 57212 | int i; |
| 57213 | yDbMask mask; |
| 57214 | sqlite3 *db = p->db; |
| 57215 | Db *aDb = db->aDb; |
| 57216 | int nDb = db->nDb; |
| 57217 | for(i=0, mask=1; i<nDb; i++, mask += mask){ |
| 57218 | if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ |
| 57219 | sqlite3BtreeEnter(aDb[i].pBt); |
| 57220 | } |
| 57221 | } |
| 57222 | } |
| 57223 | #endif |
| @@ -57227,16 +57243,19 @@ | |
| 57227 | ** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). |
| 57228 | */ |
| 57229 | SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){ |
| 57230 | int i; |
| 57231 | yDbMask mask; |
| 57232 | sqlite3 *db = p->db; |
| 57233 | Db *aDb = db->aDb; |
| 57234 | int nDb = db->nDb; |
| 57235 | |
| 57236 | for(i=0, mask=1; i<nDb; i++, mask += mask){ |
| 57237 | if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ |
| 57238 | sqlite3BtreeLeave(aDb[i].pBt); |
| 57239 | } |
| 57240 | } |
| 57241 | } |
| 57242 | #endif |
| @@ -60834,11 +60853,11 @@ | |
| 60834 | if( db->vdbeExecCnt>1 ){ |
| 60835 | while( *zRawSql ){ |
| 60836 | const char *zStart = zRawSql; |
| 60837 | while( *(zRawSql++)!='\n' && *zRawSql ); |
| 60838 | sqlite3StrAccumAppend(&out, "-- ", 3); |
| 60839 | sqlite3StrAccumAppend(&out, zStart, zRawSql-zStart); |
| 60840 | } |
| 60841 | }else{ |
| 60842 | while( zRawSql[0] ){ |
| 60843 | n = findNextHostParameter(zRawSql, &nToken); |
| 60844 | assert( n>0 ); |
| @@ -66139,12 +66158,10 @@ | |
| 66139 | #ifdef SQLITE_DEBUG |
| 66140 | for(u.bu.iDb=0; u.bu.iDb<db->nDb; u.bu.iDb++){ |
| 66141 | assert( u.bu.iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[u.bu.iDb].pBt) ); |
| 66142 | } |
| 66143 | #endif |
| 66144 | assert( p->btreeMask == ~(yDbMask)0 ); |
| 66145 | |
| 66146 | |
| 66147 | u.bu.iDb = pOp->p1; |
| 66148 | assert( u.bu.iDb>=0 && u.bu.iDb<db->nDb ); |
| 66149 | assert( DbHasProperty(db, u.bu.iDb, DB_SchemaLoaded) ); |
| 66150 | /* Used to be a conditional */ { |
| @@ -86021,10 +86038,15 @@ | |
| 86021 | |
| 86022 | #ifdef SQLITE_OMIT_COMPLETE |
| 86023 | # define sqlite3_complete 0 |
| 86024 | # define sqlite3_complete16 0 |
| 86025 | #endif |
| 86026 | |
| 86027 | #ifdef SQLITE_OMIT_PROGRESS_CALLBACK |
| 86028 | # define sqlite3_progress_handler 0 |
| 86029 | #endif |
| 86030 | |
| @@ -89790,10 +89812,26 @@ | |
| 89790 | char *zMsg = sqlite3MPrintf(pParse->db, "USE TEMP B-TREE FOR %s", zUsage); |
| 89791 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 89792 | } |
| 89793 | } |
| 89794 | |
| 89795 | /* |
| 89796 | ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function |
| 89797 | ** is a no-op. Otherwise, it adds a single row of output to the EQP result, |
| 89798 | ** where the caption is of one of the two forms: |
| 89799 | ** |
| @@ -89821,25 +89859,13 @@ | |
| 89821 | bUseTmp?"USING TEMP B-TREE ":"", selectOpName(op) |
| 89822 | ); |
| 89823 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 89824 | } |
| 89825 | } |
| 89826 | |
| 89827 | /* |
| 89828 | ** Assign expression b to lvalue a. A second, no-op, version of this macro |
| 89829 | ** is provided when SQLITE_OMIT_EXPLAIN is defined. This allows the code |
| 89830 | ** in sqlite3Select() to assign values to structure member variables that |
| 89831 | ** only exist if SQLITE_OMIT_EXPLAIN is not defined without polluting the |
| 89832 | ** code with #ifndef directives. |
| 89833 | */ |
| 89834 | # define explainSetInteger(a, b) a = b |
| 89835 | |
| 89836 | #else |
| 89837 | /* No-op versions of the explainXXX() functions and macros. */ |
| 89838 | # define explainTempTable(y,z) |
| 89839 | # define explainComposite(v,w,x,y,z) |
| 89840 | # define explainSetInteger(y,z) |
| 89841 | #endif |
| 89842 | |
| 89843 | /* |
| 89844 | ** If the inner loop was generated using a non-null pOrderBy argument, |
| 89845 | ** then the results were placed in a sorter. After the loop is terminated |
| @@ -106809,11 +106835,11 @@ | |
| 106809 | va_list ap; |
| 106810 | int rc; |
| 106811 | va_start(ap, op); |
| 106812 | switch( op ){ |
| 106813 | case SQLITE_DBCONFIG_LOOKASIDE: { |
| 106814 | void *pBuf = va_arg(ap, void*); /* IMP: R-21112-12275 */ |
| 106815 | int sz = va_arg(ap, int); /* IMP: R-47871-25994 */ |
| 106816 | int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */ |
| 106817 | rc = setupLookaside(db, pBuf, sz, cnt); |
| 106818 | break; |
| 106819 | } |
| 106820 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -198,11 +198,11 @@ | |
| 198 | # define SQLITE_DEFAULT_WAL_AUTOCHECKPOINT 1000 |
| 199 | #endif |
| 200 | |
| 201 | /* |
| 202 | ** The maximum number of attached databases. This must be between 0 |
| 203 | ** and 62. The upper bound on 62 is because a 64-bit integer bitmap |
| 204 | ** is used internally to track attached databases. |
| 205 | */ |
| 206 | #ifndef SQLITE_MAX_ATTACHED |
| 207 | # define SQLITE_MAX_ATTACHED 10 |
| 208 | #endif |
| @@ -650,11 +650,11 @@ | |
| 650 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 651 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 652 | */ |
| 653 | #define SQLITE_VERSION "3.7.6" |
| 654 | #define SQLITE_VERSION_NUMBER 3007006 |
| 655 | #define SQLITE_SOURCE_ID "2011-04-07 15:24:08 bf78acb9dfacde0f08a5b3ceac13480f12a06168" |
| 656 | |
| 657 | /* |
| 658 | ** CAPI3REF: Run-Time Library Version Numbers |
| 659 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 660 | ** |
| @@ -1273,11 +1273,11 @@ | |
| 1273 | ** when the database connection has [PRAGMA synchronous] set to OFF.)^ |
| 1274 | ** Some specialized VFSes need this signal in order to operate correctly |
| 1275 | ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most |
| 1276 | ** VFSes do not need this signal and should silently ignore this opcode. |
| 1277 | ** Applications should not call [sqlite3_file_control()] with this |
| 1278 | ** opcode as doing so may disrupt the operation of the specialized VFSes |
| 1279 | ** that do require it. |
| 1280 | */ |
| 1281 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1282 | #define SQLITE_GET_LOCKPROXYFILE 2 |
| 1283 | #define SQLITE_SET_LOCKPROXYFILE 3 |
| @@ -1855,11 +1855,11 @@ | |
| 1855 | ** </dd> |
| 1856 | ** |
| 1857 | ** <dt>SQLITE_CONFIG_SCRATCH</dt> |
| 1858 | ** <dd> ^This option specifies a static memory buffer that SQLite can use for |
| 1859 | ** scratch memory. There are three arguments: A pointer an 8-byte |
| 1860 | ** aligned memory buffer from which the scratch allocations will be |
| 1861 | ** drawn, the size of each scratch allocation (sz), |
| 1862 | ** and the maximum number of scratch allocations (N). The sz |
| 1863 | ** argument must be a multiple of 16. |
| 1864 | ** The first argument must be a pointer to an 8-byte aligned buffer |
| 1865 | ** of at least sz*N bytes of memory. |
| @@ -2007,11 +2007,11 @@ | |
| 2007 | ** <dl> |
| 2008 | ** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> |
| 2009 | ** <dd> ^This option takes three additional arguments that determine the |
| 2010 | ** [lookaside memory allocator] configuration for the [database connection]. |
| 2011 | ** ^The first argument (the third parameter to [sqlite3_db_config()] is a |
| 2012 | ** pointer to a memory buffer to use for lookaside memory. |
| 2013 | ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb |
| 2014 | ** may be NULL in which case SQLite will allocate the |
| 2015 | ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the |
| 2016 | ** size of each lookaside buffer slot. ^The third argument is the number of |
| 2017 | ** slots. The size of the buffer in the first argument must be greater than |
| @@ -2039,11 +2039,11 @@ | |
| 2039 | ** |
| 2040 | ** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt> |
| 2041 | ** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers]. |
| 2042 | ** There should be two additional arguments. |
| 2043 | ** The first argument is an integer which is 0 to disable triggers, |
| 2044 | ** positive to enable triggers or negative to leave the setting unchanged. |
| 2045 | ** The second parameter is a pointer to an integer into which |
| 2046 | ** is written 0 or 1 to indicate whether triggers are disabled or enabled |
| 2047 | ** following this call. The second parameter may be a NULL pointer, in |
| 2048 | ** which case the trigger setting is not reported back. </dd> |
| 2049 | ** |
| @@ -2651,11 +2651,11 @@ | |
| 2651 | SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2652 | |
| 2653 | /* |
| 2654 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2655 | ** |
| 2656 | ** ^This routine registers an authorizer callback with a particular |
| 2657 | ** [database connection], supplied in the first argument. |
| 2658 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 2659 | ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], |
| 2660 | ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various |
| 2661 | ** points during the compilation process, as logic is being created |
| @@ -3297,11 +3297,11 @@ | |
| 3297 | ** will accept either a protected or an unprotected sqlite3_value. |
| 3298 | ** Every interface that accepts sqlite3_value arguments specifies |
| 3299 | ** whether or not it requires a protected sqlite3_value. |
| 3300 | ** |
| 3301 | ** The terms "protected" and "unprotected" refer to whether or not |
| 3302 | ** a mutex is held. An internal mutex is held for a protected |
| 3303 | ** sqlite3_value object but no mutex is held for an unprotected |
| 3304 | ** sqlite3_value object. If SQLite is compiled to be single-threaded |
| 3305 | ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) |
| 3306 | ** or if SQLite is run in one of reduced mutex modes |
| 3307 | ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] |
| @@ -3983,11 +3983,11 @@ | |
| 3983 | ** |
| 3984 | ** ^These functions (collectively known as "function creation routines") |
| 3985 | ** are used to add SQL functions or aggregates or to redefine the behavior |
| 3986 | ** of existing SQL functions or aggregates. The only differences between |
| 3987 | ** these routines are the text encoding expected for |
| 3988 | ** the second parameter (the name of the function being created) |
| 3989 | ** and the presence or absence of a destructor callback for |
| 3990 | ** the application data pointer. |
| 3991 | ** |
| 3992 | ** ^The first parameter is the [database connection] to which the SQL |
| 3993 | ** function is to be added. ^If an application uses more than one database |
| @@ -4028,11 +4028,11 @@ | |
| 4028 | ** pointers to C-language functions that implement the SQL function or |
| 4029 | ** aggregate. ^A scalar SQL function requires an implementation of the xFunc |
| 4030 | ** callback only; NULL pointers must be passed as the xStep and xFinal |
| 4031 | ** parameters. ^An aggregate SQL function requires an implementation of xStep |
| 4032 | ** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing |
| 4033 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 4034 | ** callbacks. |
| 4035 | ** |
| 4036 | ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, |
| 4037 | ** then it is destructor for the application data pointer. |
| 4038 | ** The destructor is invoked when the function is deleted, either by being |
| @@ -4462,11 +4462,11 @@ | |
| 4462 | ** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep |
| 4463 | ** force strings to be UTF16 with native byte order. |
| 4464 | ** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin |
| 4465 | ** on an even byte address. |
| 4466 | ** |
| 4467 | ** ^The fourth argument, pArg, is an application data pointer that is passed |
| 4468 | ** through as the first argument to the collating function callback. |
| 4469 | ** |
| 4470 | ** ^The fifth argument, xCallback, is a pointer to the collating function. |
| 4471 | ** ^Multiple collating functions can be registered using the same name but |
| 4472 | ** with different eTextRep parameters and SQLite will use whichever |
| @@ -4478,11 +4478,11 @@ | |
| 4478 | ** ^The collating function callback is invoked with a copy of the pArg |
| 4479 | ** application data pointer and with two strings in the encoding specified |
| 4480 | ** by the eTextRep argument. The collating function must return an |
| 4481 | ** integer that is negative, zero, or positive |
| 4482 | ** if the first string is less than, equal to, or greater than the second, |
| 4483 | ** respectively. A collating function must always return the same answer |
| 4484 | ** given the same inputs. If two or more collating functions are registered |
| 4485 | ** to the same collation name (using different eTextRep values) then all |
| 4486 | ** must give an equivalent answer when invoked with equivalent strings. |
| 4487 | ** The collating function must obey the following properties for all |
| 4488 | ** strings A, B, and C: |
| @@ -4890,11 +4890,11 @@ | |
| 4890 | ** <ul> |
| 4891 | ** <li> The soft heap limit is set to zero. |
| 4892 | ** <li> Memory accounting is disabled using a combination of the |
| 4893 | ** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and |
| 4894 | ** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. |
| 4895 | ** <li> An alternative page cache implementation is specified using |
| 4896 | ** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). |
| 4897 | ** <li> The page cache allocates from its own memory pool supplied |
| 4898 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 4899 | ** from the heap. |
| 4900 | ** </ul>)^ |
| @@ -5111,11 +5111,11 @@ | |
| 5111 | |
| 5112 | /* |
| 5113 | ** CAPI3REF: Virtual Table Object |
| 5114 | ** KEYWORDS: sqlite3_module {virtual table module} |
| 5115 | ** |
| 5116 | ** This structure, sometimes called a "virtual table module", |
| 5117 | ** defines the implementation of a [virtual tables]. |
| 5118 | ** This structure consists mostly of methods for the module. |
| 5119 | ** |
| 5120 | ** ^A virtual table module is created by filling in a persistent |
| 5121 | ** instance of this structure and passing a pointer to that instance |
| @@ -5423,11 +5423,11 @@ | |
| 5423 | ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects |
| 5424 | ** then the BLOB handle is marked as "expired". |
| 5425 | ** This is true if any column of the row is changed, even a column |
| 5426 | ** other than the one the BLOB handle is open on.)^ |
| 5427 | ** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for |
| 5428 | ** an expired BLOB handle fail with a return code of [SQLITE_ABORT]. |
| 5429 | ** ^(Changes written into a BLOB prior to the BLOB expiring are not |
| 5430 | ** rolled back by the expiration of the BLOB. Such changes will eventually |
| 5431 | ** commit if the transaction continues to completion.)^ |
| 5432 | ** |
| 5433 | ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of |
| @@ -7825,10 +7825,11 @@ | |
| 7825 | # define sqlite3BtreeEnter(X) |
| 7826 | # define sqlite3BtreeEnterAll(X) |
| 7827 | #endif |
| 7828 | |
| 7829 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE |
| 7830 | SQLITE_PRIVATE int sqlite3BtreeSharable(Btree*); |
| 7831 | SQLITE_PRIVATE void sqlite3BtreeLeave(Btree*); |
| 7832 | SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor*); |
| 7833 | SQLITE_PRIVATE void sqlite3BtreeLeaveCursor(BtCursor*); |
| 7834 | SQLITE_PRIVATE void sqlite3BtreeLeaveAll(sqlite3*); |
| 7835 | #ifndef NDEBUG |
| @@ -7837,10 +7838,11 @@ | |
| 7838 | SQLITE_PRIVATE int sqlite3BtreeHoldsAllMutexes(sqlite3*); |
| 7839 | SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*); |
| 7840 | #endif |
| 7841 | #else |
| 7842 | |
| 7843 | # define sqlite3BtreeSharable(X) 0 |
| 7844 | # define sqlite3BtreeLeave(X) |
| 7845 | # define sqlite3BtreeEnterCursor(X) |
| 7846 | # define sqlite3BtreeLeaveCursor(X) |
| 7847 | # define sqlite3BtreeLeaveAll(X) |
| 7848 | |
| @@ -12493,10 +12495,11 @@ | |
| 12495 | u8 usesStmtJournal; /* True if uses a statement journal */ |
| 12496 | u8 readOnly; /* True for read-only statements */ |
| 12497 | u8 isPrepareV2; /* True if prepared with prepare_v2() */ |
| 12498 | int nChange; /* Number of db changes made since last reset */ |
| 12499 | yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */ |
| 12500 | yDbMask lockMask; /* Subset of btreeMask that requires a lock */ |
| 12501 | int iStatement; /* Statement number (or 0 if has not opened stmt) */ |
| 12502 | int aCounter[3]; /* Counters used by sqlite3_stmt_status() */ |
| 12503 | #ifndef SQLITE_OMIT_TRACE |
| 12504 | i64 startTime; /* Time when query started - used for profiling */ |
| 12505 | #endif |
| @@ -26784,22 +26787,21 @@ | |
| 26787 | ** is the same technique used by glibc to implement posix_fallocate() |
| 26788 | ** on systems that do not have a real fallocate() system call. |
| 26789 | */ |
| 26790 | int nBlk = buf.st_blksize; /* File-system block size */ |
| 26791 | i64 iWrite; /* Next offset to write to */ |
| 26792 | |
| 26793 | if( robust_ftruncate(pFile->h, nSize) ){ |
| 26794 | pFile->lastErrno = errno; |
| 26795 | return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); |
| 26796 | } |
| 26797 | iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; |
| 26798 | while( iWrite<nSize ){ |
| 26799 | int nWrite = seekAndWrite(pFile, iWrite, "", 1); |
| 26800 | if( nWrite!=1 ) return SQLITE_IOERR_WRITE; |
| 26801 | iWrite += nBlk; |
| 26802 | } |
| 26803 | #endif |
| 26804 | } |
| 26805 | } |
| 26806 | |
| 26807 | return SQLITE_OK; |
| @@ -46156,10 +46158,18 @@ | |
| 46158 | for(i=0; i<db->nDb; i++){ |
| 46159 | p = db->aDb[i].pBt; |
| 46160 | if( p ) sqlite3BtreeLeave(p); |
| 46161 | } |
| 46162 | } |
| 46163 | |
| 46164 | /* |
| 46165 | ** Return true if a particular Btree requires a lock. Return FALSE if |
| 46166 | ** no lock is ever required since it is not sharable. |
| 46167 | */ |
| 46168 | SQLITE_PRIVATE int sqlite3BtreeSharable(Btree *p){ |
| 46169 | return p->sharable; |
| 46170 | } |
| 46171 | |
| 46172 | #ifndef NDEBUG |
| 46173 | /* |
| 46174 | ** Return true if the current thread holds the database connection |
| 46175 | ** mutex and all required BtShared mutexes. |
| @@ -48362,11 +48372,10 @@ | |
| 48372 | rc = sqlite3PagerNosync(pBt->pPager); |
| 48373 | sqlite3BtreeLeave(p); |
| 48374 | return rc; |
| 48375 | } |
| 48376 | |
| 48377 | /* |
| 48378 | ** Change the default pages size and the number of reserved bytes per page. |
| 48379 | ** Or, if the page size has already been fixed, return SQLITE_READONLY |
| 48380 | ** without changing anything. |
| 48381 | ** |
| @@ -48417,10 +48426,11 @@ | |
| 48426 | */ |
| 48427 | SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){ |
| 48428 | return p->pBt->pageSize; |
| 48429 | } |
| 48430 | |
| 48431 | #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) |
| 48432 | /* |
| 48433 | ** Return the number of bytes of space at the end of every page that |
| 48434 | ** are intentually left unused. This is the "reserved" space that is |
| 48435 | ** sometimes used by extensions. |
| 48436 | */ |
| @@ -51054,11 +51064,11 @@ | |
| 51064 | if( rc ){ |
| 51065 | pTrunk = 0; |
| 51066 | goto end_allocate_page; |
| 51067 | } |
| 51068 | |
| 51069 | k = get4byte(&pTrunk->aData[4]); /* # of leaves on this trunk page */ |
| 51070 | if( k==0 && !searchList ){ |
| 51071 | /* The trunk has no leaves and the list is not being searched. |
| 51072 | ** So extract the trunk page itself and use it as the newly |
| 51073 | ** allocated page */ |
| 51074 | assert( pPrevTrunk==0 ); |
| @@ -51139,14 +51149,10 @@ | |
| 51149 | }else if( k>0 ){ |
| 51150 | /* Extract a leaf from the trunk */ |
| 51151 | u32 closest; |
| 51152 | Pgno iPage; |
| 51153 | unsigned char *aData = pTrunk->aData; |
| 51154 | if( nearby>0 ){ |
| 51155 | u32 i; |
| 51156 | int dist; |
| 51157 | closest = 0; |
| 51158 | dist = sqlite3AbsInt32(get4byte(&aData[8]) - nearby); |
| @@ -51172,15 +51178,16 @@ | |
| 51178 | int noContent; |
| 51179 | *pPgno = iPage; |
| 51180 | TRACE(("ALLOCATE: %d was leaf %d of %d on trunk %d" |
| 51181 | ": %d more free pages\n", |
| 51182 | *pPgno, closest+1, k, pTrunk->pgno, n-1)); |
| 51183 | rc = sqlite3PagerWrite(pTrunk->pDbPage); |
| 51184 | if( rc ) goto end_allocate_page; |
| 51185 | if( closest<k-1 ){ |
| 51186 | memcpy(&aData[8+closest*4], &aData[4+k*4], 4); |
| 51187 | } |
| 51188 | put4byte(&aData[4], k-1); |
| 51189 | noContent = !btreeGetHasContent(pBt, *pPgno); |
| 51190 | rc = btreeGetPage(pBt, *pPgno, ppPage, noContent); |
| 51191 | if( rc==SQLITE_OK ){ |
| 51192 | rc = sqlite3PagerWrite((*ppPage)->pDbPage); |
| 51193 | if( rc!=SQLITE_OK ){ |
| @@ -51245,10 +51252,11 @@ | |
| 51252 | } |
| 51253 | (*ppPage)->isInit = 0; |
| 51254 | }else{ |
| 51255 | *ppPage = 0; |
| 51256 | } |
| 51257 | assert( rc!=SQLITE_OK || sqlite3PagerIswriteable((*ppPage)->pDbPage) ); |
| 51258 | return rc; |
| 51259 | } |
| 51260 | |
| 51261 | /* |
| 51262 | ** This function is used to add page iPage to the database file free-list. |
| @@ -56384,11 +56392,12 @@ | |
| 56392 | pOp->p4type = P4_NOTUSED; |
| 56393 | p->expired = 0; |
| 56394 | if( op==OP_ParseSchema ){ |
| 56395 | /* Any program that uses the OP_ParseSchema opcode needs to lock |
| 56396 | ** all btrees. */ |
| 56397 | int j; |
| 56398 | for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j); |
| 56399 | } |
| 56400 | #ifdef SQLITE_DEBUG |
| 56401 | pOp->zComment = 0; |
| 56402 | if( sqlite3VdbeAddopTrace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]); |
| 56403 | #endif |
| @@ -57182,10 +57191,13 @@ | |
| 57191 | */ |
| 57192 | SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){ |
| 57193 | assert( i>=0 && i<p->db->nDb && i<(int)sizeof(yDbMask)*8 ); |
| 57194 | assert( i<(int)sizeof(p->btreeMask)*8 ); |
| 57195 | p->btreeMask |= ((yDbMask)1)<<i; |
| 57196 | if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){ |
| 57197 | p->lockMask |= ((yDbMask)1)<<i; |
| 57198 | } |
| 57199 | } |
| 57200 | |
| 57201 | #if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0 |
| 57202 | /* |
| 57203 | ** If SQLite is compiled to support shared-cache mode and to be threadsafe, |
| @@ -57209,15 +57221,19 @@ | |
| 57221 | ** be a problem. |
| 57222 | */ |
| 57223 | SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe *p){ |
| 57224 | int i; |
| 57225 | yDbMask mask; |
| 57226 | sqlite3 *db; |
| 57227 | Db *aDb; |
| 57228 | int nDb; |
| 57229 | if( p->lockMask==0 ) return; /* The common case */ |
| 57230 | db = p->db; |
| 57231 | aDb = db->aDb; |
| 57232 | nDb = db->nDb; |
| 57233 | for(i=0, mask=1; i<nDb; i++, mask += mask){ |
| 57234 | if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ |
| 57235 | sqlite3BtreeEnter(aDb[i].pBt); |
| 57236 | } |
| 57237 | } |
| 57238 | } |
| 57239 | #endif |
| @@ -57227,16 +57243,19 @@ | |
| 57243 | ** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). |
| 57244 | */ |
| 57245 | SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){ |
| 57246 | int i; |
| 57247 | yDbMask mask; |
| 57248 | sqlite3 *db; |
| 57249 | Db *aDb; |
| 57250 | int nDb; |
| 57251 | if( p->lockMask==0 ) return; /* The common case */ |
| 57252 | db = p->db; |
| 57253 | aDb = db->aDb; |
| 57254 | nDb = db->nDb; |
| 57255 | for(i=0, mask=1; i<nDb; i++, mask += mask){ |
| 57256 | if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){ |
| 57257 | sqlite3BtreeLeave(aDb[i].pBt); |
| 57258 | } |
| 57259 | } |
| 57260 | } |
| 57261 | #endif |
| @@ -60834,11 +60853,11 @@ | |
| 60853 | if( db->vdbeExecCnt>1 ){ |
| 60854 | while( *zRawSql ){ |
| 60855 | const char *zStart = zRawSql; |
| 60856 | while( *(zRawSql++)!='\n' && *zRawSql ); |
| 60857 | sqlite3StrAccumAppend(&out, "-- ", 3); |
| 60858 | sqlite3StrAccumAppend(&out, zStart, (int)(zRawSql-zStart)); |
| 60859 | } |
| 60860 | }else{ |
| 60861 | while( zRawSql[0] ){ |
| 60862 | n = findNextHostParameter(zRawSql, &nToken); |
| 60863 | assert( n>0 ); |
| @@ -66139,12 +66158,10 @@ | |
| 66158 | #ifdef SQLITE_DEBUG |
| 66159 | for(u.bu.iDb=0; u.bu.iDb<db->nDb; u.bu.iDb++){ |
| 66160 | assert( u.bu.iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[u.bu.iDb].pBt) ); |
| 66161 | } |
| 66162 | #endif |
| 66163 | |
| 66164 | u.bu.iDb = pOp->p1; |
| 66165 | assert( u.bu.iDb>=0 && u.bu.iDb<db->nDb ); |
| 66166 | assert( DbHasProperty(db, u.bu.iDb, DB_SchemaLoaded) ); |
| 66167 | /* Used to be a conditional */ { |
| @@ -86021,10 +86038,15 @@ | |
| 86038 | |
| 86039 | #ifdef SQLITE_OMIT_COMPLETE |
| 86040 | # define sqlite3_complete 0 |
| 86041 | # define sqlite3_complete16 0 |
| 86042 | #endif |
| 86043 | |
| 86044 | #ifdef SQLITE_OMIT_DECLTYPE |
| 86045 | # define sqlite3_column_decltype16 0 |
| 86046 | # define sqlite3_column_decltype 0 |
| 86047 | #endif |
| 86048 | |
| 86049 | #ifdef SQLITE_OMIT_PROGRESS_CALLBACK |
| 86050 | # define sqlite3_progress_handler 0 |
| 86051 | #endif |
| 86052 | |
| @@ -89790,10 +89812,26 @@ | |
| 89812 | char *zMsg = sqlite3MPrintf(pParse->db, "USE TEMP B-TREE FOR %s", zUsage); |
| 89813 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 89814 | } |
| 89815 | } |
| 89816 | |
| 89817 | /* |
| 89818 | ** Assign expression b to lvalue a. A second, no-op, version of this macro |
| 89819 | ** is provided when SQLITE_OMIT_EXPLAIN is defined. This allows the code |
| 89820 | ** in sqlite3Select() to assign values to structure member variables that |
| 89821 | ** only exist if SQLITE_OMIT_EXPLAIN is not defined without polluting the |
| 89822 | ** code with #ifndef directives. |
| 89823 | */ |
| 89824 | # define explainSetInteger(a, b) a = b |
| 89825 | |
| 89826 | #else |
| 89827 | /* No-op versions of the explainXXX() functions and macros. */ |
| 89828 | # define explainTempTable(y,z) |
| 89829 | # define explainSetInteger(y,z) |
| 89830 | #endif |
| 89831 | |
| 89832 | #if !defined(SQLITE_OMIT_EXPLAIN) && !defined(SQLITE_OMIT_COMPOUND_SELECT) |
| 89833 | /* |
| 89834 | ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function |
| 89835 | ** is a no-op. Otherwise, it adds a single row of output to the EQP result, |
| 89836 | ** where the caption is of one of the two forms: |
| 89837 | ** |
| @@ -89821,25 +89859,13 @@ | |
| 89859 | bUseTmp?"USING TEMP B-TREE ":"", selectOpName(op) |
| 89860 | ); |
| 89861 | sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC); |
| 89862 | } |
| 89863 | } |
| 89864 | #else |
| 89865 | /* No-op versions of the explainXXX() functions and macros. */ |
| 89866 | # define explainComposite(v,w,x,y,z) |
| 89867 | #endif |
| 89868 | |
| 89869 | /* |
| 89870 | ** If the inner loop was generated using a non-null pOrderBy argument, |
| 89871 | ** then the results were placed in a sorter. After the loop is terminated |
| @@ -106809,11 +106835,11 @@ | |
| 106835 | va_list ap; |
| 106836 | int rc; |
| 106837 | va_start(ap, op); |
| 106838 | switch( op ){ |
| 106839 | case SQLITE_DBCONFIG_LOOKASIDE: { |
| 106840 | void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */ |
| 106841 | int sz = va_arg(ap, int); /* IMP: R-47871-25994 */ |
| 106842 | int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */ |
| 106843 | rc = setupLookaside(db, pBuf, sz, cnt); |
| 106844 | break; |
| 106845 | } |
| 106846 |
+14
-14
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.7.6" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3007006 |
| 112 | -#define SQLITE_SOURCE_ID "2011-04-05 22:08:24 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81" | |
| 112 | +#define SQLITE_SOURCE_ID "2011-04-07 15:24:08 bf78acb9dfacde0f08a5b3ceac13480f12a06168" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| @@ -730,11 +730,11 @@ | ||
| 730 | 730 | ** when the database connection has [PRAGMA synchronous] set to OFF.)^ |
| 731 | 731 | ** Some specialized VFSes need this signal in order to operate correctly |
| 732 | 732 | ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most |
| 733 | 733 | ** VFSes do not need this signal and should silently ignore this opcode. |
| 734 | 734 | ** Applications should not call [sqlite3_file_control()] with this |
| 735 | -** opcode as doing so may disrupt the operation of the specilized VFSes | |
| 735 | +** opcode as doing so may disrupt the operation of the specialized VFSes | |
| 736 | 736 | ** that do require it. |
| 737 | 737 | */ |
| 738 | 738 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 739 | 739 | #define SQLITE_GET_LOCKPROXYFILE 2 |
| 740 | 740 | #define SQLITE_SET_LOCKPROXYFILE 3 |
| @@ -1312,11 +1312,11 @@ | ||
| 1312 | 1312 | ** </dd> |
| 1313 | 1313 | ** |
| 1314 | 1314 | ** <dt>SQLITE_CONFIG_SCRATCH</dt> |
| 1315 | 1315 | ** <dd> ^This option specifies a static memory buffer that SQLite can use for |
| 1316 | 1316 | ** scratch memory. There are three arguments: A pointer an 8-byte |
| 1317 | -** aligned memory buffer from which the scrach allocations will be | |
| 1317 | +** aligned memory buffer from which the scratch allocations will be | |
| 1318 | 1318 | ** drawn, the size of each scratch allocation (sz), |
| 1319 | 1319 | ** and the maximum number of scratch allocations (N). The sz |
| 1320 | 1320 | ** argument must be a multiple of 16. |
| 1321 | 1321 | ** The first argument must be a pointer to an 8-byte aligned buffer |
| 1322 | 1322 | ** of at least sz*N bytes of memory. |
| @@ -1464,11 +1464,11 @@ | ||
| 1464 | 1464 | ** <dl> |
| 1465 | 1465 | ** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> |
| 1466 | 1466 | ** <dd> ^This option takes three additional arguments that determine the |
| 1467 | 1467 | ** [lookaside memory allocator] configuration for the [database connection]. |
| 1468 | 1468 | ** ^The first argument (the third parameter to [sqlite3_db_config()] is a |
| 1469 | -** pointer to an memory buffer to use for lookaside memory. | |
| 1469 | +** pointer to a memory buffer to use for lookaside memory. | |
| 1470 | 1470 | ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb |
| 1471 | 1471 | ** may be NULL in which case SQLite will allocate the |
| 1472 | 1472 | ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the |
| 1473 | 1473 | ** size of each lookaside buffer slot. ^The third argument is the number of |
| 1474 | 1474 | ** slots. The size of the buffer in the first argument must be greater than |
| @@ -1496,11 +1496,11 @@ | ||
| 1496 | 1496 | ** |
| 1497 | 1497 | ** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt> |
| 1498 | 1498 | ** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers]. |
| 1499 | 1499 | ** There should be two additional arguments. |
| 1500 | 1500 | ** The first argument is an integer which is 0 to disable triggers, |
| 1501 | -** positive to enable trigers or negative to leave the setting unchanged. | |
| 1501 | +** positive to enable triggers or negative to leave the setting unchanged. | |
| 1502 | 1502 | ** The second parameter is a pointer to an integer into which |
| 1503 | 1503 | ** is written 0 or 1 to indicate whether triggers are disabled or enabled |
| 1504 | 1504 | ** following this call. The second parameter may be a NULL pointer, in |
| 1505 | 1505 | ** which case the trigger setting is not reported back. </dd> |
| 1506 | 1506 | ** |
| @@ -2108,11 +2108,11 @@ | ||
| 2108 | 2108 | SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2109 | 2109 | |
| 2110 | 2110 | /* |
| 2111 | 2111 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2112 | 2112 | ** |
| 2113 | -** ^This routine registers a authorizer callback with a particular | |
| 2113 | +** ^This routine registers an authorizer callback with a particular | |
| 2114 | 2114 | ** [database connection], supplied in the first argument. |
| 2115 | 2115 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 2116 | 2116 | ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], |
| 2117 | 2117 | ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various |
| 2118 | 2118 | ** points during the compilation process, as logic is being created |
| @@ -2754,11 +2754,11 @@ | ||
| 2754 | 2754 | ** will accept either a protected or an unprotected sqlite3_value. |
| 2755 | 2755 | ** Every interface that accepts sqlite3_value arguments specifies |
| 2756 | 2756 | ** whether or not it requires a protected sqlite3_value. |
| 2757 | 2757 | ** |
| 2758 | 2758 | ** The terms "protected" and "unprotected" refer to whether or not |
| 2759 | -** a mutex is held. A internal mutex is held for a protected | |
| 2759 | +** a mutex is held. An internal mutex is held for a protected | |
| 2760 | 2760 | ** sqlite3_value object but no mutex is held for an unprotected |
| 2761 | 2761 | ** sqlite3_value object. If SQLite is compiled to be single-threaded |
| 2762 | 2762 | ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) |
| 2763 | 2763 | ** or if SQLite is run in one of reduced mutex modes |
| 2764 | 2764 | ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] |
| @@ -3440,11 +3440,11 @@ | ||
| 3440 | 3440 | ** |
| 3441 | 3441 | ** ^These functions (collectively known as "function creation routines") |
| 3442 | 3442 | ** are used to add SQL functions or aggregates or to redefine the behavior |
| 3443 | 3443 | ** of existing SQL functions or aggregates. The only differences between |
| 3444 | 3444 | ** these routines are the text encoding expected for |
| 3445 | -** the the second parameter (the name of the function being created) | |
| 3445 | +** the second parameter (the name of the function being created) | |
| 3446 | 3446 | ** and the presence or absence of a destructor callback for |
| 3447 | 3447 | ** the application data pointer. |
| 3448 | 3448 | ** |
| 3449 | 3449 | ** ^The first parameter is the [database connection] to which the SQL |
| 3450 | 3450 | ** function is to be added. ^If an application uses more than one database |
| @@ -3485,11 +3485,11 @@ | ||
| 3485 | 3485 | ** pointers to C-language functions that implement the SQL function or |
| 3486 | 3486 | ** aggregate. ^A scalar SQL function requires an implementation of the xFunc |
| 3487 | 3487 | ** callback only; NULL pointers must be passed as the xStep and xFinal |
| 3488 | 3488 | ** parameters. ^An aggregate SQL function requires an implementation of xStep |
| 3489 | 3489 | ** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing |
| 3490 | -** SQL function or aggregate, pass NULL poiners for all three function | |
| 3490 | +** SQL function or aggregate, pass NULL pointers for all three function | |
| 3491 | 3491 | ** callbacks. |
| 3492 | 3492 | ** |
| 3493 | 3493 | ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, |
| 3494 | 3494 | ** then it is destructor for the application data pointer. |
| 3495 | 3495 | ** The destructor is invoked when the function is deleted, either by being |
| @@ -3919,11 +3919,11 @@ | ||
| 3919 | 3919 | ** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep |
| 3920 | 3920 | ** force strings to be UTF16 with native byte order. |
| 3921 | 3921 | ** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin |
| 3922 | 3922 | ** on an even byte address. |
| 3923 | 3923 | ** |
| 3924 | -** ^The fourth argument, pArg, is a application data pointer that is passed | |
| 3924 | +** ^The fourth argument, pArg, is an application data pointer that is passed | |
| 3925 | 3925 | ** through as the first argument to the collating function callback. |
| 3926 | 3926 | ** |
| 3927 | 3927 | ** ^The fifth argument, xCallback, is a pointer to the collating function. |
| 3928 | 3928 | ** ^Multiple collating functions can be registered using the same name but |
| 3929 | 3929 | ** with different eTextRep parameters and SQLite will use whichever |
| @@ -3935,11 +3935,11 @@ | ||
| 3935 | 3935 | ** ^The collating function callback is invoked with a copy of the pArg |
| 3936 | 3936 | ** application data pointer and with two strings in the encoding specified |
| 3937 | 3937 | ** by the eTextRep argument. The collating function must return an |
| 3938 | 3938 | ** integer that is negative, zero, or positive |
| 3939 | 3939 | ** if the first string is less than, equal to, or greater than the second, |
| 3940 | -** respectively. A collating function must alway return the same answer | |
| 3940 | +** respectively. A collating function must always return the same answer | |
| 3941 | 3941 | ** given the same inputs. If two or more collating functions are registered |
| 3942 | 3942 | ** to the same collation name (using different eTextRep values) then all |
| 3943 | 3943 | ** must give an equivalent answer when invoked with equivalent strings. |
| 3944 | 3944 | ** The collating function must obey the following properties for all |
| 3945 | 3945 | ** strings A, B, and C: |
| @@ -4347,11 +4347,11 @@ | ||
| 4347 | 4347 | ** <ul> |
| 4348 | 4348 | ** <li> The soft heap limit is set to zero. |
| 4349 | 4349 | ** <li> Memory accounting is disabled using a combination of the |
| 4350 | 4350 | ** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and |
| 4351 | 4351 | ** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. |
| 4352 | -** <li> An alternative page cache implementation is specifed using | |
| 4352 | +** <li> An alternative page cache implementation is specified using | |
| 4353 | 4353 | ** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). |
| 4354 | 4354 | ** <li> The page cache allocates from its own memory pool supplied |
| 4355 | 4355 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 4356 | 4356 | ** from the heap. |
| 4357 | 4357 | ** </ul>)^ |
| @@ -4568,11 +4568,11 @@ | ||
| 4568 | 4568 | |
| 4569 | 4569 | /* |
| 4570 | 4570 | ** CAPI3REF: Virtual Table Object |
| 4571 | 4571 | ** KEYWORDS: sqlite3_module {virtual table module} |
| 4572 | 4572 | ** |
| 4573 | -** This structure, sometimes called a a "virtual table module", | |
| 4573 | +** This structure, sometimes called a "virtual table module", | |
| 4574 | 4574 | ** defines the implementation of a [virtual tables]. |
| 4575 | 4575 | ** This structure consists mostly of methods for the module. |
| 4576 | 4576 | ** |
| 4577 | 4577 | ** ^A virtual table module is created by filling in a persistent |
| 4578 | 4578 | ** instance of this structure and passing a pointer to that instance |
| @@ -4880,11 +4880,11 @@ | ||
| 4880 | 4880 | ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects |
| 4881 | 4881 | ** then the BLOB handle is marked as "expired". |
| 4882 | 4882 | ** This is true if any column of the row is changed, even a column |
| 4883 | 4883 | ** other than the one the BLOB handle is open on.)^ |
| 4884 | 4884 | ** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for |
| 4885 | -** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. | |
| 4885 | +** an expired BLOB handle fail with a return code of [SQLITE_ABORT]. | |
| 4886 | 4886 | ** ^(Changes written into a BLOB prior to the BLOB expiring are not |
| 4887 | 4887 | ** rolled back by the expiration of the BLOB. Such changes will eventually |
| 4888 | 4888 | ** commit if the transaction continues to completion.)^ |
| 4889 | 4889 | ** |
| 4890 | 4890 | ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of |
| 4891 | 4891 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.7.6" |
| 111 | #define SQLITE_VERSION_NUMBER 3007006 |
| 112 | #define SQLITE_SOURCE_ID "2011-04-05 22:08:24 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -730,11 +730,11 @@ | |
| 730 | ** when the database connection has [PRAGMA synchronous] set to OFF.)^ |
| 731 | ** Some specialized VFSes need this signal in order to operate correctly |
| 732 | ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most |
| 733 | ** VFSes do not need this signal and should silently ignore this opcode. |
| 734 | ** Applications should not call [sqlite3_file_control()] with this |
| 735 | ** opcode as doing so may disrupt the operation of the specilized VFSes |
| 736 | ** that do require it. |
| 737 | */ |
| 738 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 739 | #define SQLITE_GET_LOCKPROXYFILE 2 |
| 740 | #define SQLITE_SET_LOCKPROXYFILE 3 |
| @@ -1312,11 +1312,11 @@ | |
| 1312 | ** </dd> |
| 1313 | ** |
| 1314 | ** <dt>SQLITE_CONFIG_SCRATCH</dt> |
| 1315 | ** <dd> ^This option specifies a static memory buffer that SQLite can use for |
| 1316 | ** scratch memory. There are three arguments: A pointer an 8-byte |
| 1317 | ** aligned memory buffer from which the scrach allocations will be |
| 1318 | ** drawn, the size of each scratch allocation (sz), |
| 1319 | ** and the maximum number of scratch allocations (N). The sz |
| 1320 | ** argument must be a multiple of 16. |
| 1321 | ** The first argument must be a pointer to an 8-byte aligned buffer |
| 1322 | ** of at least sz*N bytes of memory. |
| @@ -1464,11 +1464,11 @@ | |
| 1464 | ** <dl> |
| 1465 | ** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> |
| 1466 | ** <dd> ^This option takes three additional arguments that determine the |
| 1467 | ** [lookaside memory allocator] configuration for the [database connection]. |
| 1468 | ** ^The first argument (the third parameter to [sqlite3_db_config()] is a |
| 1469 | ** pointer to an memory buffer to use for lookaside memory. |
| 1470 | ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb |
| 1471 | ** may be NULL in which case SQLite will allocate the |
| 1472 | ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the |
| 1473 | ** size of each lookaside buffer slot. ^The third argument is the number of |
| 1474 | ** slots. The size of the buffer in the first argument must be greater than |
| @@ -1496,11 +1496,11 @@ | |
| 1496 | ** |
| 1497 | ** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt> |
| 1498 | ** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers]. |
| 1499 | ** There should be two additional arguments. |
| 1500 | ** The first argument is an integer which is 0 to disable triggers, |
| 1501 | ** positive to enable trigers or negative to leave the setting unchanged. |
| 1502 | ** The second parameter is a pointer to an integer into which |
| 1503 | ** is written 0 or 1 to indicate whether triggers are disabled or enabled |
| 1504 | ** following this call. The second parameter may be a NULL pointer, in |
| 1505 | ** which case the trigger setting is not reported back. </dd> |
| 1506 | ** |
| @@ -2108,11 +2108,11 @@ | |
| 2108 | SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2109 | |
| 2110 | /* |
| 2111 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2112 | ** |
| 2113 | ** ^This routine registers a authorizer callback with a particular |
| 2114 | ** [database connection], supplied in the first argument. |
| 2115 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 2116 | ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], |
| 2117 | ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various |
| 2118 | ** points during the compilation process, as logic is being created |
| @@ -2754,11 +2754,11 @@ | |
| 2754 | ** will accept either a protected or an unprotected sqlite3_value. |
| 2755 | ** Every interface that accepts sqlite3_value arguments specifies |
| 2756 | ** whether or not it requires a protected sqlite3_value. |
| 2757 | ** |
| 2758 | ** The terms "protected" and "unprotected" refer to whether or not |
| 2759 | ** a mutex is held. A internal mutex is held for a protected |
| 2760 | ** sqlite3_value object but no mutex is held for an unprotected |
| 2761 | ** sqlite3_value object. If SQLite is compiled to be single-threaded |
| 2762 | ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) |
| 2763 | ** or if SQLite is run in one of reduced mutex modes |
| 2764 | ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] |
| @@ -3440,11 +3440,11 @@ | |
| 3440 | ** |
| 3441 | ** ^These functions (collectively known as "function creation routines") |
| 3442 | ** are used to add SQL functions or aggregates or to redefine the behavior |
| 3443 | ** of existing SQL functions or aggregates. The only differences between |
| 3444 | ** these routines are the text encoding expected for |
| 3445 | ** the the second parameter (the name of the function being created) |
| 3446 | ** and the presence or absence of a destructor callback for |
| 3447 | ** the application data pointer. |
| 3448 | ** |
| 3449 | ** ^The first parameter is the [database connection] to which the SQL |
| 3450 | ** function is to be added. ^If an application uses more than one database |
| @@ -3485,11 +3485,11 @@ | |
| 3485 | ** pointers to C-language functions that implement the SQL function or |
| 3486 | ** aggregate. ^A scalar SQL function requires an implementation of the xFunc |
| 3487 | ** callback only; NULL pointers must be passed as the xStep and xFinal |
| 3488 | ** parameters. ^An aggregate SQL function requires an implementation of xStep |
| 3489 | ** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing |
| 3490 | ** SQL function or aggregate, pass NULL poiners for all three function |
| 3491 | ** callbacks. |
| 3492 | ** |
| 3493 | ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, |
| 3494 | ** then it is destructor for the application data pointer. |
| 3495 | ** The destructor is invoked when the function is deleted, either by being |
| @@ -3919,11 +3919,11 @@ | |
| 3919 | ** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep |
| 3920 | ** force strings to be UTF16 with native byte order. |
| 3921 | ** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin |
| 3922 | ** on an even byte address. |
| 3923 | ** |
| 3924 | ** ^The fourth argument, pArg, is a application data pointer that is passed |
| 3925 | ** through as the first argument to the collating function callback. |
| 3926 | ** |
| 3927 | ** ^The fifth argument, xCallback, is a pointer to the collating function. |
| 3928 | ** ^Multiple collating functions can be registered using the same name but |
| 3929 | ** with different eTextRep parameters and SQLite will use whichever |
| @@ -3935,11 +3935,11 @@ | |
| 3935 | ** ^The collating function callback is invoked with a copy of the pArg |
| 3936 | ** application data pointer and with two strings in the encoding specified |
| 3937 | ** by the eTextRep argument. The collating function must return an |
| 3938 | ** integer that is negative, zero, or positive |
| 3939 | ** if the first string is less than, equal to, or greater than the second, |
| 3940 | ** respectively. A collating function must alway return the same answer |
| 3941 | ** given the same inputs. If two or more collating functions are registered |
| 3942 | ** to the same collation name (using different eTextRep values) then all |
| 3943 | ** must give an equivalent answer when invoked with equivalent strings. |
| 3944 | ** The collating function must obey the following properties for all |
| 3945 | ** strings A, B, and C: |
| @@ -4347,11 +4347,11 @@ | |
| 4347 | ** <ul> |
| 4348 | ** <li> The soft heap limit is set to zero. |
| 4349 | ** <li> Memory accounting is disabled using a combination of the |
| 4350 | ** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and |
| 4351 | ** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. |
| 4352 | ** <li> An alternative page cache implementation is specifed using |
| 4353 | ** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). |
| 4354 | ** <li> The page cache allocates from its own memory pool supplied |
| 4355 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 4356 | ** from the heap. |
| 4357 | ** </ul>)^ |
| @@ -4568,11 +4568,11 @@ | |
| 4568 | |
| 4569 | /* |
| 4570 | ** CAPI3REF: Virtual Table Object |
| 4571 | ** KEYWORDS: sqlite3_module {virtual table module} |
| 4572 | ** |
| 4573 | ** This structure, sometimes called a a "virtual table module", |
| 4574 | ** defines the implementation of a [virtual tables]. |
| 4575 | ** This structure consists mostly of methods for the module. |
| 4576 | ** |
| 4577 | ** ^A virtual table module is created by filling in a persistent |
| 4578 | ** instance of this structure and passing a pointer to that instance |
| @@ -4880,11 +4880,11 @@ | |
| 4880 | ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects |
| 4881 | ** then the BLOB handle is marked as "expired". |
| 4882 | ** This is true if any column of the row is changed, even a column |
| 4883 | ** other than the one the BLOB handle is open on.)^ |
| 4884 | ** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for |
| 4885 | ** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. |
| 4886 | ** ^(Changes written into a BLOB prior to the BLOB expiring are not |
| 4887 | ** rolled back by the expiration of the BLOB. Such changes will eventually |
| 4888 | ** commit if the transaction continues to completion.)^ |
| 4889 | ** |
| 4890 | ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of |
| 4891 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.7.6" |
| 111 | #define SQLITE_VERSION_NUMBER 3007006 |
| 112 | #define SQLITE_SOURCE_ID "2011-04-07 15:24:08 bf78acb9dfacde0f08a5b3ceac13480f12a06168" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -730,11 +730,11 @@ | |
| 730 | ** when the database connection has [PRAGMA synchronous] set to OFF.)^ |
| 731 | ** Some specialized VFSes need this signal in order to operate correctly |
| 732 | ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most |
| 733 | ** VFSes do not need this signal and should silently ignore this opcode. |
| 734 | ** Applications should not call [sqlite3_file_control()] with this |
| 735 | ** opcode as doing so may disrupt the operation of the specialized VFSes |
| 736 | ** that do require it. |
| 737 | */ |
| 738 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 739 | #define SQLITE_GET_LOCKPROXYFILE 2 |
| 740 | #define SQLITE_SET_LOCKPROXYFILE 3 |
| @@ -1312,11 +1312,11 @@ | |
| 1312 | ** </dd> |
| 1313 | ** |
| 1314 | ** <dt>SQLITE_CONFIG_SCRATCH</dt> |
| 1315 | ** <dd> ^This option specifies a static memory buffer that SQLite can use for |
| 1316 | ** scratch memory. There are three arguments: A pointer an 8-byte |
| 1317 | ** aligned memory buffer from which the scratch allocations will be |
| 1318 | ** drawn, the size of each scratch allocation (sz), |
| 1319 | ** and the maximum number of scratch allocations (N). The sz |
| 1320 | ** argument must be a multiple of 16. |
| 1321 | ** The first argument must be a pointer to an 8-byte aligned buffer |
| 1322 | ** of at least sz*N bytes of memory. |
| @@ -1464,11 +1464,11 @@ | |
| 1464 | ** <dl> |
| 1465 | ** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> |
| 1466 | ** <dd> ^This option takes three additional arguments that determine the |
| 1467 | ** [lookaside memory allocator] configuration for the [database connection]. |
| 1468 | ** ^The first argument (the third parameter to [sqlite3_db_config()] is a |
| 1469 | ** pointer to a memory buffer to use for lookaside memory. |
| 1470 | ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb |
| 1471 | ** may be NULL in which case SQLite will allocate the |
| 1472 | ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the |
| 1473 | ** size of each lookaside buffer slot. ^The third argument is the number of |
| 1474 | ** slots. The size of the buffer in the first argument must be greater than |
| @@ -1496,11 +1496,11 @@ | |
| 1496 | ** |
| 1497 | ** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt> |
| 1498 | ** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers]. |
| 1499 | ** There should be two additional arguments. |
| 1500 | ** The first argument is an integer which is 0 to disable triggers, |
| 1501 | ** positive to enable triggers or negative to leave the setting unchanged. |
| 1502 | ** The second parameter is a pointer to an integer into which |
| 1503 | ** is written 0 or 1 to indicate whether triggers are disabled or enabled |
| 1504 | ** following this call. The second parameter may be a NULL pointer, in |
| 1505 | ** which case the trigger setting is not reported back. </dd> |
| 1506 | ** |
| @@ -2108,11 +2108,11 @@ | |
| 2108 | SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2109 | |
| 2110 | /* |
| 2111 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2112 | ** |
| 2113 | ** ^This routine registers an authorizer callback with a particular |
| 2114 | ** [database connection], supplied in the first argument. |
| 2115 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 2116 | ** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], |
| 2117 | ** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various |
| 2118 | ** points during the compilation process, as logic is being created |
| @@ -2754,11 +2754,11 @@ | |
| 2754 | ** will accept either a protected or an unprotected sqlite3_value. |
| 2755 | ** Every interface that accepts sqlite3_value arguments specifies |
| 2756 | ** whether or not it requires a protected sqlite3_value. |
| 2757 | ** |
| 2758 | ** The terms "protected" and "unprotected" refer to whether or not |
| 2759 | ** a mutex is held. An internal mutex is held for a protected |
| 2760 | ** sqlite3_value object but no mutex is held for an unprotected |
| 2761 | ** sqlite3_value object. If SQLite is compiled to be single-threaded |
| 2762 | ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) |
| 2763 | ** or if SQLite is run in one of reduced mutex modes |
| 2764 | ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] |
| @@ -3440,11 +3440,11 @@ | |
| 3440 | ** |
| 3441 | ** ^These functions (collectively known as "function creation routines") |
| 3442 | ** are used to add SQL functions or aggregates or to redefine the behavior |
| 3443 | ** of existing SQL functions or aggregates. The only differences between |
| 3444 | ** these routines are the text encoding expected for |
| 3445 | ** the second parameter (the name of the function being created) |
| 3446 | ** and the presence or absence of a destructor callback for |
| 3447 | ** the application data pointer. |
| 3448 | ** |
| 3449 | ** ^The first parameter is the [database connection] to which the SQL |
| 3450 | ** function is to be added. ^If an application uses more than one database |
| @@ -3485,11 +3485,11 @@ | |
| 3485 | ** pointers to C-language functions that implement the SQL function or |
| 3486 | ** aggregate. ^A scalar SQL function requires an implementation of the xFunc |
| 3487 | ** callback only; NULL pointers must be passed as the xStep and xFinal |
| 3488 | ** parameters. ^An aggregate SQL function requires an implementation of xStep |
| 3489 | ** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing |
| 3490 | ** SQL function or aggregate, pass NULL pointers for all three function |
| 3491 | ** callbacks. |
| 3492 | ** |
| 3493 | ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, |
| 3494 | ** then it is destructor for the application data pointer. |
| 3495 | ** The destructor is invoked when the function is deleted, either by being |
| @@ -3919,11 +3919,11 @@ | |
| 3919 | ** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep |
| 3920 | ** force strings to be UTF16 with native byte order. |
| 3921 | ** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin |
| 3922 | ** on an even byte address. |
| 3923 | ** |
| 3924 | ** ^The fourth argument, pArg, is an application data pointer that is passed |
| 3925 | ** through as the first argument to the collating function callback. |
| 3926 | ** |
| 3927 | ** ^The fifth argument, xCallback, is a pointer to the collating function. |
| 3928 | ** ^Multiple collating functions can be registered using the same name but |
| 3929 | ** with different eTextRep parameters and SQLite will use whichever |
| @@ -3935,11 +3935,11 @@ | |
| 3935 | ** ^The collating function callback is invoked with a copy of the pArg |
| 3936 | ** application data pointer and with two strings in the encoding specified |
| 3937 | ** by the eTextRep argument. The collating function must return an |
| 3938 | ** integer that is negative, zero, or positive |
| 3939 | ** if the first string is less than, equal to, or greater than the second, |
| 3940 | ** respectively. A collating function must always return the same answer |
| 3941 | ** given the same inputs. If two or more collating functions are registered |
| 3942 | ** to the same collation name (using different eTextRep values) then all |
| 3943 | ** must give an equivalent answer when invoked with equivalent strings. |
| 3944 | ** The collating function must obey the following properties for all |
| 3945 | ** strings A, B, and C: |
| @@ -4347,11 +4347,11 @@ | |
| 4347 | ** <ul> |
| 4348 | ** <li> The soft heap limit is set to zero. |
| 4349 | ** <li> Memory accounting is disabled using a combination of the |
| 4350 | ** [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and |
| 4351 | ** the [SQLITE_DEFAULT_MEMSTATUS] compile-time option. |
| 4352 | ** <li> An alternative page cache implementation is specified using |
| 4353 | ** [sqlite3_config]([SQLITE_CONFIG_PCACHE],...). |
| 4354 | ** <li> The page cache allocates from its own memory pool supplied |
| 4355 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 4356 | ** from the heap. |
| 4357 | ** </ul>)^ |
| @@ -4568,11 +4568,11 @@ | |
| 4568 | |
| 4569 | /* |
| 4570 | ** CAPI3REF: Virtual Table Object |
| 4571 | ** KEYWORDS: sqlite3_module {virtual table module} |
| 4572 | ** |
| 4573 | ** This structure, sometimes called a "virtual table module", |
| 4574 | ** defines the implementation of a [virtual tables]. |
| 4575 | ** This structure consists mostly of methods for the module. |
| 4576 | ** |
| 4577 | ** ^A virtual table module is created by filling in a persistent |
| 4578 | ** instance of this structure and passing a pointer to that instance |
| @@ -4880,11 +4880,11 @@ | |
| 4880 | ** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects |
| 4881 | ** then the BLOB handle is marked as "expired". |
| 4882 | ** This is true if any column of the row is changed, even a column |
| 4883 | ** other than the one the BLOB handle is open on.)^ |
| 4884 | ** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for |
| 4885 | ** an expired BLOB handle fail with a return code of [SQLITE_ABORT]. |
| 4886 | ** ^(Changes written into a BLOB prior to the BLOB expiring are not |
| 4887 | ** rolled back by the expiration of the BLOB. Such changes will eventually |
| 4888 | ** commit if the transaction continues to completion.)^ |
| 4889 | ** |
| 4890 | ** ^Use the [sqlite3_blob_bytes()] interface to determine the size of |
| 4891 |