Fossil SCM
Update the built-in SQLite to the 3.7.14 release.
Commit
2b56641fb941a72aa8bc62dfdf1744a798046af2
Parent
6e7c94b31d47adc…
2 files changed
+59
-24
+23
-2
+59
-24
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -673,11 +673,11 @@ | ||
| 673 | 673 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 674 | 674 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 675 | 675 | */ |
| 676 | 676 | #define SQLITE_VERSION "3.7.14" |
| 677 | 677 | #define SQLITE_VERSION_NUMBER 3007014 |
| 678 | -#define SQLITE_SOURCE_ID "2012-08-24 23:56:19 62678be3df35cdcb09172ba8c860f7b73517f1ea" | |
| 678 | +#define SQLITE_SOURCE_ID "2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a" | |
| 679 | 679 | |
| 680 | 680 | /* |
| 681 | 681 | ** CAPI3REF: Run-Time Library Version Numbers |
| 682 | 682 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 683 | 683 | ** |
| @@ -1081,11 +1081,11 @@ | ||
| 1081 | 1081 | |
| 1082 | 1082 | /* |
| 1083 | 1083 | ** CAPI3REF: Device Characteristics |
| 1084 | 1084 | ** |
| 1085 | 1085 | ** The xDeviceCharacteristics method of the [sqlite3_io_methods] |
| 1086 | -** object returns an integer which is a vector of the these | |
| 1086 | +** object returns an integer which is a vector of these | |
| 1087 | 1087 | ** bit values expressing I/O characteristics of the mass storage |
| 1088 | 1088 | ** device that holds the file that the [sqlite3_io_methods] |
| 1089 | 1089 | ** refers to. |
| 1090 | 1090 | ** |
| 1091 | 1091 | ** The SQLITE_IOCAP_ATOMIC property means that all writes of |
| @@ -3231,10 +3231,16 @@ | ||
| 3231 | 3231 | ** <b>Note to Windows users:</b> The encoding used for the filename argument |
| 3232 | 3232 | ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever |
| 3233 | 3233 | ** codepage is currently defined. Filenames containing international |
| 3234 | 3234 | ** characters must be converted to UTF-8 prior to passing them into |
| 3235 | 3235 | ** sqlite3_open() or sqlite3_open_v2(). |
| 3236 | +** | |
| 3237 | +** <b>Note to Windows Runtime users:</b> The temporary directory must be set | |
| 3238 | +** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various | |
| 3239 | +** features that require the use of temporary files may fail. | |
| 3240 | +** | |
| 3241 | +** See also: [sqlite3_temp_directory] | |
| 3236 | 3242 | */ |
| 3237 | 3243 | SQLITE_API int sqlite3_open( |
| 3238 | 3244 | const char *filename, /* Database filename (UTF-8) */ |
| 3239 | 3245 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3240 | 3246 | ); |
| @@ -5035,10 +5041,25 @@ | ||
| 5035 | 5041 | ** [sqlite3_malloc] and the pragma may attempt to free that memory |
| 5036 | 5042 | ** using [sqlite3_free]. |
| 5037 | 5043 | ** Hence, if this variable is modified directly, either it should be |
| 5038 | 5044 | ** made NULL or made to point to memory obtained from [sqlite3_malloc] |
| 5039 | 5045 | ** or else the use of the [temp_store_directory pragma] should be avoided. |
| 5046 | +** | |
| 5047 | +** <b>Note to Windows Runtime users:</b> The temporary directory must be set | |
| 5048 | +** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various | |
| 5049 | +** features that require the use of temporary files may fail. Here is an | |
| 5050 | +** example of how to do this using C++ with the Windows Runtime: | |
| 5051 | +** | |
| 5052 | +** <blockquote><pre> | |
| 5053 | +** LPCWSTR zPath = Windows::Storage::ApplicationData::Current-> | |
| 5054 | +** TemporaryFolder->Path->Data(); | |
| 5055 | +** char zPathBuf[MAX_PATH + 1]; | |
| 5056 | +** memset(zPathBuf, 0, sizeof(zPathBuf)); | |
| 5057 | +** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf), | |
| 5058 | +** NULL, NULL); | |
| 5059 | +** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); | |
| 5060 | +** </pre></blockquote> | |
| 5040 | 5061 | */ |
| 5041 | 5062 | SQLITE_API char *sqlite3_temp_directory; |
| 5042 | 5063 | |
| 5043 | 5064 | /* |
| 5044 | 5065 | ** CAPI3REF: Name Of The Folder Holding Database Files |
| @@ -10893,11 +10914,11 @@ | ||
| 10893 | 10914 | }; |
| 10894 | 10915 | |
| 10895 | 10916 | /* |
| 10896 | 10917 | ** For each nested loop in a WHERE clause implementation, the WhereInfo |
| 10897 | 10918 | ** structure contains a single instance of this structure. This structure |
| 10898 | -** is intended to be private the the where.c module and should not be | |
| 10919 | +** is intended to be private to the where.c module and should not be | |
| 10899 | 10920 | ** access or modified by other modules. |
| 10900 | 10921 | ** |
| 10901 | 10922 | ** The pIdxInfo field is used to help pick the best index on a |
| 10902 | 10923 | ** virtual table. The pIdxInfo pointer contains indexing |
| 10903 | 10924 | ** information for the i-th table in the FROM clause before reordering. |
| @@ -23794,11 +23815,11 @@ | ||
| 23794 | 23815 | ** strerror_r(). |
| 23795 | 23816 | ** |
| 23796 | 23817 | ** The first argument passed to the macro should be the error code that |
| 23797 | 23818 | ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). |
| 23798 | 23819 | ** The two subsequent arguments should be the name of the OS function that |
| 23799 | -** failed (e.g. "unlink", "open") and the the associated file-system path, | |
| 23820 | +** failed (e.g. "unlink", "open") and the associated file-system path, | |
| 23800 | 23821 | ** if any. |
| 23801 | 23822 | */ |
| 23802 | 23823 | #define unixLogError(a,b,c) unixLogErrorAtLine(a,b,c,__LINE__) |
| 23803 | 23824 | static int unixLogErrorAtLine( |
| 23804 | 23825 | int errcode, /* SQLite error code */ |
| @@ -23817,11 +23838,11 @@ | ||
| 23817 | 23838 | char aErr[80]; |
| 23818 | 23839 | memset(aErr, 0, sizeof(aErr)); |
| 23819 | 23840 | zErr = aErr; |
| 23820 | 23841 | |
| 23821 | 23842 | /* If STRERROR_R_CHAR_P (set by autoconf scripts) or __USE_GNU is defined, |
| 23822 | - ** assume that the system provides the the GNU version of strerror_r() that | |
| 23843 | + ** assume that the system provides the GNU version of strerror_r() that | |
| 23823 | 23844 | ** returns a pointer to a buffer containing the error message. That pointer |
| 23824 | 23845 | ** may point to aErr[], or it may point to some static storage somewhere. |
| 23825 | 23846 | ** Otherwise, assume that the system provides the POSIX version of |
| 23826 | 23847 | ** strerror_r(), which always writes an error message into aErr[]. |
| 23827 | 23848 | ** |
| @@ -31306,11 +31327,11 @@ | ||
| 31306 | 31327 | ** FormatMessage. |
| 31307 | 31328 | ** |
| 31308 | 31329 | ** The first argument passed to the macro should be the error code that |
| 31309 | 31330 | ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). |
| 31310 | 31331 | ** The two subsequent arguments should be the name of the OS function that |
| 31311 | -** failed and the the associated file-system path, if any. | |
| 31332 | +** failed and the associated file-system path, if any. | |
| 31312 | 31333 | */ |
| 31313 | 31334 | #define winLogError(a,b,c,d) winLogErrorAtLine(a,b,c,d,__LINE__) |
| 31314 | 31335 | static int winLogErrorAtLine( |
| 31315 | 31336 | int errcode, /* SQLite error code */ |
| 31316 | 31337 | DWORD lastErrno, /* Win32 last error */ |
| @@ -33431,10 +33452,17 @@ | ||
| 33431 | 33452 | || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL |
| 33432 | 33453 | ); |
| 33433 | 33454 | |
| 33434 | 33455 | assert( id!=0 ); |
| 33435 | 33456 | UNUSED_PARAMETER(pVfs); |
| 33457 | + | |
| 33458 | +#if SQLITE_OS_WINRT | |
| 33459 | + if( !sqlite3_temp_directory ){ | |
| 33460 | + sqlite3_log(SQLITE_ERROR, | |
| 33461 | + "sqlite3_temp_directory variable should be set for WinRT"); | |
| 33462 | + } | |
| 33463 | +#endif | |
| 33436 | 33464 | |
| 33437 | 33465 | pFile->h = INVALID_HANDLE_VALUE; |
| 33438 | 33466 | |
| 33439 | 33467 | /* If the second argument to this function is NULL, generate a |
| 33440 | 33468 | ** temporary file name to use |
| @@ -33745,11 +33773,11 @@ | ||
| 33745 | 33773 | }else{ |
| 33746 | 33774 | attr = sAttrData.dwFileAttributes; |
| 33747 | 33775 | } |
| 33748 | 33776 | }else{ |
| 33749 | 33777 | logIoerr(cnt); |
| 33750 | - if( lastErrno!=ERROR_FILE_NOT_FOUND ){ | |
| 33778 | + if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){ | |
| 33751 | 33779 | winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess", zFilename); |
| 33752 | 33780 | sqlite3_free(zConverted); |
| 33753 | 33781 | return SQLITE_IOERR_ACCESS; |
| 33754 | 33782 | }else{ |
| 33755 | 33783 | attr = INVALID_FILE_ATTRIBUTES; |
| @@ -36710,11 +36738,11 @@ | ||
| 36710 | 36738 | return 0; |
| 36711 | 36739 | } |
| 36712 | 36740 | } |
| 36713 | 36741 | |
| 36714 | 36742 | /* |
| 36715 | -** Check to see if element iRowid was inserted into the the rowset as | |
| 36743 | +** Check to see if element iRowid was inserted into the rowset as | |
| 36716 | 36744 | ** part of any insert batch prior to iBatch. Return 1 or 0. |
| 36717 | 36745 | ** |
| 36718 | 36746 | ** If this is the first test of a new batch and if there exist entires |
| 36719 | 36747 | ** on pRowSet->pEntry, then sort those entires into the forest at |
| 36720 | 36748 | ** pRowSet->pForest so that they can be tested. |
| @@ -36994,11 +37022,11 @@ | ||
| 36994 | 37022 | ** (6) If a master journal file is used, then all writes to the database file |
| 36995 | 37023 | ** are synced prior to the master journal being deleted. |
| 36996 | 37024 | ** |
| 36997 | 37025 | ** Definition: Two databases (or the same database at two points it time) |
| 36998 | 37026 | ** are said to be "logically equivalent" if they give the same answer to |
| 36999 | -** all queries. Note in particular the the content of freelist leaf | |
| 37027 | +** all queries. Note in particular the content of freelist leaf | |
| 37000 | 37028 | ** pages can be changed arbitarily without effecting the logical equivalence |
| 37001 | 37029 | ** of the database. |
| 37002 | 37030 | ** |
| 37003 | 37031 | ** (7) At any time, if any subset, including the empty set and the total set, |
| 37004 | 37032 | ** of the unsynced changes to a rollback journal are removed and the |
| @@ -40768,11 +40796,11 @@ | ||
| 40768 | 40796 | ** been written to the journal have actually reached the surface of the |
| 40769 | 40797 | ** disk and can be restored in the event of a hot-journal rollback. |
| 40770 | 40798 | ** |
| 40771 | 40799 | ** If the Pager.noSync flag is set, then this function is a no-op. |
| 40772 | 40800 | ** Otherwise, the actions required depend on the journal-mode and the |
| 40773 | -** device characteristics of the the file-system, as follows: | |
| 40801 | +** device characteristics of the file-system, as follows: | |
| 40774 | 40802 | ** |
| 40775 | 40803 | ** * If the journal file is an in-memory journal file, no action need |
| 40776 | 40804 | ** be taken. |
| 40777 | 40805 | ** |
| 40778 | 40806 | ** * Otherwise, if the device does not support the SAFE_APPEND property, |
| @@ -44007,11 +44035,11 @@ | ||
| 44007 | 44035 | ** |
| 44008 | 44036 | ** The wal-index consists of a header region, followed by an one or |
| 44009 | 44037 | ** more index blocks. |
| 44010 | 44038 | ** |
| 44011 | 44039 | ** The wal-index header contains the total number of frames within the WAL |
| 44012 | -** in the the mxFrame field. | |
| 44040 | +** in the mxFrame field. | |
| 44013 | 44041 | ** |
| 44014 | 44042 | ** Each index block except for the first contains information on |
| 44015 | 44043 | ** HASHTABLE_NPAGE frames. The first index block contains information on |
| 44016 | 44044 | ** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and |
| 44017 | 44045 | ** HASHTABLE_NPAGE are selected so that together the wal-index header and |
| @@ -53980,11 +54008,11 @@ | ||
| 53980 | 54008 | assert( EIGHT_BYTE_ALIGNMENT(aSpace1) ); |
| 53981 | 54009 | |
| 53982 | 54010 | /* |
| 53983 | 54011 | ** Load pointers to all cells on sibling pages and the divider cells |
| 53984 | 54012 | ** into the local apCell[] array. Make copies of the divider cells |
| 53985 | - ** into space obtained from aSpace1[] and remove the the divider Cells | |
| 54013 | + ** into space obtained from aSpace1[] and remove the divider cells | |
| 53986 | 54014 | ** from pParent. |
| 53987 | 54015 | ** |
| 53988 | 54016 | ** If the siblings are on leaf pages, then the child pointers of the |
| 53989 | 54017 | ** divider cells are stripped from the cells before they are copied |
| 53990 | 54018 | ** into aSpace1[]. In this way, all cells in apCell[] are without |
| @@ -58861,11 +58889,11 @@ | ||
| 58861 | 58889 | } |
| 58862 | 58890 | } |
| 58863 | 58891 | |
| 58864 | 58892 | #ifndef NDEBUG |
| 58865 | 58893 | /* |
| 58866 | -** Change the comment on the the most recently coded instruction. Or | |
| 58894 | +** Change the comment on the most recently coded instruction. Or | |
| 58867 | 58895 | ** insert a No-op and add the comment to that new instruction. This |
| 58868 | 58896 | ** makes the code easier to read during debugging. None of this happens |
| 58869 | 58897 | ** in a production build. |
| 58870 | 58898 | */ |
| 58871 | 58899 | static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){ |
| @@ -64073,11 +64101,11 @@ | ||
| 64073 | 64101 | } |
| 64074 | 64102 | nProgressOps++; |
| 64075 | 64103 | } |
| 64076 | 64104 | #endif |
| 64077 | 64105 | |
| 64078 | - /* On any opcode with the "out2-prerelase" tag, free any | |
| 64106 | + /* On any opcode with the "out2-prerelease" tag, free any | |
| 64079 | 64107 | ** external allocations out of mem[p2] and set mem[p2] to be |
| 64080 | 64108 | ** an undefined integer. Opcodes will either fill in the integer |
| 64081 | 64109 | ** value or convert mem[p2] to a different type. |
| 64082 | 64110 | */ |
| 64083 | 64111 | assert( pOp->opflags==sqlite3OpcodeProperty[pOp->opcode] ); |
| @@ -82638,11 +82666,11 @@ | ||
| 82638 | 82666 | iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); |
| 82639 | 82667 | if( iDb<0 ) goto exit_create_index; |
| 82640 | 82668 | assert( pName && pName->z ); |
| 82641 | 82669 | |
| 82642 | 82670 | #ifndef SQLITE_OMIT_TEMPDB |
| 82643 | - /* If the index name was unqualified, check if the the table | |
| 82671 | + /* If the index name was unqualified, check if the table | |
| 82644 | 82672 | ** is a temp table. If so, set the database to 1. Do not do this |
| 82645 | 82673 | ** if initialising a database schema. |
| 82646 | 82674 | */ |
| 82647 | 82675 | if( !db->init.busy ){ |
| 82648 | 82676 | pTab = sqlite3SrcListLookup(pParse, pTblName); |
| @@ -89192,11 +89220,11 @@ | ||
| 89192 | 89220 | break; |
| 89193 | 89221 | } |
| 89194 | 89222 | case OE_Replace: { |
| 89195 | 89223 | /* If there are DELETE triggers on this table and the |
| 89196 | 89224 | ** recursive-triggers flag is set, call GenerateRowDelete() to |
| 89197 | - ** remove the conflicting row from the the table. This will fire | |
| 89225 | + ** remove the conflicting row from the table. This will fire | |
| 89198 | 89226 | ** the triggers and remove both the table and index b-tree entries. |
| 89199 | 89227 | ** |
| 89200 | 89228 | ** Otherwise, if there are no triggers or the recursive-triggers |
| 89201 | 89229 | ** flag is not set, but the table has one or more indexes, call |
| 89202 | 89230 | ** GenerateRowIndexDelete(). This removes the index b-tree entries |
| @@ -95499,11 +95527,11 @@ | ||
| 95499 | 95527 | sqlite3ExprCodeCopy(pParse, pIn->iSdst, regPrev+1, pIn->nSdst); |
| 95500 | 95528 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regPrev); |
| 95501 | 95529 | } |
| 95502 | 95530 | if( pParse->db->mallocFailed ) return 0; |
| 95503 | 95531 | |
| 95504 | - /* Suppress the the first OFFSET entries if there is an OFFSET clause | |
| 95532 | + /* Suppress the first OFFSET entries if there is an OFFSET clause | |
| 95505 | 95533 | */ |
| 95506 | 95534 | codeOffset(v, p, iContinue); |
| 95507 | 95535 | |
| 95508 | 95536 | switch( pDest->eDest ){ |
| 95509 | 95537 | /* Store the result as data using a unique key. |
| @@ -96217,10 +96245,16 @@ | ||
| 96217 | 96245 | ** rules (11), (13) and (14), they may also contain ORDER BY, |
| 96218 | 96246 | ** LIMIT and OFFSET clauses. The subquery cannot use any compound |
| 96219 | 96247 | ** operator other than UNION ALL because all the other compound |
| 96220 | 96248 | ** operators have an implied DISTINCT which is disallowed by |
| 96221 | 96249 | ** restriction (4). |
| 96250 | +** | |
| 96251 | +** Also, each component of the sub-query must return the same number | |
| 96252 | +** of result columns. This is actually a requirement for any compound | |
| 96253 | +** SELECT statement, but all the code here does is make sure that no | |
| 96254 | +** such (illegal) sub-query is flattened. The caller will detect the | |
| 96255 | +** syntax error and return a detailed message. | |
| 96222 | 96256 | ** |
| 96223 | 96257 | ** (18) If the sub-query is a compound select, then all terms of the |
| 96224 | 96258 | ** ORDER by clause of the parent must be simple references to |
| 96225 | 96259 | ** columns of the sub-query. |
| 96226 | 96260 | ** |
| @@ -96361,10 +96395,11 @@ | ||
| 96361 | 96395 | testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Aggregate ); |
| 96362 | 96396 | assert( pSub->pSrc!=0 ); |
| 96363 | 96397 | if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 |
| 96364 | 96398 | || (pSub1->pPrior && pSub1->op!=TK_ALL) |
| 96365 | 96399 | || pSub1->pSrc->nSrc<1 |
| 96400 | + || pSub->pEList->nExpr!=pSub1->pEList->nExpr | |
| 96366 | 96401 | ){ |
| 96367 | 96402 | return 0; |
| 96368 | 96403 | } |
| 96369 | 96404 | testcase( pSub1->pSrc->nSrc>1 ); |
| 96370 | 96405 | } |
| @@ -98467,11 +98502,11 @@ | ||
| 98467 | 98502 | goto trigger_cleanup; |
| 98468 | 98503 | } |
| 98469 | 98504 | iDb = 1; |
| 98470 | 98505 | pName = pName1; |
| 98471 | 98506 | }else{ |
| 98472 | - /* Figure out the db that the the trigger will be created in */ | |
| 98507 | + /* Figure out the db that the trigger will be created in */ | |
| 98473 | 98508 | iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); |
| 98474 | 98509 | if( iDb<0 ){ |
| 98475 | 98510 | goto trigger_cleanup; |
| 98476 | 98511 | } |
| 98477 | 98512 | } |
| @@ -100636,11 +100671,11 @@ | ||
| 100636 | 100671 | SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){ |
| 100637 | 100672 | sqlite3 *db = pVTab->db; |
| 100638 | 100673 | |
| 100639 | 100674 | assert( db ); |
| 100640 | 100675 | assert( pVTab->nRef>0 ); |
| 100641 | - assert( sqlite3SafetyCheckOk(db) ); | |
| 100676 | + assert( db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_ZOMBIE ); | |
| 100642 | 100677 | |
| 100643 | 100678 | pVTab->nRef--; |
| 100644 | 100679 | if( pVTab->nRef==0 ){ |
| 100645 | 100680 | sqlite3_vtab *p = pVTab->pVtab; |
| 100646 | 100681 | if( p ){ |
| @@ -106695,14 +106730,14 @@ | ||
| 106695 | 106730 | }else |
| 106696 | 106731 | #endif |
| 106697 | 106732 | if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ |
| 106698 | 106733 | Index *pIx = pLevel->plan.u.pIdx; |
| 106699 | 106734 | KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); |
| 106700 | - int iIdxCur = pLevel->iIdxCur; | |
| 106735 | + int iIndexCur = pLevel->iIdxCur; | |
| 106701 | 106736 | assert( pIx->pSchema==pTab->pSchema ); |
| 106702 | - assert( iIdxCur>=0 ); | |
| 106703 | - sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, iDb, | |
| 106737 | + assert( iIndexCur>=0 ); | |
| 106738 | + sqlite3VdbeAddOp4(v, OP_OpenRead, iIndexCur, pIx->tnum, iDb, | |
| 106704 | 106739 | (char*)pKey, P4_KEYINFO_HANDOFF); |
| 106705 | 106740 | VdbeComment((v, "%s", pIx->zName)); |
| 106706 | 106741 | } |
| 106707 | 106742 | sqlite3CodeVerifySchema(pParse, iDb); |
| 106708 | 106743 | notReady &= ~getMask(pWC->pMaskSet, pTabItem->iCursor); |
| @@ -127465,11 +127500,11 @@ | ||
| 127465 | 127500 | rc = sqlite3Fts3SegReaderCursor(p, iLangid, iIndex, iLevel, 0, 0, 1, 0, &csr); |
| 127466 | 127501 | if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
| 127467 | 127502 | |
| 127468 | 127503 | if( iLevel==FTS3_SEGCURSOR_ALL ){ |
| 127469 | 127504 | /* This call is to merge all segments in the database to a single |
| 127470 | - ** segment. The level of the new segment is equal to the the numerically | |
| 127505 | + ** segment. The level of the new segment is equal to the numerically | |
| 127471 | 127506 | ** greatest segment level currently present in the database for this |
| 127472 | 127507 | ** index. The idx of the new segment is always 0. */ |
| 127473 | 127508 | if( csr.nSegment==1 ){ |
| 127474 | 127509 | rc = SQLITE_DONE; |
| 127475 | 127510 | goto finished; |
| @@ -128095,11 +128130,11 @@ | ||
| 128095 | 128130 | |
| 128096 | 128131 | memcpy(pNode->key.a, zTerm, nTerm); |
| 128097 | 128132 | pNode->key.n = nTerm; |
| 128098 | 128133 | } |
| 128099 | 128134 | }else{ |
| 128100 | - /* Otherwise, flush the the current node of layer iLayer to disk. | |
| 128135 | + /* Otherwise, flush the current node of layer iLayer to disk. | |
| 128101 | 128136 | ** Then allocate a new, empty sibling node. The key will be written |
| 128102 | 128137 | ** into the parent of this node. */ |
| 128103 | 128138 | rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); |
| 128104 | 128139 | |
| 128105 | 128140 | assert( pNode->block.nAlloc>=p->nNodeSize ); |
| 128106 | 128141 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -673,11 +673,11 @@ | |
| 673 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 674 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 675 | */ |
| 676 | #define SQLITE_VERSION "3.7.14" |
| 677 | #define SQLITE_VERSION_NUMBER 3007014 |
| 678 | #define SQLITE_SOURCE_ID "2012-08-24 23:56:19 62678be3df35cdcb09172ba8c860f7b73517f1ea" |
| 679 | |
| 680 | /* |
| 681 | ** CAPI3REF: Run-Time Library Version Numbers |
| 682 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 683 | ** |
| @@ -1081,11 +1081,11 @@ | |
| 1081 | |
| 1082 | /* |
| 1083 | ** CAPI3REF: Device Characteristics |
| 1084 | ** |
| 1085 | ** The xDeviceCharacteristics method of the [sqlite3_io_methods] |
| 1086 | ** object returns an integer which is a vector of the these |
| 1087 | ** bit values expressing I/O characteristics of the mass storage |
| 1088 | ** device that holds the file that the [sqlite3_io_methods] |
| 1089 | ** refers to. |
| 1090 | ** |
| 1091 | ** The SQLITE_IOCAP_ATOMIC property means that all writes of |
| @@ -3231,10 +3231,16 @@ | |
| 3231 | ** <b>Note to Windows users:</b> The encoding used for the filename argument |
| 3232 | ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever |
| 3233 | ** codepage is currently defined. Filenames containing international |
| 3234 | ** characters must be converted to UTF-8 prior to passing them into |
| 3235 | ** sqlite3_open() or sqlite3_open_v2(). |
| 3236 | */ |
| 3237 | SQLITE_API int sqlite3_open( |
| 3238 | const char *filename, /* Database filename (UTF-8) */ |
| 3239 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3240 | ); |
| @@ -5035,10 +5041,25 @@ | |
| 5035 | ** [sqlite3_malloc] and the pragma may attempt to free that memory |
| 5036 | ** using [sqlite3_free]. |
| 5037 | ** Hence, if this variable is modified directly, either it should be |
| 5038 | ** made NULL or made to point to memory obtained from [sqlite3_malloc] |
| 5039 | ** or else the use of the [temp_store_directory pragma] should be avoided. |
| 5040 | */ |
| 5041 | SQLITE_API char *sqlite3_temp_directory; |
| 5042 | |
| 5043 | /* |
| 5044 | ** CAPI3REF: Name Of The Folder Holding Database Files |
| @@ -10893,11 +10914,11 @@ | |
| 10893 | }; |
| 10894 | |
| 10895 | /* |
| 10896 | ** For each nested loop in a WHERE clause implementation, the WhereInfo |
| 10897 | ** structure contains a single instance of this structure. This structure |
| 10898 | ** is intended to be private the the where.c module and should not be |
| 10899 | ** access or modified by other modules. |
| 10900 | ** |
| 10901 | ** The pIdxInfo field is used to help pick the best index on a |
| 10902 | ** virtual table. The pIdxInfo pointer contains indexing |
| 10903 | ** information for the i-th table in the FROM clause before reordering. |
| @@ -23794,11 +23815,11 @@ | |
| 23794 | ** strerror_r(). |
| 23795 | ** |
| 23796 | ** The first argument passed to the macro should be the error code that |
| 23797 | ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). |
| 23798 | ** The two subsequent arguments should be the name of the OS function that |
| 23799 | ** failed (e.g. "unlink", "open") and the the associated file-system path, |
| 23800 | ** if any. |
| 23801 | */ |
| 23802 | #define unixLogError(a,b,c) unixLogErrorAtLine(a,b,c,__LINE__) |
| 23803 | static int unixLogErrorAtLine( |
| 23804 | int errcode, /* SQLite error code */ |
| @@ -23817,11 +23838,11 @@ | |
| 23817 | char aErr[80]; |
| 23818 | memset(aErr, 0, sizeof(aErr)); |
| 23819 | zErr = aErr; |
| 23820 | |
| 23821 | /* If STRERROR_R_CHAR_P (set by autoconf scripts) or __USE_GNU is defined, |
| 23822 | ** assume that the system provides the the GNU version of strerror_r() that |
| 23823 | ** returns a pointer to a buffer containing the error message. That pointer |
| 23824 | ** may point to aErr[], or it may point to some static storage somewhere. |
| 23825 | ** Otherwise, assume that the system provides the POSIX version of |
| 23826 | ** strerror_r(), which always writes an error message into aErr[]. |
| 23827 | ** |
| @@ -31306,11 +31327,11 @@ | |
| 31306 | ** FormatMessage. |
| 31307 | ** |
| 31308 | ** The first argument passed to the macro should be the error code that |
| 31309 | ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). |
| 31310 | ** The two subsequent arguments should be the name of the OS function that |
| 31311 | ** failed and the the associated file-system path, if any. |
| 31312 | */ |
| 31313 | #define winLogError(a,b,c,d) winLogErrorAtLine(a,b,c,d,__LINE__) |
| 31314 | static int winLogErrorAtLine( |
| 31315 | int errcode, /* SQLite error code */ |
| 31316 | DWORD lastErrno, /* Win32 last error */ |
| @@ -33431,10 +33452,17 @@ | |
| 33431 | || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL |
| 33432 | ); |
| 33433 | |
| 33434 | assert( id!=0 ); |
| 33435 | UNUSED_PARAMETER(pVfs); |
| 33436 | |
| 33437 | pFile->h = INVALID_HANDLE_VALUE; |
| 33438 | |
| 33439 | /* If the second argument to this function is NULL, generate a |
| 33440 | ** temporary file name to use |
| @@ -33745,11 +33773,11 @@ | |
| 33745 | }else{ |
| 33746 | attr = sAttrData.dwFileAttributes; |
| 33747 | } |
| 33748 | }else{ |
| 33749 | logIoerr(cnt); |
| 33750 | if( lastErrno!=ERROR_FILE_NOT_FOUND ){ |
| 33751 | winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess", zFilename); |
| 33752 | sqlite3_free(zConverted); |
| 33753 | return SQLITE_IOERR_ACCESS; |
| 33754 | }else{ |
| 33755 | attr = INVALID_FILE_ATTRIBUTES; |
| @@ -36710,11 +36738,11 @@ | |
| 36710 | return 0; |
| 36711 | } |
| 36712 | } |
| 36713 | |
| 36714 | /* |
| 36715 | ** Check to see if element iRowid was inserted into the the rowset as |
| 36716 | ** part of any insert batch prior to iBatch. Return 1 or 0. |
| 36717 | ** |
| 36718 | ** If this is the first test of a new batch and if there exist entires |
| 36719 | ** on pRowSet->pEntry, then sort those entires into the forest at |
| 36720 | ** pRowSet->pForest so that they can be tested. |
| @@ -36994,11 +37022,11 @@ | |
| 36994 | ** (6) If a master journal file is used, then all writes to the database file |
| 36995 | ** are synced prior to the master journal being deleted. |
| 36996 | ** |
| 36997 | ** Definition: Two databases (or the same database at two points it time) |
| 36998 | ** are said to be "logically equivalent" if they give the same answer to |
| 36999 | ** all queries. Note in particular the the content of freelist leaf |
| 37000 | ** pages can be changed arbitarily without effecting the logical equivalence |
| 37001 | ** of the database. |
| 37002 | ** |
| 37003 | ** (7) At any time, if any subset, including the empty set and the total set, |
| 37004 | ** of the unsynced changes to a rollback journal are removed and the |
| @@ -40768,11 +40796,11 @@ | |
| 40768 | ** been written to the journal have actually reached the surface of the |
| 40769 | ** disk and can be restored in the event of a hot-journal rollback. |
| 40770 | ** |
| 40771 | ** If the Pager.noSync flag is set, then this function is a no-op. |
| 40772 | ** Otherwise, the actions required depend on the journal-mode and the |
| 40773 | ** device characteristics of the the file-system, as follows: |
| 40774 | ** |
| 40775 | ** * If the journal file is an in-memory journal file, no action need |
| 40776 | ** be taken. |
| 40777 | ** |
| 40778 | ** * Otherwise, if the device does not support the SAFE_APPEND property, |
| @@ -44007,11 +44035,11 @@ | |
| 44007 | ** |
| 44008 | ** The wal-index consists of a header region, followed by an one or |
| 44009 | ** more index blocks. |
| 44010 | ** |
| 44011 | ** The wal-index header contains the total number of frames within the WAL |
| 44012 | ** in the the mxFrame field. |
| 44013 | ** |
| 44014 | ** Each index block except for the first contains information on |
| 44015 | ** HASHTABLE_NPAGE frames. The first index block contains information on |
| 44016 | ** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and |
| 44017 | ** HASHTABLE_NPAGE are selected so that together the wal-index header and |
| @@ -53980,11 +54008,11 @@ | |
| 53980 | assert( EIGHT_BYTE_ALIGNMENT(aSpace1) ); |
| 53981 | |
| 53982 | /* |
| 53983 | ** Load pointers to all cells on sibling pages and the divider cells |
| 53984 | ** into the local apCell[] array. Make copies of the divider cells |
| 53985 | ** into space obtained from aSpace1[] and remove the the divider Cells |
| 53986 | ** from pParent. |
| 53987 | ** |
| 53988 | ** If the siblings are on leaf pages, then the child pointers of the |
| 53989 | ** divider cells are stripped from the cells before they are copied |
| 53990 | ** into aSpace1[]. In this way, all cells in apCell[] are without |
| @@ -58861,11 +58889,11 @@ | |
| 58861 | } |
| 58862 | } |
| 58863 | |
| 58864 | #ifndef NDEBUG |
| 58865 | /* |
| 58866 | ** Change the comment on the the most recently coded instruction. Or |
| 58867 | ** insert a No-op and add the comment to that new instruction. This |
| 58868 | ** makes the code easier to read during debugging. None of this happens |
| 58869 | ** in a production build. |
| 58870 | */ |
| 58871 | static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){ |
| @@ -64073,11 +64101,11 @@ | |
| 64073 | } |
| 64074 | nProgressOps++; |
| 64075 | } |
| 64076 | #endif |
| 64077 | |
| 64078 | /* On any opcode with the "out2-prerelase" tag, free any |
| 64079 | ** external allocations out of mem[p2] and set mem[p2] to be |
| 64080 | ** an undefined integer. Opcodes will either fill in the integer |
| 64081 | ** value or convert mem[p2] to a different type. |
| 64082 | */ |
| 64083 | assert( pOp->opflags==sqlite3OpcodeProperty[pOp->opcode] ); |
| @@ -82638,11 +82666,11 @@ | |
| 82638 | iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); |
| 82639 | if( iDb<0 ) goto exit_create_index; |
| 82640 | assert( pName && pName->z ); |
| 82641 | |
| 82642 | #ifndef SQLITE_OMIT_TEMPDB |
| 82643 | /* If the index name was unqualified, check if the the table |
| 82644 | ** is a temp table. If so, set the database to 1. Do not do this |
| 82645 | ** if initialising a database schema. |
| 82646 | */ |
| 82647 | if( !db->init.busy ){ |
| 82648 | pTab = sqlite3SrcListLookup(pParse, pTblName); |
| @@ -89192,11 +89220,11 @@ | |
| 89192 | break; |
| 89193 | } |
| 89194 | case OE_Replace: { |
| 89195 | /* If there are DELETE triggers on this table and the |
| 89196 | ** recursive-triggers flag is set, call GenerateRowDelete() to |
| 89197 | ** remove the conflicting row from the the table. This will fire |
| 89198 | ** the triggers and remove both the table and index b-tree entries. |
| 89199 | ** |
| 89200 | ** Otherwise, if there are no triggers or the recursive-triggers |
| 89201 | ** flag is not set, but the table has one or more indexes, call |
| 89202 | ** GenerateRowIndexDelete(). This removes the index b-tree entries |
| @@ -95499,11 +95527,11 @@ | |
| 95499 | sqlite3ExprCodeCopy(pParse, pIn->iSdst, regPrev+1, pIn->nSdst); |
| 95500 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regPrev); |
| 95501 | } |
| 95502 | if( pParse->db->mallocFailed ) return 0; |
| 95503 | |
| 95504 | /* Suppress the the first OFFSET entries if there is an OFFSET clause |
| 95505 | */ |
| 95506 | codeOffset(v, p, iContinue); |
| 95507 | |
| 95508 | switch( pDest->eDest ){ |
| 95509 | /* Store the result as data using a unique key. |
| @@ -96217,10 +96245,16 @@ | |
| 96217 | ** rules (11), (13) and (14), they may also contain ORDER BY, |
| 96218 | ** LIMIT and OFFSET clauses. The subquery cannot use any compound |
| 96219 | ** operator other than UNION ALL because all the other compound |
| 96220 | ** operators have an implied DISTINCT which is disallowed by |
| 96221 | ** restriction (4). |
| 96222 | ** |
| 96223 | ** (18) If the sub-query is a compound select, then all terms of the |
| 96224 | ** ORDER by clause of the parent must be simple references to |
| 96225 | ** columns of the sub-query. |
| 96226 | ** |
| @@ -96361,10 +96395,11 @@ | |
| 96361 | testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Aggregate ); |
| 96362 | assert( pSub->pSrc!=0 ); |
| 96363 | if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 |
| 96364 | || (pSub1->pPrior && pSub1->op!=TK_ALL) |
| 96365 | || pSub1->pSrc->nSrc<1 |
| 96366 | ){ |
| 96367 | return 0; |
| 96368 | } |
| 96369 | testcase( pSub1->pSrc->nSrc>1 ); |
| 96370 | } |
| @@ -98467,11 +98502,11 @@ | |
| 98467 | goto trigger_cleanup; |
| 98468 | } |
| 98469 | iDb = 1; |
| 98470 | pName = pName1; |
| 98471 | }else{ |
| 98472 | /* Figure out the db that the the trigger will be created in */ |
| 98473 | iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); |
| 98474 | if( iDb<0 ){ |
| 98475 | goto trigger_cleanup; |
| 98476 | } |
| 98477 | } |
| @@ -100636,11 +100671,11 @@ | |
| 100636 | SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){ |
| 100637 | sqlite3 *db = pVTab->db; |
| 100638 | |
| 100639 | assert( db ); |
| 100640 | assert( pVTab->nRef>0 ); |
| 100641 | assert( sqlite3SafetyCheckOk(db) ); |
| 100642 | |
| 100643 | pVTab->nRef--; |
| 100644 | if( pVTab->nRef==0 ){ |
| 100645 | sqlite3_vtab *p = pVTab->pVtab; |
| 100646 | if( p ){ |
| @@ -106695,14 +106730,14 @@ | |
| 106695 | }else |
| 106696 | #endif |
| 106697 | if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ |
| 106698 | Index *pIx = pLevel->plan.u.pIdx; |
| 106699 | KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); |
| 106700 | int iIdxCur = pLevel->iIdxCur; |
| 106701 | assert( pIx->pSchema==pTab->pSchema ); |
| 106702 | assert( iIdxCur>=0 ); |
| 106703 | sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, iDb, |
| 106704 | (char*)pKey, P4_KEYINFO_HANDOFF); |
| 106705 | VdbeComment((v, "%s", pIx->zName)); |
| 106706 | } |
| 106707 | sqlite3CodeVerifySchema(pParse, iDb); |
| 106708 | notReady &= ~getMask(pWC->pMaskSet, pTabItem->iCursor); |
| @@ -127465,11 +127500,11 @@ | |
| 127465 | rc = sqlite3Fts3SegReaderCursor(p, iLangid, iIndex, iLevel, 0, 0, 1, 0, &csr); |
| 127466 | if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
| 127467 | |
| 127468 | if( iLevel==FTS3_SEGCURSOR_ALL ){ |
| 127469 | /* This call is to merge all segments in the database to a single |
| 127470 | ** segment. The level of the new segment is equal to the the numerically |
| 127471 | ** greatest segment level currently present in the database for this |
| 127472 | ** index. The idx of the new segment is always 0. */ |
| 127473 | if( csr.nSegment==1 ){ |
| 127474 | rc = SQLITE_DONE; |
| 127475 | goto finished; |
| @@ -128095,11 +128130,11 @@ | |
| 128095 | |
| 128096 | memcpy(pNode->key.a, zTerm, nTerm); |
| 128097 | pNode->key.n = nTerm; |
| 128098 | } |
| 128099 | }else{ |
| 128100 | /* Otherwise, flush the the current node of layer iLayer to disk. |
| 128101 | ** Then allocate a new, empty sibling node. The key will be written |
| 128102 | ** into the parent of this node. */ |
| 128103 | rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); |
| 128104 | |
| 128105 | assert( pNode->block.nAlloc>=p->nNodeSize ); |
| 128106 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -673,11 +673,11 @@ | |
| 673 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 674 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 675 | */ |
| 676 | #define SQLITE_VERSION "3.7.14" |
| 677 | #define SQLITE_VERSION_NUMBER 3007014 |
| 678 | #define SQLITE_SOURCE_ID "2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a" |
| 679 | |
| 680 | /* |
| 681 | ** CAPI3REF: Run-Time Library Version Numbers |
| 682 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 683 | ** |
| @@ -1081,11 +1081,11 @@ | |
| 1081 | |
| 1082 | /* |
| 1083 | ** CAPI3REF: Device Characteristics |
| 1084 | ** |
| 1085 | ** The xDeviceCharacteristics method of the [sqlite3_io_methods] |
| 1086 | ** object returns an integer which is a vector of these |
| 1087 | ** bit values expressing I/O characteristics of the mass storage |
| 1088 | ** device that holds the file that the [sqlite3_io_methods] |
| 1089 | ** refers to. |
| 1090 | ** |
| 1091 | ** The SQLITE_IOCAP_ATOMIC property means that all writes of |
| @@ -3231,10 +3231,16 @@ | |
| 3231 | ** <b>Note to Windows users:</b> The encoding used for the filename argument |
| 3232 | ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever |
| 3233 | ** codepage is currently defined. Filenames containing international |
| 3234 | ** characters must be converted to UTF-8 prior to passing them into |
| 3235 | ** sqlite3_open() or sqlite3_open_v2(). |
| 3236 | ** |
| 3237 | ** <b>Note to Windows Runtime users:</b> The temporary directory must be set |
| 3238 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3239 | ** features that require the use of temporary files may fail. |
| 3240 | ** |
| 3241 | ** See also: [sqlite3_temp_directory] |
| 3242 | */ |
| 3243 | SQLITE_API int sqlite3_open( |
| 3244 | const char *filename, /* Database filename (UTF-8) */ |
| 3245 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3246 | ); |
| @@ -5035,10 +5041,25 @@ | |
| 5041 | ** [sqlite3_malloc] and the pragma may attempt to free that memory |
| 5042 | ** using [sqlite3_free]. |
| 5043 | ** Hence, if this variable is modified directly, either it should be |
| 5044 | ** made NULL or made to point to memory obtained from [sqlite3_malloc] |
| 5045 | ** or else the use of the [temp_store_directory pragma] should be avoided. |
| 5046 | ** |
| 5047 | ** <b>Note to Windows Runtime users:</b> The temporary directory must be set |
| 5048 | ** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various |
| 5049 | ** features that require the use of temporary files may fail. Here is an |
| 5050 | ** example of how to do this using C++ with the Windows Runtime: |
| 5051 | ** |
| 5052 | ** <blockquote><pre> |
| 5053 | ** LPCWSTR zPath = Windows::Storage::ApplicationData::Current-> |
| 5054 | ** TemporaryFolder->Path->Data(); |
| 5055 | ** char zPathBuf[MAX_PATH + 1]; |
| 5056 | ** memset(zPathBuf, 0, sizeof(zPathBuf)); |
| 5057 | ** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf), |
| 5058 | ** NULL, NULL); |
| 5059 | ** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); |
| 5060 | ** </pre></blockquote> |
| 5061 | */ |
| 5062 | SQLITE_API char *sqlite3_temp_directory; |
| 5063 | |
| 5064 | /* |
| 5065 | ** CAPI3REF: Name Of The Folder Holding Database Files |
| @@ -10893,11 +10914,11 @@ | |
| 10914 | }; |
| 10915 | |
| 10916 | /* |
| 10917 | ** For each nested loop in a WHERE clause implementation, the WhereInfo |
| 10918 | ** structure contains a single instance of this structure. This structure |
| 10919 | ** is intended to be private to the where.c module and should not be |
| 10920 | ** access or modified by other modules. |
| 10921 | ** |
| 10922 | ** The pIdxInfo field is used to help pick the best index on a |
| 10923 | ** virtual table. The pIdxInfo pointer contains indexing |
| 10924 | ** information for the i-th table in the FROM clause before reordering. |
| @@ -23794,11 +23815,11 @@ | |
| 23815 | ** strerror_r(). |
| 23816 | ** |
| 23817 | ** The first argument passed to the macro should be the error code that |
| 23818 | ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). |
| 23819 | ** The two subsequent arguments should be the name of the OS function that |
| 23820 | ** failed (e.g. "unlink", "open") and the associated file-system path, |
| 23821 | ** if any. |
| 23822 | */ |
| 23823 | #define unixLogError(a,b,c) unixLogErrorAtLine(a,b,c,__LINE__) |
| 23824 | static int unixLogErrorAtLine( |
| 23825 | int errcode, /* SQLite error code */ |
| @@ -23817,11 +23838,11 @@ | |
| 23838 | char aErr[80]; |
| 23839 | memset(aErr, 0, sizeof(aErr)); |
| 23840 | zErr = aErr; |
| 23841 | |
| 23842 | /* If STRERROR_R_CHAR_P (set by autoconf scripts) or __USE_GNU is defined, |
| 23843 | ** assume that the system provides the GNU version of strerror_r() that |
| 23844 | ** returns a pointer to a buffer containing the error message. That pointer |
| 23845 | ** may point to aErr[], or it may point to some static storage somewhere. |
| 23846 | ** Otherwise, assume that the system provides the POSIX version of |
| 23847 | ** strerror_r(), which always writes an error message into aErr[]. |
| 23848 | ** |
| @@ -31306,11 +31327,11 @@ | |
| 31327 | ** FormatMessage. |
| 31328 | ** |
| 31329 | ** The first argument passed to the macro should be the error code that |
| 31330 | ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). |
| 31331 | ** The two subsequent arguments should be the name of the OS function that |
| 31332 | ** failed and the associated file-system path, if any. |
| 31333 | */ |
| 31334 | #define winLogError(a,b,c,d) winLogErrorAtLine(a,b,c,d,__LINE__) |
| 31335 | static int winLogErrorAtLine( |
| 31336 | int errcode, /* SQLite error code */ |
| 31337 | DWORD lastErrno, /* Win32 last error */ |
| @@ -33431,10 +33452,17 @@ | |
| 33452 | || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL |
| 33453 | ); |
| 33454 | |
| 33455 | assert( id!=0 ); |
| 33456 | UNUSED_PARAMETER(pVfs); |
| 33457 | |
| 33458 | #if SQLITE_OS_WINRT |
| 33459 | if( !sqlite3_temp_directory ){ |
| 33460 | sqlite3_log(SQLITE_ERROR, |
| 33461 | "sqlite3_temp_directory variable should be set for WinRT"); |
| 33462 | } |
| 33463 | #endif |
| 33464 | |
| 33465 | pFile->h = INVALID_HANDLE_VALUE; |
| 33466 | |
| 33467 | /* If the second argument to this function is NULL, generate a |
| 33468 | ** temporary file name to use |
| @@ -33745,11 +33773,11 @@ | |
| 33773 | }else{ |
| 33774 | attr = sAttrData.dwFileAttributes; |
| 33775 | } |
| 33776 | }else{ |
| 33777 | logIoerr(cnt); |
| 33778 | if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){ |
| 33779 | winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess", zFilename); |
| 33780 | sqlite3_free(zConverted); |
| 33781 | return SQLITE_IOERR_ACCESS; |
| 33782 | }else{ |
| 33783 | attr = INVALID_FILE_ATTRIBUTES; |
| @@ -36710,11 +36738,11 @@ | |
| 36738 | return 0; |
| 36739 | } |
| 36740 | } |
| 36741 | |
| 36742 | /* |
| 36743 | ** Check to see if element iRowid was inserted into the rowset as |
| 36744 | ** part of any insert batch prior to iBatch. Return 1 or 0. |
| 36745 | ** |
| 36746 | ** If this is the first test of a new batch and if there exist entires |
| 36747 | ** on pRowSet->pEntry, then sort those entires into the forest at |
| 36748 | ** pRowSet->pForest so that they can be tested. |
| @@ -36994,11 +37022,11 @@ | |
| 37022 | ** (6) If a master journal file is used, then all writes to the database file |
| 37023 | ** are synced prior to the master journal being deleted. |
| 37024 | ** |
| 37025 | ** Definition: Two databases (or the same database at two points it time) |
| 37026 | ** are said to be "logically equivalent" if they give the same answer to |
| 37027 | ** all queries. Note in particular the content of freelist leaf |
| 37028 | ** pages can be changed arbitarily without effecting the logical equivalence |
| 37029 | ** of the database. |
| 37030 | ** |
| 37031 | ** (7) At any time, if any subset, including the empty set and the total set, |
| 37032 | ** of the unsynced changes to a rollback journal are removed and the |
| @@ -40768,11 +40796,11 @@ | |
| 40796 | ** been written to the journal have actually reached the surface of the |
| 40797 | ** disk and can be restored in the event of a hot-journal rollback. |
| 40798 | ** |
| 40799 | ** If the Pager.noSync flag is set, then this function is a no-op. |
| 40800 | ** Otherwise, the actions required depend on the journal-mode and the |
| 40801 | ** device characteristics of the file-system, as follows: |
| 40802 | ** |
| 40803 | ** * If the journal file is an in-memory journal file, no action need |
| 40804 | ** be taken. |
| 40805 | ** |
| 40806 | ** * Otherwise, if the device does not support the SAFE_APPEND property, |
| @@ -44007,11 +44035,11 @@ | |
| 44035 | ** |
| 44036 | ** The wal-index consists of a header region, followed by an one or |
| 44037 | ** more index blocks. |
| 44038 | ** |
| 44039 | ** The wal-index header contains the total number of frames within the WAL |
| 44040 | ** in the mxFrame field. |
| 44041 | ** |
| 44042 | ** Each index block except for the first contains information on |
| 44043 | ** HASHTABLE_NPAGE frames. The first index block contains information on |
| 44044 | ** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and |
| 44045 | ** HASHTABLE_NPAGE are selected so that together the wal-index header and |
| @@ -53980,11 +54008,11 @@ | |
| 54008 | assert( EIGHT_BYTE_ALIGNMENT(aSpace1) ); |
| 54009 | |
| 54010 | /* |
| 54011 | ** Load pointers to all cells on sibling pages and the divider cells |
| 54012 | ** into the local apCell[] array. Make copies of the divider cells |
| 54013 | ** into space obtained from aSpace1[] and remove the divider cells |
| 54014 | ** from pParent. |
| 54015 | ** |
| 54016 | ** If the siblings are on leaf pages, then the child pointers of the |
| 54017 | ** divider cells are stripped from the cells before they are copied |
| 54018 | ** into aSpace1[]. In this way, all cells in apCell[] are without |
| @@ -58861,11 +58889,11 @@ | |
| 58889 | } |
| 58890 | } |
| 58891 | |
| 58892 | #ifndef NDEBUG |
| 58893 | /* |
| 58894 | ** Change the comment on the most recently coded instruction. Or |
| 58895 | ** insert a No-op and add the comment to that new instruction. This |
| 58896 | ** makes the code easier to read during debugging. None of this happens |
| 58897 | ** in a production build. |
| 58898 | */ |
| 58899 | static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){ |
| @@ -64073,11 +64101,11 @@ | |
| 64101 | } |
| 64102 | nProgressOps++; |
| 64103 | } |
| 64104 | #endif |
| 64105 | |
| 64106 | /* On any opcode with the "out2-prerelease" tag, free any |
| 64107 | ** external allocations out of mem[p2] and set mem[p2] to be |
| 64108 | ** an undefined integer. Opcodes will either fill in the integer |
| 64109 | ** value or convert mem[p2] to a different type. |
| 64110 | */ |
| 64111 | assert( pOp->opflags==sqlite3OpcodeProperty[pOp->opcode] ); |
| @@ -82638,11 +82666,11 @@ | |
| 82666 | iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); |
| 82667 | if( iDb<0 ) goto exit_create_index; |
| 82668 | assert( pName && pName->z ); |
| 82669 | |
| 82670 | #ifndef SQLITE_OMIT_TEMPDB |
| 82671 | /* If the index name was unqualified, check if the table |
| 82672 | ** is a temp table. If so, set the database to 1. Do not do this |
| 82673 | ** if initialising a database schema. |
| 82674 | */ |
| 82675 | if( !db->init.busy ){ |
| 82676 | pTab = sqlite3SrcListLookup(pParse, pTblName); |
| @@ -89192,11 +89220,11 @@ | |
| 89220 | break; |
| 89221 | } |
| 89222 | case OE_Replace: { |
| 89223 | /* If there are DELETE triggers on this table and the |
| 89224 | ** recursive-triggers flag is set, call GenerateRowDelete() to |
| 89225 | ** remove the conflicting row from the table. This will fire |
| 89226 | ** the triggers and remove both the table and index b-tree entries. |
| 89227 | ** |
| 89228 | ** Otherwise, if there are no triggers or the recursive-triggers |
| 89229 | ** flag is not set, but the table has one or more indexes, call |
| 89230 | ** GenerateRowIndexDelete(). This removes the index b-tree entries |
| @@ -95499,11 +95527,11 @@ | |
| 95527 | sqlite3ExprCodeCopy(pParse, pIn->iSdst, regPrev+1, pIn->nSdst); |
| 95528 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regPrev); |
| 95529 | } |
| 95530 | if( pParse->db->mallocFailed ) return 0; |
| 95531 | |
| 95532 | /* Suppress the first OFFSET entries if there is an OFFSET clause |
| 95533 | */ |
| 95534 | codeOffset(v, p, iContinue); |
| 95535 | |
| 95536 | switch( pDest->eDest ){ |
| 95537 | /* Store the result as data using a unique key. |
| @@ -96217,10 +96245,16 @@ | |
| 96245 | ** rules (11), (13) and (14), they may also contain ORDER BY, |
| 96246 | ** LIMIT and OFFSET clauses. The subquery cannot use any compound |
| 96247 | ** operator other than UNION ALL because all the other compound |
| 96248 | ** operators have an implied DISTINCT which is disallowed by |
| 96249 | ** restriction (4). |
| 96250 | ** |
| 96251 | ** Also, each component of the sub-query must return the same number |
| 96252 | ** of result columns. This is actually a requirement for any compound |
| 96253 | ** SELECT statement, but all the code here does is make sure that no |
| 96254 | ** such (illegal) sub-query is flattened. The caller will detect the |
| 96255 | ** syntax error and return a detailed message. |
| 96256 | ** |
| 96257 | ** (18) If the sub-query is a compound select, then all terms of the |
| 96258 | ** ORDER by clause of the parent must be simple references to |
| 96259 | ** columns of the sub-query. |
| 96260 | ** |
| @@ -96361,10 +96395,11 @@ | |
| 96395 | testcase( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))==SF_Aggregate ); |
| 96396 | assert( pSub->pSrc!=0 ); |
| 96397 | if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 |
| 96398 | || (pSub1->pPrior && pSub1->op!=TK_ALL) |
| 96399 | || pSub1->pSrc->nSrc<1 |
| 96400 | || pSub->pEList->nExpr!=pSub1->pEList->nExpr |
| 96401 | ){ |
| 96402 | return 0; |
| 96403 | } |
| 96404 | testcase( pSub1->pSrc->nSrc>1 ); |
| 96405 | } |
| @@ -98467,11 +98502,11 @@ | |
| 98502 | goto trigger_cleanup; |
| 98503 | } |
| 98504 | iDb = 1; |
| 98505 | pName = pName1; |
| 98506 | }else{ |
| 98507 | /* Figure out the db that the trigger will be created in */ |
| 98508 | iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); |
| 98509 | if( iDb<0 ){ |
| 98510 | goto trigger_cleanup; |
| 98511 | } |
| 98512 | } |
| @@ -100636,11 +100671,11 @@ | |
| 100671 | SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){ |
| 100672 | sqlite3 *db = pVTab->db; |
| 100673 | |
| 100674 | assert( db ); |
| 100675 | assert( pVTab->nRef>0 ); |
| 100676 | assert( db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_ZOMBIE ); |
| 100677 | |
| 100678 | pVTab->nRef--; |
| 100679 | if( pVTab->nRef==0 ){ |
| 100680 | sqlite3_vtab *p = pVTab->pVtab; |
| 100681 | if( p ){ |
| @@ -106695,14 +106730,14 @@ | |
| 106730 | }else |
| 106731 | #endif |
| 106732 | if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ |
| 106733 | Index *pIx = pLevel->plan.u.pIdx; |
| 106734 | KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); |
| 106735 | int iIndexCur = pLevel->iIdxCur; |
| 106736 | assert( pIx->pSchema==pTab->pSchema ); |
| 106737 | assert( iIndexCur>=0 ); |
| 106738 | sqlite3VdbeAddOp4(v, OP_OpenRead, iIndexCur, pIx->tnum, iDb, |
| 106739 | (char*)pKey, P4_KEYINFO_HANDOFF); |
| 106740 | VdbeComment((v, "%s", pIx->zName)); |
| 106741 | } |
| 106742 | sqlite3CodeVerifySchema(pParse, iDb); |
| 106743 | notReady &= ~getMask(pWC->pMaskSet, pTabItem->iCursor); |
| @@ -127465,11 +127500,11 @@ | |
| 127500 | rc = sqlite3Fts3SegReaderCursor(p, iLangid, iIndex, iLevel, 0, 0, 1, 0, &csr); |
| 127501 | if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
| 127502 | |
| 127503 | if( iLevel==FTS3_SEGCURSOR_ALL ){ |
| 127504 | /* This call is to merge all segments in the database to a single |
| 127505 | ** segment. The level of the new segment is equal to the numerically |
| 127506 | ** greatest segment level currently present in the database for this |
| 127507 | ** index. The idx of the new segment is always 0. */ |
| 127508 | if( csr.nSegment==1 ){ |
| 127509 | rc = SQLITE_DONE; |
| 127510 | goto finished; |
| @@ -128095,11 +128130,11 @@ | |
| 128130 | |
| 128131 | memcpy(pNode->key.a, zTerm, nTerm); |
| 128132 | pNode->key.n = nTerm; |
| 128133 | } |
| 128134 | }else{ |
| 128135 | /* Otherwise, flush the current node of layer iLayer to disk. |
| 128136 | ** Then allocate a new, empty sibling node. The key will be written |
| 128137 | ** into the parent of this node. */ |
| 128138 | rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); |
| 128139 | |
| 128140 | assert( pNode->block.nAlloc>=p->nNodeSize ); |
| 128141 |
+23
-2
| --- 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.14" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3007014 |
| 112 | -#define SQLITE_SOURCE_ID "2012-08-24 23:56:19 62678be3df35cdcb09172ba8c860f7b73517f1ea" | |
| 112 | +#define SQLITE_SOURCE_ID "2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| @@ -515,11 +515,11 @@ | ||
| 515 | 515 | |
| 516 | 516 | /* |
| 517 | 517 | ** CAPI3REF: Device Characteristics |
| 518 | 518 | ** |
| 519 | 519 | ** The xDeviceCharacteristics method of the [sqlite3_io_methods] |
| 520 | -** object returns an integer which is a vector of the these | |
| 520 | +** object returns an integer which is a vector of these | |
| 521 | 521 | ** bit values expressing I/O characteristics of the mass storage |
| 522 | 522 | ** device that holds the file that the [sqlite3_io_methods] |
| 523 | 523 | ** refers to. |
| 524 | 524 | ** |
| 525 | 525 | ** The SQLITE_IOCAP_ATOMIC property means that all writes of |
| @@ -2665,10 +2665,16 @@ | ||
| 2665 | 2665 | ** <b>Note to Windows users:</b> The encoding used for the filename argument |
| 2666 | 2666 | ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever |
| 2667 | 2667 | ** codepage is currently defined. Filenames containing international |
| 2668 | 2668 | ** characters must be converted to UTF-8 prior to passing them into |
| 2669 | 2669 | ** sqlite3_open() or sqlite3_open_v2(). |
| 2670 | +** | |
| 2671 | +** <b>Note to Windows Runtime users:</b> The temporary directory must be set | |
| 2672 | +** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various | |
| 2673 | +** features that require the use of temporary files may fail. | |
| 2674 | +** | |
| 2675 | +** See also: [sqlite3_temp_directory] | |
| 2670 | 2676 | */ |
| 2671 | 2677 | SQLITE_API int sqlite3_open( |
| 2672 | 2678 | const char *filename, /* Database filename (UTF-8) */ |
| 2673 | 2679 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 2674 | 2680 | ); |
| @@ -4469,10 +4475,25 @@ | ||
| 4469 | 4475 | ** [sqlite3_malloc] and the pragma may attempt to free that memory |
| 4470 | 4476 | ** using [sqlite3_free]. |
| 4471 | 4477 | ** Hence, if this variable is modified directly, either it should be |
| 4472 | 4478 | ** made NULL or made to point to memory obtained from [sqlite3_malloc] |
| 4473 | 4479 | ** or else the use of the [temp_store_directory pragma] should be avoided. |
| 4480 | +** | |
| 4481 | +** <b>Note to Windows Runtime users:</b> The temporary directory must be set | |
| 4482 | +** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various | |
| 4483 | +** features that require the use of temporary files may fail. Here is an | |
| 4484 | +** example of how to do this using C++ with the Windows Runtime: | |
| 4485 | +** | |
| 4486 | +** <blockquote><pre> | |
| 4487 | +** LPCWSTR zPath = Windows::Storage::ApplicationData::Current-> | |
| 4488 | +** TemporaryFolder->Path->Data(); | |
| 4489 | +** char zPathBuf[MAX_PATH + 1]; | |
| 4490 | +** memset(zPathBuf, 0, sizeof(zPathBuf)); | |
| 4491 | +** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf), | |
| 4492 | +** NULL, NULL); | |
| 4493 | +** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); | |
| 4494 | +** </pre></blockquote> | |
| 4474 | 4495 | */ |
| 4475 | 4496 | SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; |
| 4476 | 4497 | |
| 4477 | 4498 | /* |
| 4478 | 4499 | ** CAPI3REF: Name Of The Folder Holding Database Files |
| 4479 | 4500 |
| --- 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.14" |
| 111 | #define SQLITE_VERSION_NUMBER 3007014 |
| 112 | #define SQLITE_SOURCE_ID "2012-08-24 23:56:19 62678be3df35cdcb09172ba8c860f7b73517f1ea" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -515,11 +515,11 @@ | |
| 515 | |
| 516 | /* |
| 517 | ** CAPI3REF: Device Characteristics |
| 518 | ** |
| 519 | ** The xDeviceCharacteristics method of the [sqlite3_io_methods] |
| 520 | ** object returns an integer which is a vector of the these |
| 521 | ** bit values expressing I/O characteristics of the mass storage |
| 522 | ** device that holds the file that the [sqlite3_io_methods] |
| 523 | ** refers to. |
| 524 | ** |
| 525 | ** The SQLITE_IOCAP_ATOMIC property means that all writes of |
| @@ -2665,10 +2665,16 @@ | |
| 2665 | ** <b>Note to Windows users:</b> The encoding used for the filename argument |
| 2666 | ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever |
| 2667 | ** codepage is currently defined. Filenames containing international |
| 2668 | ** characters must be converted to UTF-8 prior to passing them into |
| 2669 | ** sqlite3_open() or sqlite3_open_v2(). |
| 2670 | */ |
| 2671 | SQLITE_API int sqlite3_open( |
| 2672 | const char *filename, /* Database filename (UTF-8) */ |
| 2673 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 2674 | ); |
| @@ -4469,10 +4475,25 @@ | |
| 4469 | ** [sqlite3_malloc] and the pragma may attempt to free that memory |
| 4470 | ** using [sqlite3_free]. |
| 4471 | ** Hence, if this variable is modified directly, either it should be |
| 4472 | ** made NULL or made to point to memory obtained from [sqlite3_malloc] |
| 4473 | ** or else the use of the [temp_store_directory pragma] should be avoided. |
| 4474 | */ |
| 4475 | SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; |
| 4476 | |
| 4477 | /* |
| 4478 | ** CAPI3REF: Name Of The Folder Holding Database Files |
| 4479 |
| --- 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.14" |
| 111 | #define SQLITE_VERSION_NUMBER 3007014 |
| 112 | #define SQLITE_SOURCE_ID "2012-09-03 15:42:36 c0d89d4a9752922f9e367362366efde4f1b06f2a" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -515,11 +515,11 @@ | |
| 515 | |
| 516 | /* |
| 517 | ** CAPI3REF: Device Characteristics |
| 518 | ** |
| 519 | ** The xDeviceCharacteristics method of the [sqlite3_io_methods] |
| 520 | ** object returns an integer which is a vector of these |
| 521 | ** bit values expressing I/O characteristics of the mass storage |
| 522 | ** device that holds the file that the [sqlite3_io_methods] |
| 523 | ** refers to. |
| 524 | ** |
| 525 | ** The SQLITE_IOCAP_ATOMIC property means that all writes of |
| @@ -2665,10 +2665,16 @@ | |
| 2665 | ** <b>Note to Windows users:</b> The encoding used for the filename argument |
| 2666 | ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever |
| 2667 | ** codepage is currently defined. Filenames containing international |
| 2668 | ** characters must be converted to UTF-8 prior to passing them into |
| 2669 | ** sqlite3_open() or sqlite3_open_v2(). |
| 2670 | ** |
| 2671 | ** <b>Note to Windows Runtime users:</b> The temporary directory must be set |
| 2672 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 2673 | ** features that require the use of temporary files may fail. |
| 2674 | ** |
| 2675 | ** See also: [sqlite3_temp_directory] |
| 2676 | */ |
| 2677 | SQLITE_API int sqlite3_open( |
| 2678 | const char *filename, /* Database filename (UTF-8) */ |
| 2679 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 2680 | ); |
| @@ -4469,10 +4475,25 @@ | |
| 4475 | ** [sqlite3_malloc] and the pragma may attempt to free that memory |
| 4476 | ** using [sqlite3_free]. |
| 4477 | ** Hence, if this variable is modified directly, either it should be |
| 4478 | ** made NULL or made to point to memory obtained from [sqlite3_malloc] |
| 4479 | ** or else the use of the [temp_store_directory pragma] should be avoided. |
| 4480 | ** |
| 4481 | ** <b>Note to Windows Runtime users:</b> The temporary directory must be set |
| 4482 | ** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various |
| 4483 | ** features that require the use of temporary files may fail. Here is an |
| 4484 | ** example of how to do this using C++ with the Windows Runtime: |
| 4485 | ** |
| 4486 | ** <blockquote><pre> |
| 4487 | ** LPCWSTR zPath = Windows::Storage::ApplicationData::Current-> |
| 4488 | ** TemporaryFolder->Path->Data(); |
| 4489 | ** char zPathBuf[MAX_PATH + 1]; |
| 4490 | ** memset(zPathBuf, 0, sizeof(zPathBuf)); |
| 4491 | ** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf), |
| 4492 | ** NULL, NULL); |
| 4493 | ** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); |
| 4494 | ** </pre></blockquote> |
| 4495 | */ |
| 4496 | SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; |
| 4497 | |
| 4498 | /* |
| 4499 | ** CAPI3REF: Name Of The Folder Holding Database Files |
| 4500 |