| | @@ -1162,11 +1162,11 @@ |
| 1162 | 1162 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1163 | 1163 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1164 | 1164 | */ |
| 1165 | 1165 | #define SQLITE_VERSION "3.32.0" |
| 1166 | 1166 | #define SQLITE_VERSION_NUMBER 3032000 |
| 1167 | | -#define SQLITE_SOURCE_ID "2020-04-18 14:12:00 d5b0def96ba6d90f47bc96fab1ccf9c501d84885d086744035b16fd96f3e248c" |
| 1167 | +#define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0926b" |
| 1168 | 1168 | |
| 1169 | 1169 | /* |
| 1170 | 1170 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1171 | 1171 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1172 | 1172 | ** |
| | @@ -2194,10 +2194,11 @@ |
| 2194 | 2194 | #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33 |
| 2195 | 2195 | #define SQLITE_FCNTL_LOCK_TIMEOUT 34 |
| 2196 | 2196 | #define SQLITE_FCNTL_DATA_VERSION 35 |
| 2197 | 2197 | #define SQLITE_FCNTL_SIZE_LIMIT 36 |
| 2198 | 2198 | #define SQLITE_FCNTL_CKPT_DONE 37 |
| 2199 | +#define SQLITE_FCNTL_RESERVE_BYTES 38 |
| 2199 | 2200 | |
| 2200 | 2201 | /* deprecated names */ |
| 2201 | 2202 | #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE |
| 2202 | 2203 | #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE |
| 2203 | 2204 | #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO |
| | @@ -8689,11 +8690,11 @@ |
| 8689 | 8690 | #define SQLITE_TESTCTRL_FAULT_INSTALL 9 |
| 8690 | 8691 | #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 |
| 8691 | 8692 | #define SQLITE_TESTCTRL_PENDING_BYTE 11 |
| 8692 | 8693 | #define SQLITE_TESTCTRL_ASSERT 12 |
| 8693 | 8694 | #define SQLITE_TESTCTRL_ALWAYS 13 |
| 8694 | | -#define SQLITE_TESTCTRL_RESERVE 14 |
| 8695 | +#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */ |
| 8695 | 8696 | #define SQLITE_TESTCTRL_OPTIMIZATIONS 15 |
| 8696 | 8697 | #define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ |
| 8697 | 8698 | #define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ |
| 8698 | 8699 | #define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17 |
| 8699 | 8700 | #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 |
| | @@ -14759,11 +14760,11 @@ |
| 14759 | 14760 | SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix); |
| 14760 | 14761 | SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree*); |
| 14761 | 14762 | SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int); |
| 14762 | 14763 | SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*); |
| 14763 | 14764 | SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int); |
| 14764 | | -SQLITE_PRIVATE int sqlite3BtreeGetOptimalReserve(Btree*); |
| 14765 | +SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree*); |
| 14765 | 14766 | SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p); |
| 14766 | 14767 | SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int); |
| 14767 | 14768 | SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *); |
| 14768 | 14769 | SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int,int*); |
| 14769 | 14770 | SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster); |
| | @@ -37047,11 +37048,11 @@ |
| 37047 | 37048 | zDirname[ii] = '\0'; |
| 37048 | 37049 | }else{ |
| 37049 | 37050 | if( zDirname[0]!='/' ) zDirname[0] = '.'; |
| 37050 | 37051 | zDirname[1] = 0; |
| 37051 | 37052 | } |
| 37052 | | - fd = robust_open(zDirname, O_RDONLY|O_BINARY|O_NOFOLLOW, 0); |
| 37053 | + fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0); |
| 37053 | 37054 | if( fd>=0 ){ |
| 37054 | 37055 | OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname)); |
| 37055 | 37056 | } |
| 37056 | 37057 | *pFd = fd; |
| 37057 | 37058 | if( fd>=0 ) return SQLITE_OK; |
| | @@ -63461,10 +63462,11 @@ |
| 63461 | 63462 | u8 incrVacuum; /* True if incr-vacuum is enabled */ |
| 63462 | 63463 | u8 bDoTruncate; /* True to truncate db on commit */ |
| 63463 | 63464 | #endif |
| 63464 | 63465 | u8 inTransaction; /* Transaction state */ |
| 63465 | 63466 | u8 max1bytePayload; /* Maximum first byte of cell for a 1-byte payload */ |
| 63467 | + u8 nReserveWanted; /* 1 more than desired number of extra bytes per page */ |
| 63466 | 63468 | u16 btsFlags; /* Boolean parameters. See BTS_* macros below */ |
| 63467 | 63469 | u16 maxLocal; /* Maximum local payload in non-LEAFDATA tables */ |
| 63468 | 63470 | u16 minLocal; /* Minimum local payload in non-LEAFDATA tables */ |
| 63469 | 63471 | u16 maxLeaf; /* Maximum local payload in a LEAFDATA table */ |
| 63470 | 63472 | u16 minLeaf; /* Minimum local payload in a LEAFDATA table */ |
| | @@ -66907,12 +66909,15 @@ |
| 66907 | 66909 | ** and autovacuum mode can no longer be changed. |
| 66908 | 66910 | */ |
| 66909 | 66911 | SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, int iFix){ |
| 66910 | 66912 | int rc = SQLITE_OK; |
| 66911 | 66913 | BtShared *pBt = p->pBt; |
| 66912 | | - assert( nReserve>=-1 && nReserve<=255 ); |
| 66914 | + assert( nReserve>=-1 && nReserve<=254 ); |
| 66913 | 66915 | sqlite3BtreeEnter(p); |
| 66916 | + if( nReserve>=0 ){ |
| 66917 | + pBt->nReserveWanted = nReserve + 1; |
| 66918 | + } |
| 66914 | 66919 | if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){ |
| 66915 | 66920 | sqlite3BtreeLeave(p); |
| 66916 | 66921 | return SQLITE_READONLY; |
| 66917 | 66922 | } |
| 66918 | 66923 | if( nReserve<0 ){ |
| | @@ -66960,19 +66965,16 @@ |
| 66960 | 66965 | |
| 66961 | 66966 | /* |
| 66962 | 66967 | ** Return the number of bytes of space at the end of every page that |
| 66963 | 66968 | ** are intentually left unused. This is the "reserved" space that is |
| 66964 | 66969 | ** sometimes used by extensions. |
| 66965 | | -** |
| 66966 | | -** If SQLITE_HAS_MUTEX is defined then the number returned is the |
| 66967 | | -** greater of the current reserved space and the maximum requested |
| 66968 | | -** reserve space. |
| 66969 | 66970 | */ |
| 66970 | | -SQLITE_PRIVATE int sqlite3BtreeGetOptimalReserve(Btree *p){ |
| 66971 | +SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){ |
| 66971 | 66972 | int n; |
| 66972 | 66973 | sqlite3BtreeEnter(p); |
| 66973 | | - n = sqlite3BtreeGetReserveNoMutex(p); |
| 66974 | + n = ((int)p->pBt->nReserveWanted) - 1; |
| 66975 | + if( n<0 ) n = sqlite3BtreeGetReserveNoMutex(p); |
| 66974 | 66976 | sqlite3BtreeLeave(p); |
| 66975 | 66977 | return n; |
| 66976 | 66978 | } |
| 66977 | 66979 | |
| 66978 | 66980 | |
| | @@ -137706,11 +137708,11 @@ |
| 137706 | 137708 | sqlite3SetString(pzErrMsg, db, "output file already exists"); |
| 137707 | 137709 | goto end_of_vacuum; |
| 137708 | 137710 | } |
| 137709 | 137711 | db->mDbFlags |= DBFLAG_VacuumInto; |
| 137710 | 137712 | } |
| 137711 | | - nRes = sqlite3BtreeGetOptimalReserve(pMain); |
| 137713 | + nRes = sqlite3BtreeGetRequestedReserve(pMain); |
| 137712 | 137714 | |
| 137713 | 137715 | sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size); |
| 137714 | 137716 | sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0)); |
| 137715 | 137717 | sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF|PAGER_CACHESPILL); |
| 137716 | 137718 | |
| | @@ -163070,10 +163072,17 @@ |
| 163070 | 163072 | }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){ |
| 163071 | 163073 | *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager); |
| 163072 | 163074 | rc = SQLITE_OK; |
| 163073 | 163075 | }else if( op==SQLITE_FCNTL_DATA_VERSION ){ |
| 163074 | 163076 | *(unsigned int*)pArg = sqlite3PagerDataVersion(pPager); |
| 163077 | + rc = SQLITE_OK; |
| 163078 | + }else if( op==SQLITE_FCNTL_RESERVE_BYTES ){ |
| 163079 | + int iNew = *(int*)pArg; |
| 163080 | + *(int*)pArg = sqlite3BtreeGetRequestedReserve(pBtree); |
| 163081 | + if( iNew>=0 && iNew<=254 ){ |
| 163082 | + sqlite3BtreeSetPageSize(pBtree, 0, iNew, 0); |
| 163083 | + } |
| 163075 | 163084 | rc = SQLITE_OK; |
| 163076 | 163085 | }else{ |
| 163077 | 163086 | rc = sqlite3OsFileControl(fd, op, pArg); |
| 163078 | 163087 | } |
| 163079 | 163088 | sqlite3BtreeLeave(pBtree); |
| | @@ -163287,24 +163296,10 @@ |
| 163287 | 163296 | case SQLITE_TESTCTRL_BYTEORDER: { |
| 163288 | 163297 | rc = SQLITE_BYTEORDER*100 + SQLITE_LITTLEENDIAN*10 + SQLITE_BIGENDIAN; |
| 163289 | 163298 | break; |
| 163290 | 163299 | } |
| 163291 | 163300 | |
| 163292 | | - /* sqlite3_test_control(SQLITE_TESTCTRL_RESERVE, sqlite3 *db, int N) |
| 163293 | | - ** |
| 163294 | | - ** Set the nReserve size to N for the main database on the database |
| 163295 | | - ** connection db. |
| 163296 | | - */ |
| 163297 | | - case SQLITE_TESTCTRL_RESERVE: { |
| 163298 | | - sqlite3 *db = va_arg(ap, sqlite3*); |
| 163299 | | - int x = va_arg(ap,int); |
| 163300 | | - sqlite3_mutex_enter(db->mutex); |
| 163301 | | - sqlite3BtreeSetPageSize(db->aDb[0].pBt, 0, x, 0); |
| 163302 | | - sqlite3_mutex_leave(db->mutex); |
| 163303 | | - break; |
| 163304 | | - } |
| 163305 | | - |
| 163306 | 163301 | /* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N) |
| 163307 | 163302 | ** |
| 163308 | 163303 | ** Enable or disable various optimizations for testing purposes. The |
| 163309 | 163304 | ** argument N is a bitmask of optimizations to be disabled. For normal |
| 163310 | 163305 | ** operation N should be 0. The idea is that a test program (like the |
| | @@ -223906,11 +223901,11 @@ |
| 223906 | 223901 | int nArg, /* Number of args */ |
| 223907 | 223902 | sqlite3_value **apUnused /* Function arguments */ |
| 223908 | 223903 | ){ |
| 223909 | 223904 | assert( nArg==0 ); |
| 223910 | 223905 | UNUSED_PARAM2(nArg, apUnused); |
| 223911 | | - sqlite3_result_text(pCtx, "fts5: 2020-04-18 14:12:00 d5b0def96ba6d90f47bc96fab1ccf9c501d84885d086744035b16fd96f3e248c", -1, SQLITE_TRANSIENT); |
| 223906 | + sqlite3_result_text(pCtx, "fts5: 2020-03-03 20:04:29 bd94d7d052734460904c687756231f8aa243a2252f07f742dd1e437aa940f536", -1, SQLITE_TRANSIENT); |
| 223912 | 223907 | } |
| 223913 | 223908 | |
| 223914 | 223909 | /* |
| 223915 | 223910 | ** Return true if zName is the extension on one of the shadow tables used |
| 223916 | 223911 | ** by this module. |
| | @@ -228688,12 +228683,12 @@ |
| 228688 | 228683 | } |
| 228689 | 228684 | #endif /* SQLITE_CORE */ |
| 228690 | 228685 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 228691 | 228686 | |
| 228692 | 228687 | /************** End of stmt.c ************************************************/ |
| 228693 | | -#if __LINE__!=228693 |
| 228688 | +#if __LINE__!=228688 |
| 228694 | 228689 | #undef SQLITE_SOURCE_ID |
| 228695 | | -#define SQLITE_SOURCE_ID "2020-04-18 14:12:00 d5b0def96ba6d90f47bc96fab1ccf9c501d84885d086744035b16fd96f3ealt2" |
| 228690 | +#define SQLITE_SOURCE_ID "2020-04-20 17:35:32 2fc80ef16ce5878311ab88a0c64631813572ffbb71f75363b4619c9667e0alt2" |
| 228696 | 228691 | #endif |
| 228697 | 228692 | /* Return the source-id for this library */ |
| 228698 | 228693 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 228699 | 228694 | /************************** End of sqlite3.c ******************************/ |
| 228700 | 228695 | |