diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/btree.c | 2 | ||||
-rw-r--r-- | src/build.c | 2 | ||||
-rw-r--r-- | src/insert.c | 2 | ||||
-rw-r--r-- | src/os_unix.c | 4 | ||||
-rw-r--r-- | src/os_win.c | 11 | ||||
-rw-r--r-- | src/pager.c | 4 | ||||
-rw-r--r-- | src/rowset.c | 2 | ||||
-rw-r--r-- | src/select.c | 9 | ||||
-rw-r--r-- | src/shell.c | 2 | ||||
-rw-r--r-- | src/sqlite.h.in | 23 | ||||
-rw-r--r-- | src/sqliteInt.h | 2 | ||||
-rw-r--r-- | src/test4.c | 2 | ||||
-rw-r--r-- | src/test_spellfix.c | 3 | ||||
-rw-r--r-- | src/test_vfstrace.c | 2 | ||||
-rw-r--r-- | src/trigger.c | 2 | ||||
-rw-r--r-- | src/vdbe.c | 2 | ||||
-rw-r--r-- | src/vdbeaux.c | 2 | ||||
-rw-r--r-- | src/vtab.c | 2 | ||||
-rw-r--r-- | src/wal.c | 2 | ||||
-rw-r--r-- | src/where.c | 6 |
20 files changed, 62 insertions, 24 deletions
diff --git a/src/btree.c b/src/btree.c index 1c2e26ff7..47dd7db99 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6083,7 +6083,7 @@ static int balance_nonroot( /* ** Load pointers to all cells on sibling pages and the divider cells ** into the local apCell[] array. Make copies of the divider cells - ** into space obtained from aSpace1[] and remove the the divider Cells + ** into space obtained from aSpace1[] and remove the divider cells ** from pParent. ** ** If the siblings are on leaf pages, then the child pointers of the diff --git a/src/build.c b/src/build.c index c7ad2d1e7..25e474031 100644 --- a/src/build.c +++ b/src/build.c @@ -2536,7 +2536,7 @@ Index *sqlite3CreateIndex( assert( pName && pName->z ); #ifndef SQLITE_OMIT_TEMPDB - /* If the index name was unqualified, check if the the table + /* If the index name was unqualified, check if the table ** is a temp table. If so, set the database to 1. Do not do this ** if initialising a database schema. */ diff --git a/src/insert.c b/src/insert.c index 9357c657e..a2da0259f 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1271,7 +1271,7 @@ void sqlite3GenerateConstraintChecks( case OE_Replace: { /* If there are DELETE triggers on this table and the ** recursive-triggers flag is set, call GenerateRowDelete() to - ** remove the conflicting row from the the table. This will fire + ** remove the conflicting row from the table. This will fire ** the triggers and remove both the table and index b-tree entries. ** ** Otherwise, if there are no triggers or the recursive-triggers diff --git a/src/os_unix.c b/src/os_unix.c index a0326c963..c0df66e8e 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1052,7 +1052,7 @@ static unixInodeInfo *inodeList = 0; ** The first argument passed to the macro should be the error code that ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). ** The two subsequent arguments should be the name of the OS function that -** failed (e.g. "unlink", "open") and the the associated file-system path, +** failed (e.g. "unlink", "open") and the associated file-system path, ** if any. */ #define unixLogError(a,b,c) unixLogErrorAtLine(a,b,c,__LINE__) @@ -1075,7 +1075,7 @@ static int unixLogErrorAtLine( zErr = aErr; /* If STRERROR_R_CHAR_P (set by autoconf scripts) or __USE_GNU is defined, - ** assume that the system provides the the GNU version of strerror_r() that + ** assume that the system provides the GNU version of strerror_r() that ** returns a pointer to a buffer containing the error message. That pointer ** may point to aErr[], or it may point to some static storage somewhere. ** Otherwise, assume that the system provides the POSIX version of diff --git a/src/os_win.c b/src/os_win.c index 1beb40b0c..cbf17b151 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -1464,7 +1464,7 @@ static int getLastErrorMsg(DWORD lastErrno, int nBuf, char *zBuf){ ** The first argument passed to the macro should be the error code that ** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). ** The two subsequent arguments should be the name of the OS function that -** failed and the the associated file-system path, if any. +** failed and the associated file-system path, if any. */ #define winLogError(a,b,c,d) winLogErrorAtLine(a,b,c,d,__LINE__) static int winLogErrorAtLine( @@ -3590,6 +3590,13 @@ static int winOpen( assert( id!=0 ); UNUSED_PARAMETER(pVfs); +#if SQLITE_OS_WINRT + if( !sqlite3_temp_directory ){ + sqlite3_log(SQLITE_ERROR, + "sqlite3_temp_directory variable should be set for WinRT"); + } +#endif + pFile->h = INVALID_HANDLE_VALUE; /* If the second argument to this function is NULL, generate a @@ -3903,7 +3910,7 @@ static int winAccess( } }else{ logIoerr(cnt); - if( lastErrno!=ERROR_FILE_NOT_FOUND ){ + if( lastErrno!=ERROR_FILE_NOT_FOUND && lastErrno!=ERROR_PATH_NOT_FOUND ){ winLogError(SQLITE_IOERR_ACCESS, lastErrno, "winAccess", zFilename); sqlite3_free(zConverted); return SQLITE_IOERR_ACCESS; diff --git a/src/pager.c b/src/pager.c index a3f5d6ec2..09c2a5f90 100644 --- a/src/pager.c +++ b/src/pager.c @@ -75,7 +75,7 @@ ** ** Definition: Two databases (or the same database at two points it time) ** are said to be "logically equivalent" if they give the same answer to -** all queries. Note in particular the the content of freelist leaf +** all queries. Note in particular the content of freelist leaf ** pages can be changed arbitarily without effecting the logical equivalence ** of the database. ** @@ -3849,7 +3849,7 @@ void sqlite3PagerRef(DbPage *pPg){ ** ** If the Pager.noSync flag is set, then this function is a no-op. ** Otherwise, the actions required depend on the journal-mode and the -** device characteristics of the the file-system, as follows: +** device characteristics of the file-system, as follows: ** ** * If the journal file is an in-memory journal file, no action need ** be taken. diff --git a/src/rowset.c b/src/rowset.c index 58c18b78d..5761f9855 100644 --- a/src/rowset.c +++ b/src/rowset.c @@ -440,7 +440,7 @@ int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ } /* -** Check to see if element iRowid was inserted into the the rowset as +** Check to see if element iRowid was inserted into the rowset as ** part of any insert batch prior to iBatch. Return 1 or 0. ** ** If this is the first test of a new batch and if there exist entires diff --git a/src/select.c b/src/select.c index b3860b0e3..6ec9da39a 100644 --- a/src/select.c +++ b/src/select.c @@ -1970,7 +1970,7 @@ static int generateOutputSubroutine( } if( pParse->db->mallocFailed ) return 0; - /* Suppress the the first OFFSET entries if there is an OFFSET clause + /* Suppress the first OFFSET entries if there is an OFFSET clause */ codeOffset(v, p, iContinue); @@ -2689,6 +2689,12 @@ static void substSelect( ** operators have an implied DISTINCT which is disallowed by ** restriction (4). ** +** Also, each component of the sub-query must return the same number +** of result columns. This is actually a requirement for any compound +** SELECT statement, but all the code here does is make sure that no +** such (illegal) sub-query is flattened. The caller will detect the +** syntax error and return a detailed message. +** ** (18) If the sub-query is a compound select, then all terms of the ** ORDER by clause of the parent must be simple references to ** columns of the sub-query. @@ -2832,6 +2838,7 @@ static int flattenSubquery( if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 || (pSub1->pPrior && pSub1->op!=TK_ALL) || pSub1->pSrc->nSrc<1 + || pSub->pEList->nExpr!=pSub1->pEList->nExpr ){ return 0; } diff --git a/src/shell.c b/src/shell.c index baedcceb5..a17d96624 100644 --- a/src/shell.c +++ b/src/shell.c @@ -64,7 +64,9 @@ # include <io.h> #define isatty(h) _isatty(h) #define access(f,m) _access((f),(m)) +#undef popen #define popen(a,b) _popen((a),(b)) +#undef pclose #define pclose(x) _pclose(x) #else /* Make sure isatty() has a prototype. diff --git a/src/sqlite.h.in b/src/sqlite.h.in index f30a39b04..31547c667 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -512,7 +512,7 @@ int sqlite3_exec( ** CAPI3REF: Device Characteristics ** ** The xDeviceCharacteristics method of the [sqlite3_io_methods] -** object returns an integer which is a vector of the these +** object returns an integer which is a vector of these ** bit values expressing I/O characteristics of the mass storage ** device that holds the file that the [sqlite3_io_methods] ** refers to. @@ -2662,6 +2662,12 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** codepage is currently defined. Filenames containing international ** characters must be converted to UTF-8 prior to passing them into ** sqlite3_open() or sqlite3_open_v2(). +** +** <b>Note to Windows Runtime users:</b> The temporary directory must be set +** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various +** features that require the use of temporary files may fail. +** +** See also: [sqlite3_temp_directory] */ int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ @@ -4466,6 +4472,21 @@ int sqlite3_sleep(int); ** Hence, if this variable is modified directly, either it should be ** made NULL or made to point to memory obtained from [sqlite3_malloc] ** or else the use of the [temp_store_directory pragma] should be avoided. +** +** <b>Note to Windows Runtime users:</b> The temporary directory must be set +** prior to calling [sqlite3_open] or [sqlite3_open_v2]. Otherwise, various +** features that require the use of temporary files may fail. Here is an +** example of how to do this using C++ with the Windows Runtime: +** +** <blockquote><pre> +** LPCWSTR zPath = Windows::Storage::ApplicationData::Current-> +** TemporaryFolder->Path->Data(); +** char zPathBuf[MAX_PATH + 1]; +** memset(zPathBuf, 0, sizeof(zPathBuf)); +** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf), +** NULL, NULL); +** sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf); +** </pre></blockquote> */ SQLITE_EXTERN char *sqlite3_temp_directory; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 18a508862..c7280b03c 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1925,7 +1925,7 @@ struct WherePlan { /* ** For each nested loop in a WHERE clause implementation, the WhereInfo ** structure contains a single instance of this structure. This structure -** is intended to be private the the where.c module and should not be +** is intended to be private to the where.c module and should not be ** access or modified by other modules. ** ** The pIdxInfo field is used to help pick the best index on a diff --git a/src/test4.c b/src/test4.c index 5c94370a3..5b4c5a1c1 100644 --- a/src/test4.c +++ b/src/test4.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** Code for testing the the SQLite library in a multithreaded environment. +** Code for testing the SQLite library in a multithreaded environment. */ #include "sqliteInt.h" #include "tcl.h" diff --git a/src/test_spellfix.c b/src/test_spellfix.c index 68247fed0..e5fdac42b 100644 --- a/src/test_spellfix.c +++ b/src/test_spellfix.c @@ -222,7 +222,8 @@ static unsigned char *phoneticHash(const unsigned char *zIn, int nIn){ if( c==CCLASS_SILENT ) continue; cPrevX = c; c = className[c]; - if( c!=zOut[nOut-1] ) zOut[nOut++] = c; + assert( nOut>=0 ); + if( nOut==0 || c!=zOut[nOut-1] ) zOut[nOut++] = c; } zOut[nOut] = 0; return zOut; diff --git a/src/test_vfstrace.c b/src/test_vfstrace.c index 3a0e2cf03..d2f7455e3 100644 --- a/src/test_vfstrace.c +++ b/src/test_vfstrace.c @@ -45,7 +45,7 @@ ** interprets VFS calls before passing them off to another VFS which does ** the actual work. In this case the other VFS - the one that does the ** real work - is identified by the second parameter, zOldVfsName. If -** the the 2nd parameter is NULL then the default VFS is used. The common +** the 2nd parameter is NULL then the default VFS is used. The common ** case is for the 2nd parameter to be NULL. ** ** The third and fourth parameters are the pointer to the output function diff --git a/src/trigger.c b/src/trigger.c index 3c4bf62a1..8985ec6eb 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -111,7 +111,7 @@ void sqlite3BeginTrigger( iDb = 1; pName = pName1; }else{ - /* Figure out the db that the the trigger will be created in */ + /* Figure out the db that the trigger will be created in */ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); if( iDb<0 ){ goto trigger_cleanup; diff --git a/src/vdbe.c b/src/vdbe.c index 240798440..2f42ae260 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -666,7 +666,7 @@ int sqlite3VdbeExec( } #endif - /* On any opcode with the "out2-prerelase" tag, free any + /* On any opcode with the "out2-prerelease" tag, free any ** external allocations out of mem[p2] and set mem[p2] to be ** an undefined integer. Opcodes will either fill in the integer ** value or convert mem[p2] to a different type. diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 79ec08ee4..e72205664 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -775,7 +775,7 @@ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){ #ifndef NDEBUG /* -** Change the comment on the the most recently coded instruction. Or +** Change the comment on the most recently coded instruction. Or ** insert a No-op and add the comment to that new instruction. This ** makes the code easier to read during debugging. None of this happens ** in a production build. diff --git a/src/vtab.c b/src/vtab.c index 0e082a05d..50d576fc3 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -131,7 +131,7 @@ void sqlite3VtabUnlock(VTable *pVTab){ assert( db ); assert( pVTab->nRef>0 ); - assert( sqlite3SafetyCheckOk(db) ); + assert( db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_ZOMBIE ); pVTab->nRef--; if( pVTab->nRef==0 ){ @@ -150,7 +150,7 @@ ** more index blocks. ** ** The wal-index header contains the total number of frames within the WAL -** in the the mxFrame field. +** in the mxFrame field. ** ** Each index block except for the first contains information on ** HASHTABLE_NPAGE frames. The first index block contains information on diff --git a/src/where.c b/src/where.c index a460abc2d..9bbbd43d1 100644 --- a/src/where.c +++ b/src/where.c @@ -5093,10 +5093,10 @@ WhereInfo *sqlite3WhereBegin( if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ Index *pIx = pLevel->plan.u.pIdx; KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); - int iIdxCur = pLevel->iIdxCur; + int iIndexCur = pLevel->iIdxCur; assert( pIx->pSchema==pTab->pSchema ); - assert( iIdxCur>=0 ); - sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, iDb, + assert( iIndexCur>=0 ); + sqlite3VdbeAddOp4(v, OP_OpenRead, iIndexCur, pIx->tnum, iDb, (char*)pKey, P4_KEYINFO_HANDOFF); VdbeComment((v, "%s", pIx->zName)); } |