Fossil SCM
Update the SQLite 3.9.0 beta with fixing for warnings on various obscure compilers. Omit the use of strcpy() in FTS5 since OpenBSD hates strcpy().
Commit
d4a34293aeb890b678ae2a7bc96fe3ed61a00dc2
Parent
0b81254c79df9ae…
2 files changed
+57
-54
+1
-1
+57
-54
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -325,11 +325,11 @@ | ||
| 325 | 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | 327 | */ |
| 328 | 328 | #define SQLITE_VERSION "3.9.0" |
| 329 | 329 | #define SQLITE_VERSION_NUMBER 3009000 |
| 330 | -#define SQLITE_SOURCE_ID "2015-10-10 14:00:37 de28acd42f29693341feb884b7223cd3d2b96730" | |
| 330 | +#define SQLITE_SOURCE_ID "2015-10-10 15:11:49 bc24a5bbfd95df3518611b221de69b73776111bc" | |
| 331 | 331 | |
| 332 | 332 | /* |
| 333 | 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | 335 | ** |
| @@ -86562,17 +86562,17 @@ | ||
| 86562 | 86562 | ** it contains any NULL entries. Cause the register at regHasNull to be set |
| 86563 | 86563 | ** to a non-NULL value if iCur contains no NULLs. Cause register regHasNull |
| 86564 | 86564 | ** to be set to NULL if iCur contains one or more NULL values. |
| 86565 | 86565 | */ |
| 86566 | 86566 | static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){ |
| 86567 | - int j1; | |
| 86567 | + int addr1; | |
| 86568 | 86568 | sqlite3VdbeAddOp2(v, OP_Integer, 0, regHasNull); |
| 86569 | - j1 = sqlite3VdbeAddOp1(v, OP_Rewind, iCur); VdbeCoverage(v); | |
| 86569 | + addr1 = sqlite3VdbeAddOp1(v, OP_Rewind, iCur); VdbeCoverage(v); | |
| 86570 | 86570 | sqlite3VdbeAddOp3(v, OP_Column, iCur, 0, regHasNull); |
| 86571 | 86571 | sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG); |
| 86572 | 86572 | VdbeComment((v, "first_entry_in(%d)", iCur)); |
| 86573 | - sqlite3VdbeJumpHere(v, j1); | |
| 86573 | + sqlite3VdbeJumpHere(v, addr1); | |
| 86574 | 86574 | } |
| 86575 | 86575 | |
| 86576 | 86576 | |
| 86577 | 86577 | #ifndef SQLITE_OMIT_SUBQUERY |
| 86578 | 86578 | /* |
| @@ -87168,24 +87168,24 @@ | ||
| 87168 | 87168 | }else{ |
| 87169 | 87169 | /* In this branch, the RHS of the IN might contain a NULL and |
| 87170 | 87170 | ** the presence of a NULL on the RHS makes a difference in the |
| 87171 | 87171 | ** outcome. |
| 87172 | 87172 | */ |
| 87173 | - int j1; | |
| 87173 | + int addr1; | |
| 87174 | 87174 | |
| 87175 | 87175 | /* First check to see if the LHS is contained in the RHS. If so, |
| 87176 | 87176 | ** then the answer is TRUE the presence of NULLs in the RHS does |
| 87177 | 87177 | ** not matter. If the LHS is not contained in the RHS, then the |
| 87178 | 87178 | ** answer is NULL if the RHS contains NULLs and the answer is |
| 87179 | 87179 | ** FALSE if the RHS is NULL-free. |
| 87180 | 87180 | */ |
| 87181 | - j1 = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0, r1, 1); | |
| 87181 | + addr1 = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0, r1, 1); | |
| 87182 | 87182 | VdbeCoverage(v); |
| 87183 | 87183 | sqlite3VdbeAddOp2(v, OP_IsNull, rRhsHasNull, destIfNull); |
| 87184 | 87184 | VdbeCoverage(v); |
| 87185 | 87185 | sqlite3VdbeGoto(v, destIfFalse); |
| 87186 | - sqlite3VdbeJumpHere(v, j1); | |
| 87186 | + sqlite3VdbeJumpHere(v, addr1); | |
| 87187 | 87187 | } |
| 87188 | 87188 | } |
| 87189 | 87189 | } |
| 87190 | 87190 | sqlite3ReleaseTempReg(pParse, r1); |
| 87191 | 87191 | sqlite3ExprCachePop(pParse); |
| @@ -89772,18 +89772,18 @@ | ||
| 89772 | 89772 | ** If that allocation failed, we would have quit before reaching this |
| 89773 | 89773 | ** point */ |
| 89774 | 89774 | if( ALWAYS(v) ){ |
| 89775 | 89775 | int r1 = sqlite3GetTempReg(pParse); |
| 89776 | 89776 | int r2 = sqlite3GetTempReg(pParse); |
| 89777 | - int j1; | |
| 89777 | + int addr1; | |
| 89778 | 89778 | sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT); |
| 89779 | 89779 | sqlite3VdbeUsesBtree(v, iDb); |
| 89780 | 89780 | sqlite3VdbeAddOp2(v, OP_Integer, minFormat, r2); |
| 89781 | - j1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1); | |
| 89781 | + addr1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1); | |
| 89782 | 89782 | sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); VdbeCoverage(v); |
| 89783 | 89783 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, r2); |
| 89784 | - sqlite3VdbeJumpHere(v, j1); | |
| 89784 | + sqlite3VdbeJumpHere(v, addr1); | |
| 89785 | 89785 | sqlite3ReleaseTempReg(pParse, r1); |
| 89786 | 89786 | sqlite3ReleaseTempReg(pParse, r2); |
| 89787 | 89787 | } |
| 89788 | 89788 | } |
| 89789 | 89789 | |
| @@ -93734,11 +93734,11 @@ | ||
| 93734 | 93734 | ** indices to be created and the table record must come before the |
| 93735 | 93735 | ** indices. Hence, the record number for the table must be allocated |
| 93736 | 93736 | ** now. |
| 93737 | 93737 | */ |
| 93738 | 93738 | if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
| 93739 | - int j1; | |
| 93739 | + int addr1; | |
| 93740 | 93740 | int fileFormat; |
| 93741 | 93741 | int reg1, reg2, reg3; |
| 93742 | 93742 | /* nullRow[] is an OP_Record encoding of a row containing 5 NULLs */ |
| 93743 | 93743 | static const char nullRow[] = { 6, 0, 0, 0, 0, 0 }; |
| 93744 | 93744 | sqlite3BeginWriteOperation(pParse, 1, iDb); |
| @@ -93755,18 +93755,18 @@ | ||
| 93755 | 93755 | reg1 = pParse->regRowid = ++pParse->nMem; |
| 93756 | 93756 | reg2 = pParse->regRoot = ++pParse->nMem; |
| 93757 | 93757 | reg3 = ++pParse->nMem; |
| 93758 | 93758 | sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT); |
| 93759 | 93759 | sqlite3VdbeUsesBtree(v, iDb); |
| 93760 | - j1 = sqlite3VdbeAddOp1(v, OP_If, reg3); VdbeCoverage(v); | |
| 93760 | + addr1 = sqlite3VdbeAddOp1(v, OP_If, reg3); VdbeCoverage(v); | |
| 93761 | 93761 | fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ? |
| 93762 | 93762 | 1 : SQLITE_MAX_FILE_FORMAT; |
| 93763 | 93763 | sqlite3VdbeAddOp2(v, OP_Integer, fileFormat, reg3); |
| 93764 | 93764 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, reg3); |
| 93765 | 93765 | sqlite3VdbeAddOp2(v, OP_Integer, ENC(db), reg3); |
| 93766 | 93766 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_TEXT_ENCODING, reg3); |
| 93767 | - sqlite3VdbeJumpHere(v, j1); | |
| 93767 | + sqlite3VdbeJumpHere(v, addr1); | |
| 93768 | 93768 | |
| 93769 | 93769 | /* This just creates a place-holder record in the sqlite_master table. |
| 93770 | 93770 | ** The record created does not contain anything yet. It will be replaced |
| 93771 | 93771 | ** by the real entry in code generated at sqlite3EndTable(). |
| 93772 | 93772 | ** |
| @@ -102081,20 +102081,20 @@ | ||
| 102081 | 102081 | sqlite3 *db = pParse->db; |
| 102082 | 102082 | |
| 102083 | 102083 | assert( v ); |
| 102084 | 102084 | for(p = pParse->pAinc; p; p = p->pNext){ |
| 102085 | 102085 | Db *pDb = &db->aDb[p->iDb]; |
| 102086 | - int j1; | |
| 102086 | + int addr1; | |
| 102087 | 102087 | int iRec; |
| 102088 | 102088 | int memId = p->regCtr; |
| 102089 | 102089 | |
| 102090 | 102090 | iRec = sqlite3GetTempReg(pParse); |
| 102091 | 102091 | assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) ); |
| 102092 | 102092 | sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite); |
| 102093 | - j1 = sqlite3VdbeAddOp1(v, OP_NotNull, memId+1); VdbeCoverage(v); | |
| 102093 | + addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, memId+1); VdbeCoverage(v); | |
| 102094 | 102094 | sqlite3VdbeAddOp2(v, OP_NewRowid, 0, memId+1); |
| 102095 | - sqlite3VdbeJumpHere(v, j1); | |
| 102095 | + sqlite3VdbeJumpHere(v, addr1); | |
| 102096 | 102096 | sqlite3VdbeAddOp3(v, OP_MakeRecord, memId-1, 2, iRec); |
| 102097 | 102097 | sqlite3VdbeAddOp3(v, OP_Insert, 0, iRec, memId+1); |
| 102098 | 102098 | sqlite3VdbeChangeP5(v, OPFLAG_APPEND); |
| 102099 | 102099 | sqlite3VdbeAddOp0(v, OP_Close); |
| 102100 | 102100 | sqlite3ReleaseTempReg(pParse, iRec); |
| @@ -102582,21 +102582,21 @@ | ||
| 102582 | 102582 | ** not happened yet) so we substitute a rowid of -1 |
| 102583 | 102583 | */ |
| 102584 | 102584 | if( ipkColumn<0 ){ |
| 102585 | 102585 | sqlite3VdbeAddOp2(v, OP_Integer, -1, regCols); |
| 102586 | 102586 | }else{ |
| 102587 | - int j1; | |
| 102587 | + int addr1; | |
| 102588 | 102588 | assert( !withoutRowid ); |
| 102589 | 102589 | if( useTempTable ){ |
| 102590 | 102590 | sqlite3VdbeAddOp3(v, OP_Column, srcTab, ipkColumn, regCols); |
| 102591 | 102591 | }else{ |
| 102592 | 102592 | assert( pSelect==0 ); /* Otherwise useTempTable is true */ |
| 102593 | 102593 | sqlite3ExprCode(pParse, pList->a[ipkColumn].pExpr, regCols); |
| 102594 | 102594 | } |
| 102595 | - j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regCols); VdbeCoverage(v); | |
| 102595 | + addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regCols); VdbeCoverage(v); | |
| 102596 | 102596 | sqlite3VdbeAddOp2(v, OP_Integer, -1, regCols); |
| 102597 | - sqlite3VdbeJumpHere(v, j1); | |
| 102597 | + sqlite3VdbeJumpHere(v, addr1); | |
| 102598 | 102598 | sqlite3VdbeAddOp1(v, OP_MustBeInt, regCols); VdbeCoverage(v); |
| 102599 | 102599 | } |
| 102600 | 102600 | |
| 102601 | 102601 | /* Cannot have triggers on a virtual table. If it were possible, |
| 102602 | 102602 | ** this block would have to account for hidden column. |
| @@ -102666,18 +102666,18 @@ | ||
| 102666 | 102666 | } |
| 102667 | 102667 | /* If the PRIMARY KEY expression is NULL, then use OP_NewRowid |
| 102668 | 102668 | ** to generate a unique primary key value. |
| 102669 | 102669 | */ |
| 102670 | 102670 | if( !appendFlag ){ |
| 102671 | - int j1; | |
| 102671 | + int addr1; | |
| 102672 | 102672 | if( !IsVirtual(pTab) ){ |
| 102673 | - j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regRowid); VdbeCoverage(v); | |
| 102673 | + addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regRowid); VdbeCoverage(v); | |
| 102674 | 102674 | sqlite3VdbeAddOp3(v, OP_NewRowid, iDataCur, regRowid, regAutoinc); |
| 102675 | - sqlite3VdbeJumpHere(v, j1); | |
| 102675 | + sqlite3VdbeJumpHere(v, addr1); | |
| 102676 | 102676 | }else{ |
| 102677 | - j1 = sqlite3VdbeCurrentAddr(v); | |
| 102678 | - sqlite3VdbeAddOp2(v, OP_IsNull, regRowid, j1+2); VdbeCoverage(v); | |
| 102677 | + addr1 = sqlite3VdbeCurrentAddr(v); | |
| 102678 | + sqlite3VdbeAddOp2(v, OP_IsNull, regRowid, addr1+2); VdbeCoverage(v); | |
| 102679 | 102679 | } |
| 102680 | 102680 | sqlite3VdbeAddOp1(v, OP_MustBeInt, regRowid); VdbeCoverage(v); |
| 102681 | 102681 | } |
| 102682 | 102682 | }else if( IsVirtual(pTab) || withoutRowid ){ |
| 102683 | 102683 | sqlite3VdbeAddOp2(v, OP_Null, 0, regRowid); |
| @@ -102927,11 +102927,11 @@ | ||
| 102927 | 102927 | sqlite3 *db; /* Database connection */ |
| 102928 | 102928 | int i; /* loop counter */ |
| 102929 | 102929 | int ix; /* Index loop counter */ |
| 102930 | 102930 | int nCol; /* Number of columns */ |
| 102931 | 102931 | int onError; /* Conflict resolution strategy */ |
| 102932 | - int j1; /* Address of jump instruction */ | |
| 102932 | + int addr1; /* Address of jump instruction */ | |
| 102933 | 102933 | int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ |
| 102934 | 102934 | int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */ |
| 102935 | 102935 | int ipkTop = 0; /* Top of the rowid change constraint check */ |
| 102936 | 102936 | int ipkBottom = 0; /* Bottom of the rowid change constraint check */ |
| 102937 | 102937 | u8 isUpdate; /* True if this is an UPDATE operation */ |
| @@ -102998,13 +102998,14 @@ | ||
| 102998 | 102998 | VdbeCoverage(v); |
| 102999 | 102999 | break; |
| 103000 | 103000 | } |
| 103001 | 103001 | default: { |
| 103002 | 103002 | assert( onError==OE_Replace ); |
| 103003 | - j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regNewData+1+i); VdbeCoverage(v); | |
| 103003 | + addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regNewData+1+i); | |
| 103004 | + VdbeCoverage(v); | |
| 103004 | 103005 | sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+i); |
| 103005 | - sqlite3VdbeJumpHere(v, j1); | |
| 103006 | + sqlite3VdbeJumpHere(v, addr1); | |
| 103006 | 103007 | break; |
| 103007 | 103008 | } |
| 103008 | 103009 | } |
| 103009 | 103010 | } |
| 103010 | 103011 | |
| @@ -105163,11 +105164,11 @@ | ||
| 105163 | 105164 | ** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 105164 | 105165 | ** code if regular extension loading is not available. This is that |
| 105165 | 105166 | ** dummy pointer. |
| 105166 | 105167 | */ |
| 105167 | 105168 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 105168 | -static const sqlite3_api_routines sqlite3Apis = { 0 }; | |
| 105169 | +static const sqlite3_api_routines sqlite3Apis; | |
| 105169 | 105170 | #endif |
| 105170 | 105171 | |
| 105171 | 105172 | |
| 105172 | 105173 | /* |
| 105173 | 105174 | ** The following object holds the list of automatically loaded |
| @@ -111198,16 +111199,16 @@ | ||
| 111198 | 111199 | iContinue = sqlite3VdbeMakeLabel(v); |
| 111199 | 111200 | |
| 111200 | 111201 | /* Suppress duplicates for UNION, EXCEPT, and INTERSECT |
| 111201 | 111202 | */ |
| 111202 | 111203 | if( regPrev ){ |
| 111203 | - int j1, j2; | |
| 111204 | - j1 = sqlite3VdbeAddOp1(v, OP_IfNot, regPrev); VdbeCoverage(v); | |
| 111205 | - j2 = sqlite3VdbeAddOp4(v, OP_Compare, pIn->iSdst, regPrev+1, pIn->nSdst, | |
| 111204 | + int addr1, addr2; | |
| 111205 | + addr1 = sqlite3VdbeAddOp1(v, OP_IfNot, regPrev); VdbeCoverage(v); | |
| 111206 | + addr2 = sqlite3VdbeAddOp4(v, OP_Compare, pIn->iSdst, regPrev+1, pIn->nSdst, | |
| 111206 | 111207 | (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); |
| 111207 | - sqlite3VdbeAddOp3(v, OP_Jump, j2+2, iContinue, j2+2); VdbeCoverage(v); | |
| 111208 | - sqlite3VdbeJumpHere(v, j1); | |
| 111208 | + sqlite3VdbeAddOp3(v, OP_Jump, addr2+2, iContinue, addr2+2); VdbeCoverage(v); | |
| 111209 | + sqlite3VdbeJumpHere(v, addr1); | |
| 111209 | 111210 | sqlite3VdbeAddOp3(v, OP_Copy, pIn->iSdst, regPrev+1, pIn->nSdst-1); |
| 111210 | 111211 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regPrev); |
| 111211 | 111212 | } |
| 111212 | 111213 | if( pParse->db->mallocFailed ) return 0; |
| 111213 | 111214 | |
| @@ -111420,11 +111421,11 @@ | ||
| 111420 | 111421 | int regPrev; /* A range of registers to hold previous output */ |
| 111421 | 111422 | int savedLimit; /* Saved value of p->iLimit */ |
| 111422 | 111423 | int savedOffset; /* Saved value of p->iOffset */ |
| 111423 | 111424 | int labelCmpr; /* Label for the start of the merge algorithm */ |
| 111424 | 111425 | int labelEnd; /* Label for the end of the overall SELECT stmt */ |
| 111425 | - int j1; /* Jump instructions that get retargetted */ | |
| 111426 | + int addr1; /* Jump instructions that get retargetted */ | |
| 111426 | 111427 | int op; /* One of TK_ALL, TK_UNION, TK_EXCEPT, TK_INTERSECT */ |
| 111427 | 111428 | KeyInfo *pKeyDup = 0; /* Comparison information for duplicate removal */ |
| 111428 | 111429 | KeyInfo *pKeyMerge; /* Comparison information for merging rows */ |
| 111429 | 111430 | sqlite3 *db; /* Database connection */ |
| 111430 | 111431 | ExprList *pOrderBy; /* The ORDER BY clause */ |
| @@ -111556,23 +111557,23 @@ | ||
| 111556 | 111557 | |
| 111557 | 111558 | /* Generate a coroutine to evaluate the SELECT statement to the |
| 111558 | 111559 | ** left of the compound operator - the "A" select. |
| 111559 | 111560 | */ |
| 111560 | 111561 | addrSelectA = sqlite3VdbeCurrentAddr(v) + 1; |
| 111561 | - j1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrA, 0, addrSelectA); | |
| 111562 | + addr1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrA, 0, addrSelectA); | |
| 111562 | 111563 | VdbeComment((v, "left SELECT")); |
| 111563 | 111564 | pPrior->iLimit = regLimitA; |
| 111564 | 111565 | explainSetInteger(iSub1, pParse->iNextSelectId); |
| 111565 | 111566 | sqlite3Select(pParse, pPrior, &destA); |
| 111566 | 111567 | sqlite3VdbeAddOp1(v, OP_EndCoroutine, regAddrA); |
| 111567 | - sqlite3VdbeJumpHere(v, j1); | |
| 111568 | + sqlite3VdbeJumpHere(v, addr1); | |
| 111568 | 111569 | |
| 111569 | 111570 | /* Generate a coroutine to evaluate the SELECT statement on |
| 111570 | 111571 | ** the right - the "B" select |
| 111571 | 111572 | */ |
| 111572 | 111573 | addrSelectB = sqlite3VdbeCurrentAddr(v) + 1; |
| 111573 | - j1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrB, 0, addrSelectB); | |
| 111574 | + addr1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrB, 0, addrSelectB); | |
| 111574 | 111575 | VdbeComment((v, "right SELECT")); |
| 111575 | 111576 | savedLimit = p->iLimit; |
| 111576 | 111577 | savedOffset = p->iOffset; |
| 111577 | 111578 | p->iLimit = regLimitB; |
| 111578 | 111579 | p->iOffset = 0; |
| @@ -111659,11 +111660,11 @@ | ||
| 111659 | 111660 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v); |
| 111660 | 111661 | sqlite3VdbeGoto(v, labelCmpr); |
| 111661 | 111662 | |
| 111662 | 111663 | /* This code runs once to initialize everything. |
| 111663 | 111664 | */ |
| 111664 | - sqlite3VdbeJumpHere(v, j1); | |
| 111665 | + sqlite3VdbeJumpHere(v, addr1); | |
| 111665 | 111666 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, addrEofA_noB); VdbeCoverage(v); |
| 111666 | 111667 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v); |
| 111667 | 111668 | |
| 111668 | 111669 | /* Implement the main merge loop |
| 111669 | 111670 | */ |
| @@ -113833,11 +113834,11 @@ | ||
| 113833 | 113834 | /* Processing for aggregates with GROUP BY is very different and |
| 113834 | 113835 | ** much more complex than aggregates without a GROUP BY. |
| 113835 | 113836 | */ |
| 113836 | 113837 | if( pGroupBy ){ |
| 113837 | 113838 | KeyInfo *pKeyInfo; /* Keying information for the group by clause */ |
| 113838 | - int j1; /* A-vs-B comparision jump */ | |
| 113839 | + int addr1; /* A-vs-B comparision jump */ | |
| 113839 | 113840 | int addrOutputRow; /* Start of subroutine that outputs a result row */ |
| 113840 | 113841 | int regOutputRow; /* Return address register for output subroutine */ |
| 113841 | 113842 | int addrSetAbort; /* Set the abort flag and return */ |
| 113842 | 113843 | int addrTopOfLoop; /* Top of the input loop */ |
| 113843 | 113844 | int addrSortingIdx; /* The OP_OpenEphemeral for the sorting index */ |
| @@ -113981,12 +113982,12 @@ | ||
| 113981 | 113982 | sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); |
| 113982 | 113983 | } |
| 113983 | 113984 | } |
| 113984 | 113985 | sqlite3VdbeAddOp4(v, OP_Compare, iAMem, iBMem, pGroupBy->nExpr, |
| 113985 | 113986 | (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); |
| 113986 | - j1 = sqlite3VdbeCurrentAddr(v); | |
| 113987 | - sqlite3VdbeAddOp3(v, OP_Jump, j1+1, 0, j1+1); VdbeCoverage(v); | |
| 113987 | + addr1 = sqlite3VdbeCurrentAddr(v); | |
| 113988 | + sqlite3VdbeAddOp3(v, OP_Jump, addr1+1, 0, addr1+1); VdbeCoverage(v); | |
| 113988 | 113989 | |
| 113989 | 113990 | /* Generate code that runs whenever the GROUP BY changes. |
| 113990 | 113991 | ** Changes in the GROUP BY are detected by the previous code |
| 113991 | 113992 | ** block. If there were no changes, this block is skipped. |
| 113992 | 113993 | ** |
| @@ -114004,11 +114005,11 @@ | ||
| 114004 | 114005 | VdbeComment((v, "reset accumulator")); |
| 114005 | 114006 | |
| 114006 | 114007 | /* Update the aggregate accumulators based on the content of |
| 114007 | 114008 | ** the current row |
| 114008 | 114009 | */ |
| 114009 | - sqlite3VdbeJumpHere(v, j1); | |
| 114010 | + sqlite3VdbeJumpHere(v, addr1); | |
| 114010 | 114011 | updateAccumulator(pParse, &sAggInfo); |
| 114011 | 114012 | sqlite3VdbeAddOp2(v, OP_Integer, 1, iUseFlag); |
| 114012 | 114013 | VdbeComment((v, "indicate data in accumulator")); |
| 114013 | 114014 | |
| 114014 | 114015 | /* End of the loop |
| @@ -116133,11 +116134,11 @@ | ||
| 116133 | 116134 | } |
| 116134 | 116135 | } |
| 116135 | 116136 | } |
| 116136 | 116137 | |
| 116137 | 116138 | if( !isView ){ |
| 116138 | - int j1 = 0; /* Address of jump instruction */ | |
| 116139 | + int addr1 = 0; /* Address of jump instruction */ | |
| 116139 | 116140 | int bReplace = 0; /* True if REPLACE conflict resolution might happen */ |
| 116140 | 116141 | |
| 116141 | 116142 | /* Do constraint checks. */ |
| 116142 | 116143 | assert( regOldRowid>0 ); |
| 116143 | 116144 | sqlite3GenerateConstraintChecks(pParse, pTab, aRegIdx, iDataCur, iIdxCur, |
| @@ -116149,13 +116150,13 @@ | ||
| 116149 | 116150 | } |
| 116150 | 116151 | |
| 116151 | 116152 | /* Delete the index entries associated with the current record. */ |
| 116152 | 116153 | if( bReplace || chngKey ){ |
| 116153 | 116154 | if( pPk ){ |
| 116154 | - j1 = sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, 0, regKey, nKey); | |
| 116155 | + addr1 = sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, 0, regKey, nKey); | |
| 116155 | 116156 | }else{ |
| 116156 | - j1 = sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, 0, regOldRowid); | |
| 116157 | + addr1 = sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, 0, regOldRowid); | |
| 116157 | 116158 | } |
| 116158 | 116159 | VdbeCoverageNeverTaken(v); |
| 116159 | 116160 | } |
| 116160 | 116161 | sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, aRegIdx, -1); |
| 116161 | 116162 | |
| @@ -116162,11 +116163,11 @@ | ||
| 116162 | 116163 | /* If changing the record number, delete the old record. */ |
| 116163 | 116164 | if( hasFK || chngKey || pPk!=0 ){ |
| 116164 | 116165 | sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0); |
| 116165 | 116166 | } |
| 116166 | 116167 | if( bReplace || chngKey ){ |
| 116167 | - sqlite3VdbeJumpHere(v, j1); | |
| 116168 | + sqlite3VdbeJumpHere(v, addr1); | |
| 116168 | 116169 | } |
| 116169 | 116170 | |
| 116170 | 116171 | if( hasFK ){ |
| 116171 | 116172 | sqlite3FkCheck(pParse, pTab, 0, regNewRowid, aXRef, chngKey); |
| 116172 | 116173 | } |
| @@ -119772,11 +119773,11 @@ | ||
| 119772 | 119773 | for(ii=0; ii<pOrWc->nTerm; ii++){ |
| 119773 | 119774 | WhereTerm *pOrTerm = &pOrWc->a[ii]; |
| 119774 | 119775 | if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
| 119775 | 119776 | WhereInfo *pSubWInfo; /* Info for single OR-term scan */ |
| 119776 | 119777 | Expr *pOrExpr = pOrTerm->pExpr; /* Current OR clause term */ |
| 119777 | - int j1 = 0; /* Address of jump operation */ | |
| 119778 | + int jmp1 = 0; /* Address of jump operation */ | |
| 119778 | 119779 | if( pAndExpr && !ExprHasProperty(pOrExpr, EP_FromJoin) ){ |
| 119779 | 119780 | pAndExpr->pLeft = pOrExpr; |
| 119780 | 119781 | pOrExpr = pAndExpr; |
| 119781 | 119782 | } |
| 119782 | 119783 | /* Loop through table entries that match term pOrTerm. */ |
| @@ -119799,11 +119800,12 @@ | ||
| 119799 | 119800 | if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
| 119800 | 119801 | int r; |
| 119801 | 119802 | int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); |
| 119802 | 119803 | if( HasRowid(pTab) ){ |
| 119803 | 119804 | r = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, regRowid, 0); |
| 119804 | - j1 = sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, 0, r,iSet); | |
| 119805 | + jmp1 = sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, 0, | |
| 119806 | + r,iSet); | |
| 119805 | 119807 | VdbeCoverage(v); |
| 119806 | 119808 | }else{ |
| 119807 | 119809 | Index *pPk = sqlite3PrimaryKeyIndex(pTab); |
| 119808 | 119810 | int nPk = pPk->nKeyCol; |
| 119809 | 119811 | int iPk; |
| @@ -119829,11 +119831,11 @@ | ||
| 119829 | 119831 | ** is zero, assume that the key cannot already be present in |
| 119830 | 119832 | ** the temp table. And if iSet is -1, assume that there is no |
| 119831 | 119833 | ** need to insert the key into the temp table, as it will never |
| 119832 | 119834 | ** be tested for. */ |
| 119833 | 119835 | if( iSet ){ |
| 119834 | - j1 = sqlite3VdbeAddOp4Int(v, OP_Found, regRowset, 0, r, nPk); | |
| 119836 | + jmp1 = sqlite3VdbeAddOp4Int(v, OP_Found, regRowset, 0, r, nPk); | |
| 119835 | 119837 | VdbeCoverage(v); |
| 119836 | 119838 | } |
| 119837 | 119839 | if( iSet>=0 ){ |
| 119838 | 119840 | sqlite3VdbeAddOp3(v, OP_MakeRecord, r, nPk, regRowid); |
| 119839 | 119841 | sqlite3VdbeAddOp3(v, OP_IdxInsert, regRowset, regRowid, 0); |
| @@ -119848,11 +119850,11 @@ | ||
| 119848 | 119850 | /* Invoke the main loop body as a subroutine */ |
| 119849 | 119851 | sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); |
| 119850 | 119852 | |
| 119851 | 119853 | /* Jump here (skipping the main loop body subroutine) if the |
| 119852 | 119854 | ** current sub-WHERE row is a duplicate from prior sub-WHEREs. */ |
| 119853 | - if( j1 ) sqlite3VdbeJumpHere(v, j1); | |
| 119855 | + if( jmp1 ) sqlite3VdbeJumpHere(v, jmp1); | |
| 119854 | 119856 | |
| 119855 | 119857 | /* The pSubWInfo->untestedTerms flag means that this OR term |
| 119856 | 119858 | ** contained one or more AND term from a notReady table. The |
| 119857 | 119859 | ** terms from the notReady table could not be tested and will |
| 119858 | 119860 | ** need to be tested later. |
| @@ -180360,18 +180362,20 @@ | ||
| 180360 | 180362 | ){ |
| 180361 | 180363 | Fts5Global *pGlobal = (Fts5Global*)pApi; |
| 180362 | 180364 | int rc = sqlite3_overload_function(pGlobal->db, zName, -1); |
| 180363 | 180365 | if( rc==SQLITE_OK ){ |
| 180364 | 180366 | Fts5Auxiliary *pAux; |
| 180367 | + int nName; /* Size of zName in bytes, including \0 */ | |
| 180365 | 180368 | int nByte; /* Bytes of space to allocate */ |
| 180366 | 180369 | |
| 180367 | - nByte = sizeof(Fts5Auxiliary) + strlen(zName) + 1; | |
| 180370 | + nName = (int)strlen(zName) + 1; | |
| 180371 | + nByte = sizeof(Fts5Auxiliary) + nName; | |
| 180368 | 180372 | pAux = (Fts5Auxiliary*)sqlite3_malloc(nByte); |
| 180369 | 180373 | if( pAux ){ |
| 180370 | 180374 | memset(pAux, 0, nByte); |
| 180371 | 180375 | pAux->zFunc = (char*)&pAux[1]; |
| 180372 | - strcpy(pAux->zFunc, zName); | |
| 180376 | + memcpy(pAux->zFunc, zName, nName); | |
| 180373 | 180377 | pAux->pGlobal = pGlobal; |
| 180374 | 180378 | pAux->pUserData = pUserData; |
| 180375 | 180379 | pAux->xFunc = xFunc; |
| 180376 | 180380 | pAux->xDestroy = xDestroy; |
| 180377 | 180381 | pAux->pNext = pGlobal->pAux; |
| @@ -180535,11 +180539,11 @@ | ||
| 180535 | 180539 | sqlite3_context *pCtx, /* Function call context */ |
| 180536 | 180540 | int nArg, /* Number of args */ |
| 180537 | 180541 | sqlite3_value **apVal /* Function arguments */ |
| 180538 | 180542 | ){ |
| 180539 | 180543 | assert( nArg==0 ); |
| 180540 | - sqlite3_result_text(pCtx, "fts5: 2015-10-09 13:42:52 aa8fdadf2defed00a28366a3b35a3e2eefecf0ed", -1, SQLITE_TRANSIENT); | |
| 180544 | + sqlite3_result_text(pCtx, "fts5: 2015-10-10 15:11:49 bc24a5bbfd95df3518611b221de69b73776111bc", -1, SQLITE_TRANSIENT); | |
| 180541 | 180545 | } |
| 180542 | 180546 | |
| 180543 | 180547 | static int fts5Init(sqlite3 *db){ |
| 180544 | 180548 | static const sqlite3_module fts5Mod = { |
| 180545 | 180549 | /* iVersion */ 2, |
| @@ -180639,11 +180643,10 @@ | ||
| 180639 | 180643 | #else |
| 180640 | 180644 | SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3 *db){ |
| 180641 | 180645 | return fts5Init(db); |
| 180642 | 180646 | } |
| 180643 | 180647 | #endif |
| 180644 | - | |
| 180645 | 180648 | |
| 180646 | 180649 | /* |
| 180647 | 180650 | ** 2014 May 31 |
| 180648 | 180651 | ** |
| 180649 | 180652 | ** The author disclaims copyright to this source code. In place of |
| 180650 | 180653 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -325,11 +325,11 @@ | |
| 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | */ |
| 328 | #define SQLITE_VERSION "3.9.0" |
| 329 | #define SQLITE_VERSION_NUMBER 3009000 |
| 330 | #define SQLITE_SOURCE_ID "2015-10-10 14:00:37 de28acd42f29693341feb884b7223cd3d2b96730" |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | ** |
| @@ -86562,17 +86562,17 @@ | |
| 86562 | ** it contains any NULL entries. Cause the register at regHasNull to be set |
| 86563 | ** to a non-NULL value if iCur contains no NULLs. Cause register regHasNull |
| 86564 | ** to be set to NULL if iCur contains one or more NULL values. |
| 86565 | */ |
| 86566 | static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){ |
| 86567 | int j1; |
| 86568 | sqlite3VdbeAddOp2(v, OP_Integer, 0, regHasNull); |
| 86569 | j1 = sqlite3VdbeAddOp1(v, OP_Rewind, iCur); VdbeCoverage(v); |
| 86570 | sqlite3VdbeAddOp3(v, OP_Column, iCur, 0, regHasNull); |
| 86571 | sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG); |
| 86572 | VdbeComment((v, "first_entry_in(%d)", iCur)); |
| 86573 | sqlite3VdbeJumpHere(v, j1); |
| 86574 | } |
| 86575 | |
| 86576 | |
| 86577 | #ifndef SQLITE_OMIT_SUBQUERY |
| 86578 | /* |
| @@ -87168,24 +87168,24 @@ | |
| 87168 | }else{ |
| 87169 | /* In this branch, the RHS of the IN might contain a NULL and |
| 87170 | ** the presence of a NULL on the RHS makes a difference in the |
| 87171 | ** outcome. |
| 87172 | */ |
| 87173 | int j1; |
| 87174 | |
| 87175 | /* First check to see if the LHS is contained in the RHS. If so, |
| 87176 | ** then the answer is TRUE the presence of NULLs in the RHS does |
| 87177 | ** not matter. If the LHS is not contained in the RHS, then the |
| 87178 | ** answer is NULL if the RHS contains NULLs and the answer is |
| 87179 | ** FALSE if the RHS is NULL-free. |
| 87180 | */ |
| 87181 | j1 = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0, r1, 1); |
| 87182 | VdbeCoverage(v); |
| 87183 | sqlite3VdbeAddOp2(v, OP_IsNull, rRhsHasNull, destIfNull); |
| 87184 | VdbeCoverage(v); |
| 87185 | sqlite3VdbeGoto(v, destIfFalse); |
| 87186 | sqlite3VdbeJumpHere(v, j1); |
| 87187 | } |
| 87188 | } |
| 87189 | } |
| 87190 | sqlite3ReleaseTempReg(pParse, r1); |
| 87191 | sqlite3ExprCachePop(pParse); |
| @@ -89772,18 +89772,18 @@ | |
| 89772 | ** If that allocation failed, we would have quit before reaching this |
| 89773 | ** point */ |
| 89774 | if( ALWAYS(v) ){ |
| 89775 | int r1 = sqlite3GetTempReg(pParse); |
| 89776 | int r2 = sqlite3GetTempReg(pParse); |
| 89777 | int j1; |
| 89778 | sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT); |
| 89779 | sqlite3VdbeUsesBtree(v, iDb); |
| 89780 | sqlite3VdbeAddOp2(v, OP_Integer, minFormat, r2); |
| 89781 | j1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1); |
| 89782 | sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); VdbeCoverage(v); |
| 89783 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, r2); |
| 89784 | sqlite3VdbeJumpHere(v, j1); |
| 89785 | sqlite3ReleaseTempReg(pParse, r1); |
| 89786 | sqlite3ReleaseTempReg(pParse, r2); |
| 89787 | } |
| 89788 | } |
| 89789 | |
| @@ -93734,11 +93734,11 @@ | |
| 93734 | ** indices to be created and the table record must come before the |
| 93735 | ** indices. Hence, the record number for the table must be allocated |
| 93736 | ** now. |
| 93737 | */ |
| 93738 | if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
| 93739 | int j1; |
| 93740 | int fileFormat; |
| 93741 | int reg1, reg2, reg3; |
| 93742 | /* nullRow[] is an OP_Record encoding of a row containing 5 NULLs */ |
| 93743 | static const char nullRow[] = { 6, 0, 0, 0, 0, 0 }; |
| 93744 | sqlite3BeginWriteOperation(pParse, 1, iDb); |
| @@ -93755,18 +93755,18 @@ | |
| 93755 | reg1 = pParse->regRowid = ++pParse->nMem; |
| 93756 | reg2 = pParse->regRoot = ++pParse->nMem; |
| 93757 | reg3 = ++pParse->nMem; |
| 93758 | sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT); |
| 93759 | sqlite3VdbeUsesBtree(v, iDb); |
| 93760 | j1 = sqlite3VdbeAddOp1(v, OP_If, reg3); VdbeCoverage(v); |
| 93761 | fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ? |
| 93762 | 1 : SQLITE_MAX_FILE_FORMAT; |
| 93763 | sqlite3VdbeAddOp2(v, OP_Integer, fileFormat, reg3); |
| 93764 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, reg3); |
| 93765 | sqlite3VdbeAddOp2(v, OP_Integer, ENC(db), reg3); |
| 93766 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_TEXT_ENCODING, reg3); |
| 93767 | sqlite3VdbeJumpHere(v, j1); |
| 93768 | |
| 93769 | /* This just creates a place-holder record in the sqlite_master table. |
| 93770 | ** The record created does not contain anything yet. It will be replaced |
| 93771 | ** by the real entry in code generated at sqlite3EndTable(). |
| 93772 | ** |
| @@ -102081,20 +102081,20 @@ | |
| 102081 | sqlite3 *db = pParse->db; |
| 102082 | |
| 102083 | assert( v ); |
| 102084 | for(p = pParse->pAinc; p; p = p->pNext){ |
| 102085 | Db *pDb = &db->aDb[p->iDb]; |
| 102086 | int j1; |
| 102087 | int iRec; |
| 102088 | int memId = p->regCtr; |
| 102089 | |
| 102090 | iRec = sqlite3GetTempReg(pParse); |
| 102091 | assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) ); |
| 102092 | sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite); |
| 102093 | j1 = sqlite3VdbeAddOp1(v, OP_NotNull, memId+1); VdbeCoverage(v); |
| 102094 | sqlite3VdbeAddOp2(v, OP_NewRowid, 0, memId+1); |
| 102095 | sqlite3VdbeJumpHere(v, j1); |
| 102096 | sqlite3VdbeAddOp3(v, OP_MakeRecord, memId-1, 2, iRec); |
| 102097 | sqlite3VdbeAddOp3(v, OP_Insert, 0, iRec, memId+1); |
| 102098 | sqlite3VdbeChangeP5(v, OPFLAG_APPEND); |
| 102099 | sqlite3VdbeAddOp0(v, OP_Close); |
| 102100 | sqlite3ReleaseTempReg(pParse, iRec); |
| @@ -102582,21 +102582,21 @@ | |
| 102582 | ** not happened yet) so we substitute a rowid of -1 |
| 102583 | */ |
| 102584 | if( ipkColumn<0 ){ |
| 102585 | sqlite3VdbeAddOp2(v, OP_Integer, -1, regCols); |
| 102586 | }else{ |
| 102587 | int j1; |
| 102588 | assert( !withoutRowid ); |
| 102589 | if( useTempTable ){ |
| 102590 | sqlite3VdbeAddOp3(v, OP_Column, srcTab, ipkColumn, regCols); |
| 102591 | }else{ |
| 102592 | assert( pSelect==0 ); /* Otherwise useTempTable is true */ |
| 102593 | sqlite3ExprCode(pParse, pList->a[ipkColumn].pExpr, regCols); |
| 102594 | } |
| 102595 | j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regCols); VdbeCoverage(v); |
| 102596 | sqlite3VdbeAddOp2(v, OP_Integer, -1, regCols); |
| 102597 | sqlite3VdbeJumpHere(v, j1); |
| 102598 | sqlite3VdbeAddOp1(v, OP_MustBeInt, regCols); VdbeCoverage(v); |
| 102599 | } |
| 102600 | |
| 102601 | /* Cannot have triggers on a virtual table. If it were possible, |
| 102602 | ** this block would have to account for hidden column. |
| @@ -102666,18 +102666,18 @@ | |
| 102666 | } |
| 102667 | /* If the PRIMARY KEY expression is NULL, then use OP_NewRowid |
| 102668 | ** to generate a unique primary key value. |
| 102669 | */ |
| 102670 | if( !appendFlag ){ |
| 102671 | int j1; |
| 102672 | if( !IsVirtual(pTab) ){ |
| 102673 | j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regRowid); VdbeCoverage(v); |
| 102674 | sqlite3VdbeAddOp3(v, OP_NewRowid, iDataCur, regRowid, regAutoinc); |
| 102675 | sqlite3VdbeJumpHere(v, j1); |
| 102676 | }else{ |
| 102677 | j1 = sqlite3VdbeCurrentAddr(v); |
| 102678 | sqlite3VdbeAddOp2(v, OP_IsNull, regRowid, j1+2); VdbeCoverage(v); |
| 102679 | } |
| 102680 | sqlite3VdbeAddOp1(v, OP_MustBeInt, regRowid); VdbeCoverage(v); |
| 102681 | } |
| 102682 | }else if( IsVirtual(pTab) || withoutRowid ){ |
| 102683 | sqlite3VdbeAddOp2(v, OP_Null, 0, regRowid); |
| @@ -102927,11 +102927,11 @@ | |
| 102927 | sqlite3 *db; /* Database connection */ |
| 102928 | int i; /* loop counter */ |
| 102929 | int ix; /* Index loop counter */ |
| 102930 | int nCol; /* Number of columns */ |
| 102931 | int onError; /* Conflict resolution strategy */ |
| 102932 | int j1; /* Address of jump instruction */ |
| 102933 | int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ |
| 102934 | int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */ |
| 102935 | int ipkTop = 0; /* Top of the rowid change constraint check */ |
| 102936 | int ipkBottom = 0; /* Bottom of the rowid change constraint check */ |
| 102937 | u8 isUpdate; /* True if this is an UPDATE operation */ |
| @@ -102998,13 +102998,14 @@ | |
| 102998 | VdbeCoverage(v); |
| 102999 | break; |
| 103000 | } |
| 103001 | default: { |
| 103002 | assert( onError==OE_Replace ); |
| 103003 | j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regNewData+1+i); VdbeCoverage(v); |
| 103004 | sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+i); |
| 103005 | sqlite3VdbeJumpHere(v, j1); |
| 103006 | break; |
| 103007 | } |
| 103008 | } |
| 103009 | } |
| 103010 | |
| @@ -105163,11 +105164,11 @@ | |
| 105163 | ** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 105164 | ** code if regular extension loading is not available. This is that |
| 105165 | ** dummy pointer. |
| 105166 | */ |
| 105167 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 105168 | static const sqlite3_api_routines sqlite3Apis = { 0 }; |
| 105169 | #endif |
| 105170 | |
| 105171 | |
| 105172 | /* |
| 105173 | ** The following object holds the list of automatically loaded |
| @@ -111198,16 +111199,16 @@ | |
| 111198 | iContinue = sqlite3VdbeMakeLabel(v); |
| 111199 | |
| 111200 | /* Suppress duplicates for UNION, EXCEPT, and INTERSECT |
| 111201 | */ |
| 111202 | if( regPrev ){ |
| 111203 | int j1, j2; |
| 111204 | j1 = sqlite3VdbeAddOp1(v, OP_IfNot, regPrev); VdbeCoverage(v); |
| 111205 | j2 = sqlite3VdbeAddOp4(v, OP_Compare, pIn->iSdst, regPrev+1, pIn->nSdst, |
| 111206 | (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); |
| 111207 | sqlite3VdbeAddOp3(v, OP_Jump, j2+2, iContinue, j2+2); VdbeCoverage(v); |
| 111208 | sqlite3VdbeJumpHere(v, j1); |
| 111209 | sqlite3VdbeAddOp3(v, OP_Copy, pIn->iSdst, regPrev+1, pIn->nSdst-1); |
| 111210 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regPrev); |
| 111211 | } |
| 111212 | if( pParse->db->mallocFailed ) return 0; |
| 111213 | |
| @@ -111420,11 +111421,11 @@ | |
| 111420 | int regPrev; /* A range of registers to hold previous output */ |
| 111421 | int savedLimit; /* Saved value of p->iLimit */ |
| 111422 | int savedOffset; /* Saved value of p->iOffset */ |
| 111423 | int labelCmpr; /* Label for the start of the merge algorithm */ |
| 111424 | int labelEnd; /* Label for the end of the overall SELECT stmt */ |
| 111425 | int j1; /* Jump instructions that get retargetted */ |
| 111426 | int op; /* One of TK_ALL, TK_UNION, TK_EXCEPT, TK_INTERSECT */ |
| 111427 | KeyInfo *pKeyDup = 0; /* Comparison information for duplicate removal */ |
| 111428 | KeyInfo *pKeyMerge; /* Comparison information for merging rows */ |
| 111429 | sqlite3 *db; /* Database connection */ |
| 111430 | ExprList *pOrderBy; /* The ORDER BY clause */ |
| @@ -111556,23 +111557,23 @@ | |
| 111556 | |
| 111557 | /* Generate a coroutine to evaluate the SELECT statement to the |
| 111558 | ** left of the compound operator - the "A" select. |
| 111559 | */ |
| 111560 | addrSelectA = sqlite3VdbeCurrentAddr(v) + 1; |
| 111561 | j1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrA, 0, addrSelectA); |
| 111562 | VdbeComment((v, "left SELECT")); |
| 111563 | pPrior->iLimit = regLimitA; |
| 111564 | explainSetInteger(iSub1, pParse->iNextSelectId); |
| 111565 | sqlite3Select(pParse, pPrior, &destA); |
| 111566 | sqlite3VdbeAddOp1(v, OP_EndCoroutine, regAddrA); |
| 111567 | sqlite3VdbeJumpHere(v, j1); |
| 111568 | |
| 111569 | /* Generate a coroutine to evaluate the SELECT statement on |
| 111570 | ** the right - the "B" select |
| 111571 | */ |
| 111572 | addrSelectB = sqlite3VdbeCurrentAddr(v) + 1; |
| 111573 | j1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrB, 0, addrSelectB); |
| 111574 | VdbeComment((v, "right SELECT")); |
| 111575 | savedLimit = p->iLimit; |
| 111576 | savedOffset = p->iOffset; |
| 111577 | p->iLimit = regLimitB; |
| 111578 | p->iOffset = 0; |
| @@ -111659,11 +111660,11 @@ | |
| 111659 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v); |
| 111660 | sqlite3VdbeGoto(v, labelCmpr); |
| 111661 | |
| 111662 | /* This code runs once to initialize everything. |
| 111663 | */ |
| 111664 | sqlite3VdbeJumpHere(v, j1); |
| 111665 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, addrEofA_noB); VdbeCoverage(v); |
| 111666 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v); |
| 111667 | |
| 111668 | /* Implement the main merge loop |
| 111669 | */ |
| @@ -113833,11 +113834,11 @@ | |
| 113833 | /* Processing for aggregates with GROUP BY is very different and |
| 113834 | ** much more complex than aggregates without a GROUP BY. |
| 113835 | */ |
| 113836 | if( pGroupBy ){ |
| 113837 | KeyInfo *pKeyInfo; /* Keying information for the group by clause */ |
| 113838 | int j1; /* A-vs-B comparision jump */ |
| 113839 | int addrOutputRow; /* Start of subroutine that outputs a result row */ |
| 113840 | int regOutputRow; /* Return address register for output subroutine */ |
| 113841 | int addrSetAbort; /* Set the abort flag and return */ |
| 113842 | int addrTopOfLoop; /* Top of the input loop */ |
| 113843 | int addrSortingIdx; /* The OP_OpenEphemeral for the sorting index */ |
| @@ -113981,12 +113982,12 @@ | |
| 113981 | sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); |
| 113982 | } |
| 113983 | } |
| 113984 | sqlite3VdbeAddOp4(v, OP_Compare, iAMem, iBMem, pGroupBy->nExpr, |
| 113985 | (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); |
| 113986 | j1 = sqlite3VdbeCurrentAddr(v); |
| 113987 | sqlite3VdbeAddOp3(v, OP_Jump, j1+1, 0, j1+1); VdbeCoverage(v); |
| 113988 | |
| 113989 | /* Generate code that runs whenever the GROUP BY changes. |
| 113990 | ** Changes in the GROUP BY are detected by the previous code |
| 113991 | ** block. If there were no changes, this block is skipped. |
| 113992 | ** |
| @@ -114004,11 +114005,11 @@ | |
| 114004 | VdbeComment((v, "reset accumulator")); |
| 114005 | |
| 114006 | /* Update the aggregate accumulators based on the content of |
| 114007 | ** the current row |
| 114008 | */ |
| 114009 | sqlite3VdbeJumpHere(v, j1); |
| 114010 | updateAccumulator(pParse, &sAggInfo); |
| 114011 | sqlite3VdbeAddOp2(v, OP_Integer, 1, iUseFlag); |
| 114012 | VdbeComment((v, "indicate data in accumulator")); |
| 114013 | |
| 114014 | /* End of the loop |
| @@ -116133,11 +116134,11 @@ | |
| 116133 | } |
| 116134 | } |
| 116135 | } |
| 116136 | |
| 116137 | if( !isView ){ |
| 116138 | int j1 = 0; /* Address of jump instruction */ |
| 116139 | int bReplace = 0; /* True if REPLACE conflict resolution might happen */ |
| 116140 | |
| 116141 | /* Do constraint checks. */ |
| 116142 | assert( regOldRowid>0 ); |
| 116143 | sqlite3GenerateConstraintChecks(pParse, pTab, aRegIdx, iDataCur, iIdxCur, |
| @@ -116149,13 +116150,13 @@ | |
| 116149 | } |
| 116150 | |
| 116151 | /* Delete the index entries associated with the current record. */ |
| 116152 | if( bReplace || chngKey ){ |
| 116153 | if( pPk ){ |
| 116154 | j1 = sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, 0, regKey, nKey); |
| 116155 | }else{ |
| 116156 | j1 = sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, 0, regOldRowid); |
| 116157 | } |
| 116158 | VdbeCoverageNeverTaken(v); |
| 116159 | } |
| 116160 | sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, aRegIdx, -1); |
| 116161 | |
| @@ -116162,11 +116163,11 @@ | |
| 116162 | /* If changing the record number, delete the old record. */ |
| 116163 | if( hasFK || chngKey || pPk!=0 ){ |
| 116164 | sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0); |
| 116165 | } |
| 116166 | if( bReplace || chngKey ){ |
| 116167 | sqlite3VdbeJumpHere(v, j1); |
| 116168 | } |
| 116169 | |
| 116170 | if( hasFK ){ |
| 116171 | sqlite3FkCheck(pParse, pTab, 0, regNewRowid, aXRef, chngKey); |
| 116172 | } |
| @@ -119772,11 +119773,11 @@ | |
| 119772 | for(ii=0; ii<pOrWc->nTerm; ii++){ |
| 119773 | WhereTerm *pOrTerm = &pOrWc->a[ii]; |
| 119774 | if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
| 119775 | WhereInfo *pSubWInfo; /* Info for single OR-term scan */ |
| 119776 | Expr *pOrExpr = pOrTerm->pExpr; /* Current OR clause term */ |
| 119777 | int j1 = 0; /* Address of jump operation */ |
| 119778 | if( pAndExpr && !ExprHasProperty(pOrExpr, EP_FromJoin) ){ |
| 119779 | pAndExpr->pLeft = pOrExpr; |
| 119780 | pOrExpr = pAndExpr; |
| 119781 | } |
| 119782 | /* Loop through table entries that match term pOrTerm. */ |
| @@ -119799,11 +119800,12 @@ | |
| 119799 | if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
| 119800 | int r; |
| 119801 | int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); |
| 119802 | if( HasRowid(pTab) ){ |
| 119803 | r = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, regRowid, 0); |
| 119804 | j1 = sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, 0, r,iSet); |
| 119805 | VdbeCoverage(v); |
| 119806 | }else{ |
| 119807 | Index *pPk = sqlite3PrimaryKeyIndex(pTab); |
| 119808 | int nPk = pPk->nKeyCol; |
| 119809 | int iPk; |
| @@ -119829,11 +119831,11 @@ | |
| 119829 | ** is zero, assume that the key cannot already be present in |
| 119830 | ** the temp table. And if iSet is -1, assume that there is no |
| 119831 | ** need to insert the key into the temp table, as it will never |
| 119832 | ** be tested for. */ |
| 119833 | if( iSet ){ |
| 119834 | j1 = sqlite3VdbeAddOp4Int(v, OP_Found, regRowset, 0, r, nPk); |
| 119835 | VdbeCoverage(v); |
| 119836 | } |
| 119837 | if( iSet>=0 ){ |
| 119838 | sqlite3VdbeAddOp3(v, OP_MakeRecord, r, nPk, regRowid); |
| 119839 | sqlite3VdbeAddOp3(v, OP_IdxInsert, regRowset, regRowid, 0); |
| @@ -119848,11 +119850,11 @@ | |
| 119848 | /* Invoke the main loop body as a subroutine */ |
| 119849 | sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); |
| 119850 | |
| 119851 | /* Jump here (skipping the main loop body subroutine) if the |
| 119852 | ** current sub-WHERE row is a duplicate from prior sub-WHEREs. */ |
| 119853 | if( j1 ) sqlite3VdbeJumpHere(v, j1); |
| 119854 | |
| 119855 | /* The pSubWInfo->untestedTerms flag means that this OR term |
| 119856 | ** contained one or more AND term from a notReady table. The |
| 119857 | ** terms from the notReady table could not be tested and will |
| 119858 | ** need to be tested later. |
| @@ -180360,18 +180362,20 @@ | |
| 180360 | ){ |
| 180361 | Fts5Global *pGlobal = (Fts5Global*)pApi; |
| 180362 | int rc = sqlite3_overload_function(pGlobal->db, zName, -1); |
| 180363 | if( rc==SQLITE_OK ){ |
| 180364 | Fts5Auxiliary *pAux; |
| 180365 | int nByte; /* Bytes of space to allocate */ |
| 180366 | |
| 180367 | nByte = sizeof(Fts5Auxiliary) + strlen(zName) + 1; |
| 180368 | pAux = (Fts5Auxiliary*)sqlite3_malloc(nByte); |
| 180369 | if( pAux ){ |
| 180370 | memset(pAux, 0, nByte); |
| 180371 | pAux->zFunc = (char*)&pAux[1]; |
| 180372 | strcpy(pAux->zFunc, zName); |
| 180373 | pAux->pGlobal = pGlobal; |
| 180374 | pAux->pUserData = pUserData; |
| 180375 | pAux->xFunc = xFunc; |
| 180376 | pAux->xDestroy = xDestroy; |
| 180377 | pAux->pNext = pGlobal->pAux; |
| @@ -180535,11 +180539,11 @@ | |
| 180535 | sqlite3_context *pCtx, /* Function call context */ |
| 180536 | int nArg, /* Number of args */ |
| 180537 | sqlite3_value **apVal /* Function arguments */ |
| 180538 | ){ |
| 180539 | assert( nArg==0 ); |
| 180540 | sqlite3_result_text(pCtx, "fts5: 2015-10-09 13:42:52 aa8fdadf2defed00a28366a3b35a3e2eefecf0ed", -1, SQLITE_TRANSIENT); |
| 180541 | } |
| 180542 | |
| 180543 | static int fts5Init(sqlite3 *db){ |
| 180544 | static const sqlite3_module fts5Mod = { |
| 180545 | /* iVersion */ 2, |
| @@ -180639,11 +180643,10 @@ | |
| 180639 | #else |
| 180640 | SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3 *db){ |
| 180641 | return fts5Init(db); |
| 180642 | } |
| 180643 | #endif |
| 180644 | |
| 180645 | |
| 180646 | /* |
| 180647 | ** 2014 May 31 |
| 180648 | ** |
| 180649 | ** The author disclaims copyright to this source code. In place of |
| 180650 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -325,11 +325,11 @@ | |
| 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | */ |
| 328 | #define SQLITE_VERSION "3.9.0" |
| 329 | #define SQLITE_VERSION_NUMBER 3009000 |
| 330 | #define SQLITE_SOURCE_ID "2015-10-10 15:11:49 bc24a5bbfd95df3518611b221de69b73776111bc" |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | ** |
| @@ -86562,17 +86562,17 @@ | |
| 86562 | ** it contains any NULL entries. Cause the register at regHasNull to be set |
| 86563 | ** to a non-NULL value if iCur contains no NULLs. Cause register regHasNull |
| 86564 | ** to be set to NULL if iCur contains one or more NULL values. |
| 86565 | */ |
| 86566 | static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){ |
| 86567 | int addr1; |
| 86568 | sqlite3VdbeAddOp2(v, OP_Integer, 0, regHasNull); |
| 86569 | addr1 = sqlite3VdbeAddOp1(v, OP_Rewind, iCur); VdbeCoverage(v); |
| 86570 | sqlite3VdbeAddOp3(v, OP_Column, iCur, 0, regHasNull); |
| 86571 | sqlite3VdbeChangeP5(v, OPFLAG_TYPEOFARG); |
| 86572 | VdbeComment((v, "first_entry_in(%d)", iCur)); |
| 86573 | sqlite3VdbeJumpHere(v, addr1); |
| 86574 | } |
| 86575 | |
| 86576 | |
| 86577 | #ifndef SQLITE_OMIT_SUBQUERY |
| 86578 | /* |
| @@ -87168,24 +87168,24 @@ | |
| 87168 | }else{ |
| 87169 | /* In this branch, the RHS of the IN might contain a NULL and |
| 87170 | ** the presence of a NULL on the RHS makes a difference in the |
| 87171 | ** outcome. |
| 87172 | */ |
| 87173 | int addr1; |
| 87174 | |
| 87175 | /* First check to see if the LHS is contained in the RHS. If so, |
| 87176 | ** then the answer is TRUE the presence of NULLs in the RHS does |
| 87177 | ** not matter. If the LHS is not contained in the RHS, then the |
| 87178 | ** answer is NULL if the RHS contains NULLs and the answer is |
| 87179 | ** FALSE if the RHS is NULL-free. |
| 87180 | */ |
| 87181 | addr1 = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0, r1, 1); |
| 87182 | VdbeCoverage(v); |
| 87183 | sqlite3VdbeAddOp2(v, OP_IsNull, rRhsHasNull, destIfNull); |
| 87184 | VdbeCoverage(v); |
| 87185 | sqlite3VdbeGoto(v, destIfFalse); |
| 87186 | sqlite3VdbeJumpHere(v, addr1); |
| 87187 | } |
| 87188 | } |
| 87189 | } |
| 87190 | sqlite3ReleaseTempReg(pParse, r1); |
| 87191 | sqlite3ExprCachePop(pParse); |
| @@ -89772,18 +89772,18 @@ | |
| 89772 | ** If that allocation failed, we would have quit before reaching this |
| 89773 | ** point */ |
| 89774 | if( ALWAYS(v) ){ |
| 89775 | int r1 = sqlite3GetTempReg(pParse); |
| 89776 | int r2 = sqlite3GetTempReg(pParse); |
| 89777 | int addr1; |
| 89778 | sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT); |
| 89779 | sqlite3VdbeUsesBtree(v, iDb); |
| 89780 | sqlite3VdbeAddOp2(v, OP_Integer, minFormat, r2); |
| 89781 | addr1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1); |
| 89782 | sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); VdbeCoverage(v); |
| 89783 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, r2); |
| 89784 | sqlite3VdbeJumpHere(v, addr1); |
| 89785 | sqlite3ReleaseTempReg(pParse, r1); |
| 89786 | sqlite3ReleaseTempReg(pParse, r2); |
| 89787 | } |
| 89788 | } |
| 89789 | |
| @@ -93734,11 +93734,11 @@ | |
| 93734 | ** indices to be created and the table record must come before the |
| 93735 | ** indices. Hence, the record number for the table must be allocated |
| 93736 | ** now. |
| 93737 | */ |
| 93738 | if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
| 93739 | int addr1; |
| 93740 | int fileFormat; |
| 93741 | int reg1, reg2, reg3; |
| 93742 | /* nullRow[] is an OP_Record encoding of a row containing 5 NULLs */ |
| 93743 | static const char nullRow[] = { 6, 0, 0, 0, 0, 0 }; |
| 93744 | sqlite3BeginWriteOperation(pParse, 1, iDb); |
| @@ -93755,18 +93755,18 @@ | |
| 93755 | reg1 = pParse->regRowid = ++pParse->nMem; |
| 93756 | reg2 = pParse->regRoot = ++pParse->nMem; |
| 93757 | reg3 = ++pParse->nMem; |
| 93758 | sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT); |
| 93759 | sqlite3VdbeUsesBtree(v, iDb); |
| 93760 | addr1 = sqlite3VdbeAddOp1(v, OP_If, reg3); VdbeCoverage(v); |
| 93761 | fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ? |
| 93762 | 1 : SQLITE_MAX_FILE_FORMAT; |
| 93763 | sqlite3VdbeAddOp2(v, OP_Integer, fileFormat, reg3); |
| 93764 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, reg3); |
| 93765 | sqlite3VdbeAddOp2(v, OP_Integer, ENC(db), reg3); |
| 93766 | sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_TEXT_ENCODING, reg3); |
| 93767 | sqlite3VdbeJumpHere(v, addr1); |
| 93768 | |
| 93769 | /* This just creates a place-holder record in the sqlite_master table. |
| 93770 | ** The record created does not contain anything yet. It will be replaced |
| 93771 | ** by the real entry in code generated at sqlite3EndTable(). |
| 93772 | ** |
| @@ -102081,20 +102081,20 @@ | |
| 102081 | sqlite3 *db = pParse->db; |
| 102082 | |
| 102083 | assert( v ); |
| 102084 | for(p = pParse->pAinc; p; p = p->pNext){ |
| 102085 | Db *pDb = &db->aDb[p->iDb]; |
| 102086 | int addr1; |
| 102087 | int iRec; |
| 102088 | int memId = p->regCtr; |
| 102089 | |
| 102090 | iRec = sqlite3GetTempReg(pParse); |
| 102091 | assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) ); |
| 102092 | sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite); |
| 102093 | addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, memId+1); VdbeCoverage(v); |
| 102094 | sqlite3VdbeAddOp2(v, OP_NewRowid, 0, memId+1); |
| 102095 | sqlite3VdbeJumpHere(v, addr1); |
| 102096 | sqlite3VdbeAddOp3(v, OP_MakeRecord, memId-1, 2, iRec); |
| 102097 | sqlite3VdbeAddOp3(v, OP_Insert, 0, iRec, memId+1); |
| 102098 | sqlite3VdbeChangeP5(v, OPFLAG_APPEND); |
| 102099 | sqlite3VdbeAddOp0(v, OP_Close); |
| 102100 | sqlite3ReleaseTempReg(pParse, iRec); |
| @@ -102582,21 +102582,21 @@ | |
| 102582 | ** not happened yet) so we substitute a rowid of -1 |
| 102583 | */ |
| 102584 | if( ipkColumn<0 ){ |
| 102585 | sqlite3VdbeAddOp2(v, OP_Integer, -1, regCols); |
| 102586 | }else{ |
| 102587 | int addr1; |
| 102588 | assert( !withoutRowid ); |
| 102589 | if( useTempTable ){ |
| 102590 | sqlite3VdbeAddOp3(v, OP_Column, srcTab, ipkColumn, regCols); |
| 102591 | }else{ |
| 102592 | assert( pSelect==0 ); /* Otherwise useTempTable is true */ |
| 102593 | sqlite3ExprCode(pParse, pList->a[ipkColumn].pExpr, regCols); |
| 102594 | } |
| 102595 | addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regCols); VdbeCoverage(v); |
| 102596 | sqlite3VdbeAddOp2(v, OP_Integer, -1, regCols); |
| 102597 | sqlite3VdbeJumpHere(v, addr1); |
| 102598 | sqlite3VdbeAddOp1(v, OP_MustBeInt, regCols); VdbeCoverage(v); |
| 102599 | } |
| 102600 | |
| 102601 | /* Cannot have triggers on a virtual table. If it were possible, |
| 102602 | ** this block would have to account for hidden column. |
| @@ -102666,18 +102666,18 @@ | |
| 102666 | } |
| 102667 | /* If the PRIMARY KEY expression is NULL, then use OP_NewRowid |
| 102668 | ** to generate a unique primary key value. |
| 102669 | */ |
| 102670 | if( !appendFlag ){ |
| 102671 | int addr1; |
| 102672 | if( !IsVirtual(pTab) ){ |
| 102673 | addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regRowid); VdbeCoverage(v); |
| 102674 | sqlite3VdbeAddOp3(v, OP_NewRowid, iDataCur, regRowid, regAutoinc); |
| 102675 | sqlite3VdbeJumpHere(v, addr1); |
| 102676 | }else{ |
| 102677 | addr1 = sqlite3VdbeCurrentAddr(v); |
| 102678 | sqlite3VdbeAddOp2(v, OP_IsNull, regRowid, addr1+2); VdbeCoverage(v); |
| 102679 | } |
| 102680 | sqlite3VdbeAddOp1(v, OP_MustBeInt, regRowid); VdbeCoverage(v); |
| 102681 | } |
| 102682 | }else if( IsVirtual(pTab) || withoutRowid ){ |
| 102683 | sqlite3VdbeAddOp2(v, OP_Null, 0, regRowid); |
| @@ -102927,11 +102927,11 @@ | |
| 102927 | sqlite3 *db; /* Database connection */ |
| 102928 | int i; /* loop counter */ |
| 102929 | int ix; /* Index loop counter */ |
| 102930 | int nCol; /* Number of columns */ |
| 102931 | int onError; /* Conflict resolution strategy */ |
| 102932 | int addr1; /* Address of jump instruction */ |
| 102933 | int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ |
| 102934 | int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */ |
| 102935 | int ipkTop = 0; /* Top of the rowid change constraint check */ |
| 102936 | int ipkBottom = 0; /* Bottom of the rowid change constraint check */ |
| 102937 | u8 isUpdate; /* True if this is an UPDATE operation */ |
| @@ -102998,13 +102998,14 @@ | |
| 102998 | VdbeCoverage(v); |
| 102999 | break; |
| 103000 | } |
| 103001 | default: { |
| 103002 | assert( onError==OE_Replace ); |
| 103003 | addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regNewData+1+i); |
| 103004 | VdbeCoverage(v); |
| 103005 | sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+i); |
| 103006 | sqlite3VdbeJumpHere(v, addr1); |
| 103007 | break; |
| 103008 | } |
| 103009 | } |
| 103010 | } |
| 103011 | |
| @@ -105163,11 +105164,11 @@ | |
| 105164 | ** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 105165 | ** code if regular extension loading is not available. This is that |
| 105166 | ** dummy pointer. |
| 105167 | */ |
| 105168 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 105169 | static const sqlite3_api_routines sqlite3Apis; |
| 105170 | #endif |
| 105171 | |
| 105172 | |
| 105173 | /* |
| 105174 | ** The following object holds the list of automatically loaded |
| @@ -111198,16 +111199,16 @@ | |
| 111199 | iContinue = sqlite3VdbeMakeLabel(v); |
| 111200 | |
| 111201 | /* Suppress duplicates for UNION, EXCEPT, and INTERSECT |
| 111202 | */ |
| 111203 | if( regPrev ){ |
| 111204 | int addr1, addr2; |
| 111205 | addr1 = sqlite3VdbeAddOp1(v, OP_IfNot, regPrev); VdbeCoverage(v); |
| 111206 | addr2 = sqlite3VdbeAddOp4(v, OP_Compare, pIn->iSdst, regPrev+1, pIn->nSdst, |
| 111207 | (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); |
| 111208 | sqlite3VdbeAddOp3(v, OP_Jump, addr2+2, iContinue, addr2+2); VdbeCoverage(v); |
| 111209 | sqlite3VdbeJumpHere(v, addr1); |
| 111210 | sqlite3VdbeAddOp3(v, OP_Copy, pIn->iSdst, regPrev+1, pIn->nSdst-1); |
| 111211 | sqlite3VdbeAddOp2(v, OP_Integer, 1, regPrev); |
| 111212 | } |
| 111213 | if( pParse->db->mallocFailed ) return 0; |
| 111214 | |
| @@ -111420,11 +111421,11 @@ | |
| 111421 | int regPrev; /* A range of registers to hold previous output */ |
| 111422 | int savedLimit; /* Saved value of p->iLimit */ |
| 111423 | int savedOffset; /* Saved value of p->iOffset */ |
| 111424 | int labelCmpr; /* Label for the start of the merge algorithm */ |
| 111425 | int labelEnd; /* Label for the end of the overall SELECT stmt */ |
| 111426 | int addr1; /* Jump instructions that get retargetted */ |
| 111427 | int op; /* One of TK_ALL, TK_UNION, TK_EXCEPT, TK_INTERSECT */ |
| 111428 | KeyInfo *pKeyDup = 0; /* Comparison information for duplicate removal */ |
| 111429 | KeyInfo *pKeyMerge; /* Comparison information for merging rows */ |
| 111430 | sqlite3 *db; /* Database connection */ |
| 111431 | ExprList *pOrderBy; /* The ORDER BY clause */ |
| @@ -111556,23 +111557,23 @@ | |
| 111557 | |
| 111558 | /* Generate a coroutine to evaluate the SELECT statement to the |
| 111559 | ** left of the compound operator - the "A" select. |
| 111560 | */ |
| 111561 | addrSelectA = sqlite3VdbeCurrentAddr(v) + 1; |
| 111562 | addr1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrA, 0, addrSelectA); |
| 111563 | VdbeComment((v, "left SELECT")); |
| 111564 | pPrior->iLimit = regLimitA; |
| 111565 | explainSetInteger(iSub1, pParse->iNextSelectId); |
| 111566 | sqlite3Select(pParse, pPrior, &destA); |
| 111567 | sqlite3VdbeAddOp1(v, OP_EndCoroutine, regAddrA); |
| 111568 | sqlite3VdbeJumpHere(v, addr1); |
| 111569 | |
| 111570 | /* Generate a coroutine to evaluate the SELECT statement on |
| 111571 | ** the right - the "B" select |
| 111572 | */ |
| 111573 | addrSelectB = sqlite3VdbeCurrentAddr(v) + 1; |
| 111574 | addr1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrB, 0, addrSelectB); |
| 111575 | VdbeComment((v, "right SELECT")); |
| 111576 | savedLimit = p->iLimit; |
| 111577 | savedOffset = p->iOffset; |
| 111578 | p->iLimit = regLimitB; |
| 111579 | p->iOffset = 0; |
| @@ -111659,11 +111660,11 @@ | |
| 111660 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v); |
| 111661 | sqlite3VdbeGoto(v, labelCmpr); |
| 111662 | |
| 111663 | /* This code runs once to initialize everything. |
| 111664 | */ |
| 111665 | sqlite3VdbeJumpHere(v, addr1); |
| 111666 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, addrEofA_noB); VdbeCoverage(v); |
| 111667 | sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v); |
| 111668 | |
| 111669 | /* Implement the main merge loop |
| 111670 | */ |
| @@ -113833,11 +113834,11 @@ | |
| 113834 | /* Processing for aggregates with GROUP BY is very different and |
| 113835 | ** much more complex than aggregates without a GROUP BY. |
| 113836 | */ |
| 113837 | if( pGroupBy ){ |
| 113838 | KeyInfo *pKeyInfo; /* Keying information for the group by clause */ |
| 113839 | int addr1; /* A-vs-B comparision jump */ |
| 113840 | int addrOutputRow; /* Start of subroutine that outputs a result row */ |
| 113841 | int regOutputRow; /* Return address register for output subroutine */ |
| 113842 | int addrSetAbort; /* Set the abort flag and return */ |
| 113843 | int addrTopOfLoop; /* Top of the input loop */ |
| 113844 | int addrSortingIdx; /* The OP_OpenEphemeral for the sorting index */ |
| @@ -113981,12 +113982,12 @@ | |
| 113982 | sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); |
| 113983 | } |
| 113984 | } |
| 113985 | sqlite3VdbeAddOp4(v, OP_Compare, iAMem, iBMem, pGroupBy->nExpr, |
| 113986 | (char*)sqlite3KeyInfoRef(pKeyInfo), P4_KEYINFO); |
| 113987 | addr1 = sqlite3VdbeCurrentAddr(v); |
| 113988 | sqlite3VdbeAddOp3(v, OP_Jump, addr1+1, 0, addr1+1); VdbeCoverage(v); |
| 113989 | |
| 113990 | /* Generate code that runs whenever the GROUP BY changes. |
| 113991 | ** Changes in the GROUP BY are detected by the previous code |
| 113992 | ** block. If there were no changes, this block is skipped. |
| 113993 | ** |
| @@ -114004,11 +114005,11 @@ | |
| 114005 | VdbeComment((v, "reset accumulator")); |
| 114006 | |
| 114007 | /* Update the aggregate accumulators based on the content of |
| 114008 | ** the current row |
| 114009 | */ |
| 114010 | sqlite3VdbeJumpHere(v, addr1); |
| 114011 | updateAccumulator(pParse, &sAggInfo); |
| 114012 | sqlite3VdbeAddOp2(v, OP_Integer, 1, iUseFlag); |
| 114013 | VdbeComment((v, "indicate data in accumulator")); |
| 114014 | |
| 114015 | /* End of the loop |
| @@ -116133,11 +116134,11 @@ | |
| 116134 | } |
| 116135 | } |
| 116136 | } |
| 116137 | |
| 116138 | if( !isView ){ |
| 116139 | int addr1 = 0; /* Address of jump instruction */ |
| 116140 | int bReplace = 0; /* True if REPLACE conflict resolution might happen */ |
| 116141 | |
| 116142 | /* Do constraint checks. */ |
| 116143 | assert( regOldRowid>0 ); |
| 116144 | sqlite3GenerateConstraintChecks(pParse, pTab, aRegIdx, iDataCur, iIdxCur, |
| @@ -116149,13 +116150,13 @@ | |
| 116150 | } |
| 116151 | |
| 116152 | /* Delete the index entries associated with the current record. */ |
| 116153 | if( bReplace || chngKey ){ |
| 116154 | if( pPk ){ |
| 116155 | addr1 = sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, 0, regKey, nKey); |
| 116156 | }else{ |
| 116157 | addr1 = sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, 0, regOldRowid); |
| 116158 | } |
| 116159 | VdbeCoverageNeverTaken(v); |
| 116160 | } |
| 116161 | sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, aRegIdx, -1); |
| 116162 | |
| @@ -116162,11 +116163,11 @@ | |
| 116163 | /* If changing the record number, delete the old record. */ |
| 116164 | if( hasFK || chngKey || pPk!=0 ){ |
| 116165 | sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0); |
| 116166 | } |
| 116167 | if( bReplace || chngKey ){ |
| 116168 | sqlite3VdbeJumpHere(v, addr1); |
| 116169 | } |
| 116170 | |
| 116171 | if( hasFK ){ |
| 116172 | sqlite3FkCheck(pParse, pTab, 0, regNewRowid, aXRef, chngKey); |
| 116173 | } |
| @@ -119772,11 +119773,11 @@ | |
| 119773 | for(ii=0; ii<pOrWc->nTerm; ii++){ |
| 119774 | WhereTerm *pOrTerm = &pOrWc->a[ii]; |
| 119775 | if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
| 119776 | WhereInfo *pSubWInfo; /* Info for single OR-term scan */ |
| 119777 | Expr *pOrExpr = pOrTerm->pExpr; /* Current OR clause term */ |
| 119778 | int jmp1 = 0; /* Address of jump operation */ |
| 119779 | if( pAndExpr && !ExprHasProperty(pOrExpr, EP_FromJoin) ){ |
| 119780 | pAndExpr->pLeft = pOrExpr; |
| 119781 | pOrExpr = pAndExpr; |
| 119782 | } |
| 119783 | /* Loop through table entries that match term pOrTerm. */ |
| @@ -119799,11 +119800,12 @@ | |
| 119800 | if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
| 119801 | int r; |
| 119802 | int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); |
| 119803 | if( HasRowid(pTab) ){ |
| 119804 | r = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, regRowid, 0); |
| 119805 | jmp1 = sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, 0, |
| 119806 | r,iSet); |
| 119807 | VdbeCoverage(v); |
| 119808 | }else{ |
| 119809 | Index *pPk = sqlite3PrimaryKeyIndex(pTab); |
| 119810 | int nPk = pPk->nKeyCol; |
| 119811 | int iPk; |
| @@ -119829,11 +119831,11 @@ | |
| 119831 | ** is zero, assume that the key cannot already be present in |
| 119832 | ** the temp table. And if iSet is -1, assume that there is no |
| 119833 | ** need to insert the key into the temp table, as it will never |
| 119834 | ** be tested for. */ |
| 119835 | if( iSet ){ |
| 119836 | jmp1 = sqlite3VdbeAddOp4Int(v, OP_Found, regRowset, 0, r, nPk); |
| 119837 | VdbeCoverage(v); |
| 119838 | } |
| 119839 | if( iSet>=0 ){ |
| 119840 | sqlite3VdbeAddOp3(v, OP_MakeRecord, r, nPk, regRowid); |
| 119841 | sqlite3VdbeAddOp3(v, OP_IdxInsert, regRowset, regRowid, 0); |
| @@ -119848,11 +119850,11 @@ | |
| 119850 | /* Invoke the main loop body as a subroutine */ |
| 119851 | sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); |
| 119852 | |
| 119853 | /* Jump here (skipping the main loop body subroutine) if the |
| 119854 | ** current sub-WHERE row is a duplicate from prior sub-WHEREs. */ |
| 119855 | if( jmp1 ) sqlite3VdbeJumpHere(v, jmp1); |
| 119856 | |
| 119857 | /* The pSubWInfo->untestedTerms flag means that this OR term |
| 119858 | ** contained one or more AND term from a notReady table. The |
| 119859 | ** terms from the notReady table could not be tested and will |
| 119860 | ** need to be tested later. |
| @@ -180360,18 +180362,20 @@ | |
| 180362 | ){ |
| 180363 | Fts5Global *pGlobal = (Fts5Global*)pApi; |
| 180364 | int rc = sqlite3_overload_function(pGlobal->db, zName, -1); |
| 180365 | if( rc==SQLITE_OK ){ |
| 180366 | Fts5Auxiliary *pAux; |
| 180367 | int nName; /* Size of zName in bytes, including \0 */ |
| 180368 | int nByte; /* Bytes of space to allocate */ |
| 180369 | |
| 180370 | nName = (int)strlen(zName) + 1; |
| 180371 | nByte = sizeof(Fts5Auxiliary) + nName; |
| 180372 | pAux = (Fts5Auxiliary*)sqlite3_malloc(nByte); |
| 180373 | if( pAux ){ |
| 180374 | memset(pAux, 0, nByte); |
| 180375 | pAux->zFunc = (char*)&pAux[1]; |
| 180376 | memcpy(pAux->zFunc, zName, nName); |
| 180377 | pAux->pGlobal = pGlobal; |
| 180378 | pAux->pUserData = pUserData; |
| 180379 | pAux->xFunc = xFunc; |
| 180380 | pAux->xDestroy = xDestroy; |
| 180381 | pAux->pNext = pGlobal->pAux; |
| @@ -180535,11 +180539,11 @@ | |
| 180539 | sqlite3_context *pCtx, /* Function call context */ |
| 180540 | int nArg, /* Number of args */ |
| 180541 | sqlite3_value **apVal /* Function arguments */ |
| 180542 | ){ |
| 180543 | assert( nArg==0 ); |
| 180544 | sqlite3_result_text(pCtx, "fts5: 2015-10-10 15:11:49 bc24a5bbfd95df3518611b221de69b73776111bc", -1, SQLITE_TRANSIENT); |
| 180545 | } |
| 180546 | |
| 180547 | static int fts5Init(sqlite3 *db){ |
| 180548 | static const sqlite3_module fts5Mod = { |
| 180549 | /* iVersion */ 2, |
| @@ -180639,11 +180643,10 @@ | |
| 180643 | #else |
| 180644 | SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3 *db){ |
| 180645 | return fts5Init(db); |
| 180646 | } |
| 180647 | #endif |
| 180648 | |
| 180649 | /* |
| 180650 | ** 2014 May 31 |
| 180651 | ** |
| 180652 | ** The author disclaims copyright to this source code. In place of |
| 180653 |
+1
-1
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -111,11 +111,11 @@ | ||
| 111 | 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | 113 | */ |
| 114 | 114 | #define SQLITE_VERSION "3.9.0" |
| 115 | 115 | #define SQLITE_VERSION_NUMBER 3009000 |
| 116 | -#define SQLITE_SOURCE_ID "2015-10-10 14:00:37 de28acd42f29693341feb884b7223cd3d2b96730" | |
| 116 | +#define SQLITE_SOURCE_ID "2015-10-10 15:11:49 bc24a5bbfd95df3518611b221de69b73776111bc" | |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | 121 | ** |
| 122 | 122 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -111,11 +111,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.9.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3009000 |
| 116 | #define SQLITE_SOURCE_ID "2015-10-10 14:00:37 de28acd42f29693341feb884b7223cd3d2b96730" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| 122 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -111,11 +111,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.9.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3009000 |
| 116 | #define SQLITE_SOURCE_ID "2015-10-10 15:11:49 bc24a5bbfd95df3518611b221de69b73776111bc" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| 122 |