| | @@ -41,10 +41,57 @@ |
| 41 | 41 | ** |
| 42 | 42 | */ |
| 43 | 43 | #ifndef _SQLITEINT_H_ |
| 44 | 44 | #define _SQLITEINT_H_ |
| 45 | 45 | |
| 46 | +/* |
| 47 | +** Include the header file used to customize the compiler options for MSVC. |
| 48 | +** This should be done first so that it can successfully prevent spurious |
| 49 | +** compiler warnings due to subsequent content in this file and other files |
| 50 | +** that are included by this file. |
| 51 | +*/ |
| 52 | +/************** Include msvc.h in the middle of sqliteInt.h ******************/ |
| 53 | +/************** Begin file msvc.h ********************************************/ |
| 54 | +/* |
| 55 | +** 2015 January 12 |
| 56 | +** |
| 57 | +** The author disclaims copyright to this source code. In place of |
| 58 | +** a legal notice, here is a blessing: |
| 59 | +** |
| 60 | +** May you do good and not evil. |
| 61 | +** May you find forgiveness for yourself and forgive others. |
| 62 | +** May you share freely, never taking more than you give. |
| 63 | +** |
| 64 | +****************************************************************************** |
| 65 | +** |
| 66 | +** This file contains code that is specific to MSVC. |
| 67 | +*/ |
| 68 | +#ifndef _MSVC_H_ |
| 69 | +#define _MSVC_H_ |
| 70 | + |
| 71 | +#if defined(_MSC_VER) |
| 72 | +#pragma warning(disable : 4054) |
| 73 | +#pragma warning(disable : 4055) |
| 74 | +#pragma warning(disable : 4100) |
| 75 | +#pragma warning(disable : 4127) |
| 76 | +#pragma warning(disable : 4152) |
| 77 | +#pragma warning(disable : 4189) |
| 78 | +#pragma warning(disable : 4206) |
| 79 | +#pragma warning(disable : 4210) |
| 80 | +#pragma warning(disable : 4232) |
| 81 | +#pragma warning(disable : 4244) |
| 82 | +#pragma warning(disable : 4305) |
| 83 | +#pragma warning(disable : 4306) |
| 84 | +#pragma warning(disable : 4702) |
| 85 | +#pragma warning(disable : 4706) |
| 86 | +#endif /* defined(_MSC_VER) */ |
| 87 | + |
| 88 | +#endif /* _MSVC_H_ */ |
| 89 | + |
| 90 | +/************** End of msvc.h ************************************************/ |
| 91 | +/************** Continuing where we left off in sqliteInt.h ******************/ |
| 92 | + |
| 46 | 93 | /* |
| 47 | 94 | ** These #defines should enable >2GB file support on POSIX if the |
| 48 | 95 | ** underlying operating system supports it. If the OS lacks |
| 49 | 96 | ** large file support, or if the OS is windows, these should be no-ops. |
| 50 | 97 | ** |
| | @@ -231,11 +278,11 @@ |
| 231 | 278 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 232 | 279 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 233 | 280 | */ |
| 234 | 281 | #define SQLITE_VERSION "3.8.8" |
| 235 | 282 | #define SQLITE_VERSION_NUMBER 3008008 |
| 236 | | -#define SQLITE_SOURCE_ID "2015-01-10 18:22:06 46f3aba2692d74c29ab5c1f24a6daac600fd6af8" |
| 283 | +#define SQLITE_SOURCE_ID "2015-01-12 21:43:00 e693e11d1b9265974c32bddba873ea30a4d0b708" |
| 237 | 284 | |
| 238 | 285 | /* |
| 239 | 286 | ** CAPI3REF: Run-Time Library Version Numbers |
| 240 | 287 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 241 | 288 | ** |
| | @@ -73895,12 +73942,12 @@ |
| 73895 | 73942 | pIdxKey->default_rc = 0; |
| 73896 | 73943 | if( pOp->opcode==OP_NoConflict ){ |
| 73897 | 73944 | /* For the OP_NoConflict opcode, take the jump if any of the |
| 73898 | 73945 | ** input fields are NULL, since any key with a NULL will not |
| 73899 | 73946 | ** conflict */ |
| 73900 | | - for(ii=0; ii<r.nField; ii++){ |
| 73901 | | - if( r.aMem[ii].flags & MEM_Null ){ |
| 73947 | + for(ii=0; ii<pIdxKey->nField; ii++){ |
| 73948 | + if( pIdxKey->aMem[ii].flags & MEM_Null ){ |
| 73902 | 73949 | pc = pOp->p2 - 1; VdbeBranchTaken(1,2); |
| 73903 | 73950 | break; |
| 73904 | 73951 | } |
| 73905 | 73952 | } |
| 73906 | 73953 | } |
| | @@ -79454,10 +79501,11 @@ |
| 79454 | 79501 | rc = vdbePmaReaderNext(pSorter->pReader); |
| 79455 | 79502 | *pbEof = (pSorter->pReader->pFd==0); |
| 79456 | 79503 | }else |
| 79457 | 79504 | #endif |
| 79458 | 79505 | /*if( !pSorter->bUseThreads )*/ { |
| 79506 | + assert( pSorter->pMerger!=0 ); |
| 79459 | 79507 | assert( pSorter->pMerger->pTask==(&pSorter->aTask[0]) ); |
| 79460 | 79508 | rc = vdbeMergeEngineStep(pSorter->pMerger, pbEof); |
| 79461 | 79509 | } |
| 79462 | 79510 | }else{ |
| 79463 | 79511 | SorterRecord *pFree = pSorter->list.pList; |
| | @@ -94655,12 +94703,12 @@ |
| 94655 | 94703 | const char *zDb; /* Name of database holding pTab */ |
| 94656 | 94704 | int i; /* Loop counter */ |
| 94657 | 94705 | WhereInfo *pWInfo; /* Information about the WHERE clause */ |
| 94658 | 94706 | Index *pIdx; /* For looping over indices of the table */ |
| 94659 | 94707 | int iTabCur; /* Cursor number for the table */ |
| 94660 | | - int iDataCur; /* VDBE cursor for the canonical data source */ |
| 94661 | | - int iIdxCur; /* Cursor number of the first index */ |
| 94708 | + int iDataCur = 0; /* VDBE cursor for the canonical data source */ |
| 94709 | + int iIdxCur = 0; /* Cursor number of the first index */ |
| 94662 | 94710 | int nIdx; /* Number of indices */ |
| 94663 | 94711 | sqlite3 *db; /* Main database structure */ |
| 94664 | 94712 | AuthContext sContext; /* Authorization context */ |
| 94665 | 94713 | NameContext sNC; /* Name context to resolve expressions in */ |
| 94666 | 94714 | int iDb; /* Database number */ |
| | @@ -102649,11 +102697,11 @@ |
| 102649 | 102697 | char *zRight = 0; /* Nul-terminated UTF-8 string <value>, or NULL */ |
| 102650 | 102698 | const char *zDb = 0; /* The database name */ |
| 102651 | 102699 | Token *pId; /* Pointer to <id> token */ |
| 102652 | 102700 | char *aFcntl[4]; /* Argument to SQLITE_FCNTL_PRAGMA */ |
| 102653 | 102701 | int iDb; /* Database index for <database> */ |
| 102654 | | - int lwr, upr, mid; /* Binary search bounds */ |
| 102702 | + int lwr, upr, mid = 0; /* Binary search bounds */ |
| 102655 | 102703 | int rc; /* return value form SQLITE_FCNTL_PRAGMA */ |
| 102656 | 102704 | sqlite3 *db = pParse->db; /* The database connection */ |
| 102657 | 102705 | Db *pDb; /* The specific database being pragmaed */ |
| 102658 | 102706 | Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */ |
| 102659 | 102707 | |
| | @@ -129454,11 +129502,11 @@ |
| 129454 | 129502 | ){ |
| 129455 | 129503 | int rc; |
| 129456 | 129504 | char *zErrMsg = 0; |
| 129457 | 129505 | Table *pTab = 0; |
| 129458 | 129506 | Column *pCol = 0; |
| 129459 | | - int iCol; |
| 129507 | + int iCol = 0; |
| 129460 | 129508 | |
| 129461 | 129509 | char const *zDataType = 0; |
| 129462 | 129510 | char const *zCollSeq = 0; |
| 129463 | 129511 | int notnull = 0; |
| 129464 | 129512 | int primarykey = 0; |
| | @@ -133077,11 +133125,11 @@ |
| 133077 | 133125 | const char *zNode, /* Buffer containing segment interior node */ |
| 133078 | 133126 | int nNode, /* Size of buffer at zNode */ |
| 133079 | 133127 | sqlite3_int64 *piLeaf, /* Selected leaf node */ |
| 133080 | 133128 | sqlite3_int64 *piLeaf2 /* Selected leaf node */ |
| 133081 | 133129 | ){ |
| 133082 | | - int rc; /* Return code */ |
| 133130 | + int rc = SQLITE_OK; /* Return code */ |
| 133083 | 133131 | int iHeight; /* Height of this node in tree */ |
| 133084 | 133132 | |
| 133085 | 133133 | assert( piLeaf || piLeaf2 ); |
| 133086 | 133134 | |
| 133087 | 133135 | fts3GetVarint32(zNode, &iHeight); |
| | @@ -133088,11 +133136,11 @@ |
| 133088 | 133136 | rc = fts3ScanInteriorNode(zTerm, nTerm, zNode, nNode, piLeaf, piLeaf2); |
| 133089 | 133137 | assert( !piLeaf2 || !piLeaf || rc!=SQLITE_OK || (*piLeaf<=*piLeaf2) ); |
| 133090 | 133138 | |
| 133091 | 133139 | if( rc==SQLITE_OK && iHeight>1 ){ |
| 133092 | 133140 | char *zBlob = 0; /* Blob read from %_segments table */ |
| 133093 | | - int nBlob; /* Size of zBlob in bytes */ |
| 133141 | + int nBlob = 0; /* Size of zBlob in bytes */ |
| 133094 | 133142 | |
| 133095 | 133143 | if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
| 133096 | 133144 | rc = sqlite3Fts3ReadBlock(p, *piLeaf, &zBlob, &nBlob, 0); |
| 133097 | 133145 | if( rc==SQLITE_OK ){ |
| 133098 | 133146 | rc = fts3SelectLeaf(p, zTerm, nTerm, zBlob, nBlob, piLeaf, 0); |
| | @@ -134310,11 +134358,11 @@ |
| 134310 | 134358 | int idxNum, /* Strategy index */ |
| 134311 | 134359 | const char *idxStr, /* Unused */ |
| 134312 | 134360 | int nVal, /* Number of elements in apVal */ |
| 134313 | 134361 | sqlite3_value **apVal /* Arguments for the indexing scheme */ |
| 134314 | 134362 | ){ |
| 134315 | | - int rc; |
| 134363 | + int rc = SQLITE_OK; |
| 134316 | 134364 | char *zSql; /* SQL statement used to access %_content */ |
| 134317 | 134365 | int eSearch; |
| 134318 | 134366 | Fts3Table *p = (Fts3Table *)pCursor->pVtab; |
| 134319 | 134367 | Fts3Cursor *pCsr = (Fts3Cursor *)pCursor; |
| 134320 | 134368 | |
| | @@ -140798,11 +140846,11 @@ |
| 140798 | 140846 | int argc, /* Number of elements in argv array */ |
| 140799 | 140847 | const char * const *argv, /* xCreate/xConnect argument array */ |
| 140800 | 140848 | sqlite3_vtab **ppVtab, /* OUT: New sqlite3_vtab object */ |
| 140801 | 140849 | char **pzErr /* OUT: sqlite3_malloc'd error message */ |
| 140802 | 140850 | ){ |
| 140803 | | - Fts3tokTable *pTab; |
| 140851 | + Fts3tokTable *pTab = 0; |
| 140804 | 140852 | const sqlite3_tokenizer_module *pMod = 0; |
| 140805 | 140853 | sqlite3_tokenizer *pTok = 0; |
| 140806 | 140854 | int rc; |
| 140807 | 140855 | char **azDequote = 0; |
| 140808 | 140856 | int nDequote; |
| | @@ -144173,12 +144221,12 @@ |
| 144173 | 144221 | } |
| 144174 | 144222 | rc = sqlite3_reset(pRange); |
| 144175 | 144223 | |
| 144176 | 144224 | if( bOk ){ |
| 144177 | 144225 | int iIdx = 0; |
| 144178 | | - sqlite3_stmt *pUpdate1; |
| 144179 | | - sqlite3_stmt *pUpdate2; |
| 144226 | + sqlite3_stmt *pUpdate1 = 0; |
| 144227 | + sqlite3_stmt *pUpdate2 = 0; |
| 144180 | 144228 | |
| 144181 | 144229 | if( rc==SQLITE_OK ){ |
| 144182 | 144230 | rc = fts3SqlStmt(p, SQL_UPDATE_LEVEL_IDX, &pUpdate1, 0); |
| 144183 | 144231 | } |
| 144184 | 144232 | if( rc==SQLITE_OK ){ |
| | @@ -151842,10 +151890,12 @@ |
| 151842 | 151890 | RtreeCell cell; /* New cell to insert if nData>1 */ |
| 151843 | 151891 | int bHaveRowid = 0; /* Set to 1 after new rowid is determined */ |
| 151844 | 151892 | |
| 151845 | 151893 | rtreeReference(pRtree); |
| 151846 | 151894 | assert(nData>=1); |
| 151895 | + |
| 151896 | + cell.iRowid = 0; /* Used only to suppress a compiler warning */ |
| 151847 | 151897 | |
| 151848 | 151898 | /* Constraint handling. A write operation on an r-tree table may return |
| 151849 | 151899 | ** SQLITE_CONSTRAINT for two reasons: |
| 151850 | 151900 | ** |
| 151851 | 151901 | ** 1. A duplicate rowid value, or |
| 151852 | 151902 | |