Fossil SCM

Update the built-in SQLite to version 3.9.2

jan.nijtmans 2015-11-03 22:09 trunk
Commit aa92270fe96d4923307f68f7e0743739042eebf3
2 files changed +58 -38 +3 -3
+58 -38
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.9.1. By combining all the individual C code files into this
3
+** version 3.9.2. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -323,13 +323,13 @@
323323
**
324324
** See also: [sqlite3_libversion()],
325325
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
326326
** [sqlite_version()] and [sqlite_source_id()].
327327
*/
328
-#define SQLITE_VERSION "3.9.1"
329
-#define SQLITE_VERSION_NUMBER 3009001
330
-#define SQLITE_SOURCE_ID "2015-10-16 17:31:12 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02"
328
+#define SQLITE_VERSION "3.9.2"
329
+#define SQLITE_VERSION_NUMBER 3009002
330
+#define SQLITE_SOURCE_ID "2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328"
331331
332332
/*
333333
** CAPI3REF: Run-Time Library Version Numbers
334334
** KEYWORDS: sqlite3_version, sqlite3_sourceid
335335
**
@@ -94032,10 +94032,34 @@
9403294032
(int)(pSpan->zEnd - pSpan->zStart));
9403394033
}
9403494034
}
9403594035
sqlite3ExprDelete(db, pSpan->pExpr);
9403694036
}
94037
+
94038
+/*
94039
+** Backwards Compatibility Hack:
94040
+**
94041
+** Historical versions of SQLite accepted strings as column names in
94042
+** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
94043
+**
94044
+** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
94045
+** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
94046
+**
94047
+** This is goofy. But to preserve backwards compatibility we continue to
94048
+** accept it. This routine does the necessary conversion. It converts
94049
+** the expression given in its argument from a TK_STRING into a TK_ID
94050
+** if the expression is just a TK_STRING with an optional COLLATE clause.
94051
+** If the epxression is anything other than TK_STRING, the expression is
94052
+** unchanged.
94053
+*/
94054
+static void sqlite3StringToId(Expr *p){
94055
+ if( p->op==TK_STRING ){
94056
+ p->op = TK_ID;
94057
+ }else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){
94058
+ p->pLeft->op = TK_ID;
94059
+ }
94060
+}
9403794061
9403894062
/*
9403994063
** Designate the PRIMARY KEY for the table. pList is a list of names
9404094064
** of columns that form the primary key. If pList is NULL, then the
9404194065
** most recently added column of the table is the primary key.
@@ -94079,10 +94103,11 @@
9407994103
}else{
9408094104
nTerm = pList->nExpr;
9408194105
for(i=0; i<nTerm; i++){
9408294106
Expr *pCExpr = sqlite3ExprSkipCollate(pList->a[i].pExpr);
9408394107
assert( pCExpr!=0 );
94108
+ sqlite3StringToId(pCExpr);
9408494109
if( pCExpr->op==TK_ID ){
9408594110
const char *zCName = pCExpr->u.zToken;
9408694111
for(iCol=0; iCol<pTab->nCol; iCol++){
9408794112
if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zName)==0 ){
9408894113
pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY;
@@ -95617,34 +95642,10 @@
9561795642
*ppExtra = ((char*)p) + nByte;
9561895643
}
9561995644
return p;
9562095645
}
9562195646
95622
-/*
95623
-** Backwards Compatibility Hack:
95624
-**
95625
-** Historical versions of SQLite accepted strings as column names in
95626
-** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
95627
-**
95628
-** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
95629
-** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
95630
-**
95631
-** This is goofy. But to preserve backwards compatibility we continue to
95632
-** accept it. This routine does the necessary conversion. It converts
95633
-** the expression given in its argument from a TK_STRING into a TK_ID
95634
-** if the expression is just a TK_STRING with an optional COLLATE clause.
95635
-** If the epxression is anything other than TK_STRING, the expression is
95636
-** unchanged.
95637
-*/
95638
-static void sqlite3StringToId(Expr *p){
95639
- if( p->op==TK_STRING ){
95640
- p->op = TK_ID;
95641
- }else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){
95642
- p->pLeft->op = TK_ID;
95643
- }
95644
-}
95645
-
9564695647
/*
9564795648
** Create a new index for an SQL table. pName1.pName2 is the name of the index
9564895649
** and pTblList is the name of the table that is to be indexed. Both will
9564995650
** be NULL for a primary key or an index that is created to satisfy a
9565095651
** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
@@ -121856,18 +121857,24 @@
121856121857
121857121858
/*
121858121859
** Convert OP_Column opcodes to OP_Copy in previously generated code.
121859121860
**
121860121861
** This routine runs over generated VDBE code and translates OP_Column
121861
-** opcodes into OP_Copy, and OP_Rowid into OP_Null, when the table is being
121862
-** accessed via co-routine instead of via table lookup.
121862
+** opcodes into OP_Copy when the table is being accessed via co-routine
121863
+** instead of via table lookup.
121864
+**
121865
+** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
121866
+** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
121867
+** then each OP_Rowid is transformed into an instruction to increment the
121868
+** value stored in its output register.
121863121869
*/
121864121870
static void translateColumnToCopy(
121865121871
Vdbe *v, /* The VDBE containing code to translate */
121866121872
int iStart, /* Translate from this opcode to the end */
121867121873
int iTabCur, /* OP_Column/OP_Rowid references to this table */
121868
- int iRegister /* The first column is in this register */
121874
+ int iRegister, /* The first column is in this register */
121875
+ int bIncrRowid /* If non-zero, transform OP_rowid to OP_AddImm(1) */
121869121876
){
121870121877
VdbeOp *pOp = sqlite3VdbeGetOp(v, iStart);
121871121878
int iEnd = sqlite3VdbeCurrentAddr(v);
121872121879
for(; iStart<iEnd; iStart++, pOp++){
121873121880
if( pOp->p1!=iTabCur ) continue;
@@ -121875,13 +121882,20 @@
121875121882
pOp->opcode = OP_Copy;
121876121883
pOp->p1 = pOp->p2 + iRegister;
121877121884
pOp->p2 = pOp->p3;
121878121885
pOp->p3 = 0;
121879121886
}else if( pOp->opcode==OP_Rowid ){
121880
- pOp->opcode = OP_Null;
121881
- pOp->p1 = 0;
121882
- pOp->p3 = 0;
121887
+ if( bIncrRowid ){
121888
+ /* Increment the value stored in the P2 operand of the OP_Rowid. */
121889
+ pOp->opcode = OP_AddImm;
121890
+ pOp->p1 = pOp->p2;
121891
+ pOp->p2 = 1;
121892
+ }else{
121893
+ pOp->opcode = OP_Null;
121894
+ pOp->p1 = 0;
121895
+ pOp->p3 = 0;
121896
+ }
121883121897
}
121884121898
}
121885121899
}
121886121900
121887121901
/*
@@ -121985,10 +121999,12 @@
121985121999
Bitmask extraCols; /* Bitmap of additional columns */
121986122000
u8 sentWarning = 0; /* True if a warnning has been issued */
121987122001
Expr *pPartial = 0; /* Partial Index Expression */
121988122002
int iContinue = 0; /* Jump here to skip excluded rows */
121989122003
struct SrcList_item *pTabItem; /* FROM clause term being indexed */
122004
+ int addrCounter; /* Address where integer counter is initialized */
122005
+ int regBase; /* Array of registers where record is assembled */
121990122006
121991122007
/* Generate code to skip over the creation and initialization of the
121992122008
** transient index on 2nd and subsequent iterations of the loop. */
121993122009
v = pParse->pVdbe;
121994122010
assert( v!=0 );
@@ -122113,10 +122129,11 @@
122113122129
/* Fill the automatic index with content */
122114122130
sqlite3ExprCachePush(pParse);
122115122131
pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom];
122116122132
if( pTabItem->fg.viaCoroutine ){
122117122133
int regYield = pTabItem->regReturn;
122134
+ addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0);
122118122135
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
122119122136
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
122120122137
VdbeCoverage(v);
122121122138
VdbeComment((v, "next row of \"%s\"", pTabItem->pTab->zName));
122122122139
}else{
@@ -122126,16 +122143,19 @@
122126122143
iContinue = sqlite3VdbeMakeLabel(v);
122127122144
sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL);
122128122145
pLoop->wsFlags |= WHERE_PARTIALIDX;
122129122146
}
122130122147
regRecord = sqlite3GetTempReg(pParse);
122131
- sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0);
122148
+ regBase = sqlite3GenerateIndexKey(
122149
+ pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0
122150
+ );
122132122151
sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
122133122152
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
122134122153
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
122135122154
if( pTabItem->fg.viaCoroutine ){
122136
- translateColumnToCopy(v, addrTop, pLevel->iTabCur, pTabItem->regResult);
122155
+ sqlite3VdbeChangeP2(v, addrCounter, regBase+n);
122156
+ translateColumnToCopy(v, addrTop, pLevel->iTabCur, pTabItem->regResult, 1);
122137122157
sqlite3VdbeGoto(v, addrTop);
122138122158
pTabItem->fg.viaCoroutine = 0;
122139122159
}else{
122140122160
sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v);
122141122161
}
@@ -125880,11 +125900,11 @@
125880125900
** the co-routine into OP_Copy of result contained in a register.
125881125901
** OP_Rowid becomes OP_Null.
125882125902
*/
125883125903
if( pTabItem->fg.viaCoroutine && !db->mallocFailed ){
125884125904
translateColumnToCopy(v, pLevel->addrBody, pLevel->iTabCur,
125885
- pTabItem->regResult);
125905
+ pTabItem->regResult, 0);
125886125906
continue;
125887125907
}
125888125908
125889125909
/* Close all of the cursors that were opened by sqlite3WhereBegin.
125890125910
** Except, do not close cursors that will be reused by the OR optimization
@@ -180580,11 +180600,11 @@
180580180600
sqlite3_context *pCtx, /* Function call context */
180581180601
int nArg, /* Number of args */
180582180602
sqlite3_value **apVal /* Function arguments */
180583180603
){
180584180604
assert( nArg==0 );
180585
- sqlite3_result_text(pCtx, "fts5: 2015-10-16 17:31:12 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02", -1, SQLITE_TRANSIENT);
180605
+ sqlite3_result_text(pCtx, "fts5: 2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328", -1, SQLITE_TRANSIENT);
180586180606
}
180587180607
180588180608
static int fts5Init(sqlite3 *db){
180589180609
static const sqlite3_module fts5Mod = {
180590180610
/* iVersion */ 2,
180591180611
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.9.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -323,13 +323,13 @@
323 **
324 ** See also: [sqlite3_libversion()],
325 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
326 ** [sqlite_version()] and [sqlite_source_id()].
327 */
328 #define SQLITE_VERSION "3.9.1"
329 #define SQLITE_VERSION_NUMBER 3009001
330 #define SQLITE_SOURCE_ID "2015-10-16 17:31:12 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02"
331
332 /*
333 ** CAPI3REF: Run-Time Library Version Numbers
334 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
335 **
@@ -94032,10 +94032,34 @@
94032 (int)(pSpan->zEnd - pSpan->zStart));
94033 }
94034 }
94035 sqlite3ExprDelete(db, pSpan->pExpr);
94036 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94037
94038 /*
94039 ** Designate the PRIMARY KEY for the table. pList is a list of names
94040 ** of columns that form the primary key. If pList is NULL, then the
94041 ** most recently added column of the table is the primary key.
@@ -94079,10 +94103,11 @@
94079 }else{
94080 nTerm = pList->nExpr;
94081 for(i=0; i<nTerm; i++){
94082 Expr *pCExpr = sqlite3ExprSkipCollate(pList->a[i].pExpr);
94083 assert( pCExpr!=0 );
 
94084 if( pCExpr->op==TK_ID ){
94085 const char *zCName = pCExpr->u.zToken;
94086 for(iCol=0; iCol<pTab->nCol; iCol++){
94087 if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zName)==0 ){
94088 pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY;
@@ -95617,34 +95642,10 @@
95617 *ppExtra = ((char*)p) + nByte;
95618 }
95619 return p;
95620 }
95621
95622 /*
95623 ** Backwards Compatibility Hack:
95624 **
95625 ** Historical versions of SQLite accepted strings as column names in
95626 ** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
95627 **
95628 ** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
95629 ** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
95630 **
95631 ** This is goofy. But to preserve backwards compatibility we continue to
95632 ** accept it. This routine does the necessary conversion. It converts
95633 ** the expression given in its argument from a TK_STRING into a TK_ID
95634 ** if the expression is just a TK_STRING with an optional COLLATE clause.
95635 ** If the epxression is anything other than TK_STRING, the expression is
95636 ** unchanged.
95637 */
95638 static void sqlite3StringToId(Expr *p){
95639 if( p->op==TK_STRING ){
95640 p->op = TK_ID;
95641 }else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){
95642 p->pLeft->op = TK_ID;
95643 }
95644 }
95645
95646 /*
95647 ** Create a new index for an SQL table. pName1.pName2 is the name of the index
95648 ** and pTblList is the name of the table that is to be indexed. Both will
95649 ** be NULL for a primary key or an index that is created to satisfy a
95650 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
@@ -121856,18 +121857,24 @@
121856
121857 /*
121858 ** Convert OP_Column opcodes to OP_Copy in previously generated code.
121859 **
121860 ** This routine runs over generated VDBE code and translates OP_Column
121861 ** opcodes into OP_Copy, and OP_Rowid into OP_Null, when the table is being
121862 ** accessed via co-routine instead of via table lookup.
 
 
 
 
 
121863 */
121864 static void translateColumnToCopy(
121865 Vdbe *v, /* The VDBE containing code to translate */
121866 int iStart, /* Translate from this opcode to the end */
121867 int iTabCur, /* OP_Column/OP_Rowid references to this table */
121868 int iRegister /* The first column is in this register */
 
121869 ){
121870 VdbeOp *pOp = sqlite3VdbeGetOp(v, iStart);
121871 int iEnd = sqlite3VdbeCurrentAddr(v);
121872 for(; iStart<iEnd; iStart++, pOp++){
121873 if( pOp->p1!=iTabCur ) continue;
@@ -121875,13 +121882,20 @@
121875 pOp->opcode = OP_Copy;
121876 pOp->p1 = pOp->p2 + iRegister;
121877 pOp->p2 = pOp->p3;
121878 pOp->p3 = 0;
121879 }else if( pOp->opcode==OP_Rowid ){
121880 pOp->opcode = OP_Null;
121881 pOp->p1 = 0;
121882 pOp->p3 = 0;
 
 
 
 
 
 
 
121883 }
121884 }
121885 }
121886
121887 /*
@@ -121985,10 +121999,12 @@
121985 Bitmask extraCols; /* Bitmap of additional columns */
121986 u8 sentWarning = 0; /* True if a warnning has been issued */
121987 Expr *pPartial = 0; /* Partial Index Expression */
121988 int iContinue = 0; /* Jump here to skip excluded rows */
121989 struct SrcList_item *pTabItem; /* FROM clause term being indexed */
 
 
121990
121991 /* Generate code to skip over the creation and initialization of the
121992 ** transient index on 2nd and subsequent iterations of the loop. */
121993 v = pParse->pVdbe;
121994 assert( v!=0 );
@@ -122113,10 +122129,11 @@
122113 /* Fill the automatic index with content */
122114 sqlite3ExprCachePush(pParse);
122115 pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom];
122116 if( pTabItem->fg.viaCoroutine ){
122117 int regYield = pTabItem->regReturn;
 
122118 sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
122119 addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
122120 VdbeCoverage(v);
122121 VdbeComment((v, "next row of \"%s\"", pTabItem->pTab->zName));
122122 }else{
@@ -122126,16 +122143,19 @@
122126 iContinue = sqlite3VdbeMakeLabel(v);
122127 sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL);
122128 pLoop->wsFlags |= WHERE_PARTIALIDX;
122129 }
122130 regRecord = sqlite3GetTempReg(pParse);
122131 sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0);
 
 
122132 sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
122133 sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
122134 if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
122135 if( pTabItem->fg.viaCoroutine ){
122136 translateColumnToCopy(v, addrTop, pLevel->iTabCur, pTabItem->regResult);
 
122137 sqlite3VdbeGoto(v, addrTop);
122138 pTabItem->fg.viaCoroutine = 0;
122139 }else{
122140 sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v);
122141 }
@@ -125880,11 +125900,11 @@
125880 ** the co-routine into OP_Copy of result contained in a register.
125881 ** OP_Rowid becomes OP_Null.
125882 */
125883 if( pTabItem->fg.viaCoroutine && !db->mallocFailed ){
125884 translateColumnToCopy(v, pLevel->addrBody, pLevel->iTabCur,
125885 pTabItem->regResult);
125886 continue;
125887 }
125888
125889 /* Close all of the cursors that were opened by sqlite3WhereBegin.
125890 ** Except, do not close cursors that will be reused by the OR optimization
@@ -180580,11 +180600,11 @@
180580 sqlite3_context *pCtx, /* Function call context */
180581 int nArg, /* Number of args */
180582 sqlite3_value **apVal /* Function arguments */
180583 ){
180584 assert( nArg==0 );
180585 sqlite3_result_text(pCtx, "fts5: 2015-10-16 17:31:12 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02", -1, SQLITE_TRANSIENT);
180586 }
180587
180588 static int fts5Init(sqlite3 *db){
180589 static const sqlite3_module fts5Mod = {
180590 /* iVersion */ 2,
180591
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.9.2. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -323,13 +323,13 @@
323 **
324 ** See also: [sqlite3_libversion()],
325 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
326 ** [sqlite_version()] and [sqlite_source_id()].
327 */
328 #define SQLITE_VERSION "3.9.2"
329 #define SQLITE_VERSION_NUMBER 3009002
330 #define SQLITE_SOURCE_ID "2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328"
331
332 /*
333 ** CAPI3REF: Run-Time Library Version Numbers
334 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
335 **
@@ -94032,10 +94032,34 @@
94032 (int)(pSpan->zEnd - pSpan->zStart));
94033 }
94034 }
94035 sqlite3ExprDelete(db, pSpan->pExpr);
94036 }
94037
94038 /*
94039 ** Backwards Compatibility Hack:
94040 **
94041 ** Historical versions of SQLite accepted strings as column names in
94042 ** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
94043 **
94044 ** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
94045 ** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
94046 **
94047 ** This is goofy. But to preserve backwards compatibility we continue to
94048 ** accept it. This routine does the necessary conversion. It converts
94049 ** the expression given in its argument from a TK_STRING into a TK_ID
94050 ** if the expression is just a TK_STRING with an optional COLLATE clause.
94051 ** If the epxression is anything other than TK_STRING, the expression is
94052 ** unchanged.
94053 */
94054 static void sqlite3StringToId(Expr *p){
94055 if( p->op==TK_STRING ){
94056 p->op = TK_ID;
94057 }else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){
94058 p->pLeft->op = TK_ID;
94059 }
94060 }
94061
94062 /*
94063 ** Designate the PRIMARY KEY for the table. pList is a list of names
94064 ** of columns that form the primary key. If pList is NULL, then the
94065 ** most recently added column of the table is the primary key.
@@ -94079,10 +94103,11 @@
94103 }else{
94104 nTerm = pList->nExpr;
94105 for(i=0; i<nTerm; i++){
94106 Expr *pCExpr = sqlite3ExprSkipCollate(pList->a[i].pExpr);
94107 assert( pCExpr!=0 );
94108 sqlite3StringToId(pCExpr);
94109 if( pCExpr->op==TK_ID ){
94110 const char *zCName = pCExpr->u.zToken;
94111 for(iCol=0; iCol<pTab->nCol; iCol++){
94112 if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zName)==0 ){
94113 pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY;
@@ -95617,34 +95642,10 @@
95642 *ppExtra = ((char*)p) + nByte;
95643 }
95644 return p;
95645 }
95646
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95647 /*
95648 ** Create a new index for an SQL table. pName1.pName2 is the name of the index
95649 ** and pTblList is the name of the table that is to be indexed. Both will
95650 ** be NULL for a primary key or an index that is created to satisfy a
95651 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
@@ -121856,18 +121857,24 @@
121857
121858 /*
121859 ** Convert OP_Column opcodes to OP_Copy in previously generated code.
121860 **
121861 ** This routine runs over generated VDBE code and translates OP_Column
121862 ** opcodes into OP_Copy when the table is being accessed via co-routine
121863 ** instead of via table lookup.
121864 **
121865 ** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
121866 ** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
121867 ** then each OP_Rowid is transformed into an instruction to increment the
121868 ** value stored in its output register.
121869 */
121870 static void translateColumnToCopy(
121871 Vdbe *v, /* The VDBE containing code to translate */
121872 int iStart, /* Translate from this opcode to the end */
121873 int iTabCur, /* OP_Column/OP_Rowid references to this table */
121874 int iRegister, /* The first column is in this register */
121875 int bIncrRowid /* If non-zero, transform OP_rowid to OP_AddImm(1) */
121876 ){
121877 VdbeOp *pOp = sqlite3VdbeGetOp(v, iStart);
121878 int iEnd = sqlite3VdbeCurrentAddr(v);
121879 for(; iStart<iEnd; iStart++, pOp++){
121880 if( pOp->p1!=iTabCur ) continue;
@@ -121875,13 +121882,20 @@
121882 pOp->opcode = OP_Copy;
121883 pOp->p1 = pOp->p2 + iRegister;
121884 pOp->p2 = pOp->p3;
121885 pOp->p3 = 0;
121886 }else if( pOp->opcode==OP_Rowid ){
121887 if( bIncrRowid ){
121888 /* Increment the value stored in the P2 operand of the OP_Rowid. */
121889 pOp->opcode = OP_AddImm;
121890 pOp->p1 = pOp->p2;
121891 pOp->p2 = 1;
121892 }else{
121893 pOp->opcode = OP_Null;
121894 pOp->p1 = 0;
121895 pOp->p3 = 0;
121896 }
121897 }
121898 }
121899 }
121900
121901 /*
@@ -121985,10 +121999,12 @@
121999 Bitmask extraCols; /* Bitmap of additional columns */
122000 u8 sentWarning = 0; /* True if a warnning has been issued */
122001 Expr *pPartial = 0; /* Partial Index Expression */
122002 int iContinue = 0; /* Jump here to skip excluded rows */
122003 struct SrcList_item *pTabItem; /* FROM clause term being indexed */
122004 int addrCounter; /* Address where integer counter is initialized */
122005 int regBase; /* Array of registers where record is assembled */
122006
122007 /* Generate code to skip over the creation and initialization of the
122008 ** transient index on 2nd and subsequent iterations of the loop. */
122009 v = pParse->pVdbe;
122010 assert( v!=0 );
@@ -122113,10 +122129,11 @@
122129 /* Fill the automatic index with content */
122130 sqlite3ExprCachePush(pParse);
122131 pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom];
122132 if( pTabItem->fg.viaCoroutine ){
122133 int regYield = pTabItem->regReturn;
122134 addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0);
122135 sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
122136 addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
122137 VdbeCoverage(v);
122138 VdbeComment((v, "next row of \"%s\"", pTabItem->pTab->zName));
122139 }else{
@@ -122126,16 +122143,19 @@
122143 iContinue = sqlite3VdbeMakeLabel(v);
122144 sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL);
122145 pLoop->wsFlags |= WHERE_PARTIALIDX;
122146 }
122147 regRecord = sqlite3GetTempReg(pParse);
122148 regBase = sqlite3GenerateIndexKey(
122149 pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0
122150 );
122151 sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
122152 sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
122153 if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
122154 if( pTabItem->fg.viaCoroutine ){
122155 sqlite3VdbeChangeP2(v, addrCounter, regBase+n);
122156 translateColumnToCopy(v, addrTop, pLevel->iTabCur, pTabItem->regResult, 1);
122157 sqlite3VdbeGoto(v, addrTop);
122158 pTabItem->fg.viaCoroutine = 0;
122159 }else{
122160 sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v);
122161 }
@@ -125880,11 +125900,11 @@
125900 ** the co-routine into OP_Copy of result contained in a register.
125901 ** OP_Rowid becomes OP_Null.
125902 */
125903 if( pTabItem->fg.viaCoroutine && !db->mallocFailed ){
125904 translateColumnToCopy(v, pLevel->addrBody, pLevel->iTabCur,
125905 pTabItem->regResult, 0);
125906 continue;
125907 }
125908
125909 /* Close all of the cursors that were opened by sqlite3WhereBegin.
125910 ** Except, do not close cursors that will be reused by the OR optimization
@@ -180580,11 +180600,11 @@
180600 sqlite3_context *pCtx, /* Function call context */
180601 int nArg, /* Number of args */
180602 sqlite3_value **apVal /* Function arguments */
180603 ){
180604 assert( nArg==0 );
180605 sqlite3_result_text(pCtx, "fts5: 2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328", -1, SQLITE_TRANSIENT);
180606 }
180607
180608 static int fts5Init(sqlite3 *db){
180609 static const sqlite3_module fts5Mod = {
180610 /* iVersion */ 2,
180611
+3 -3
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -109,13 +109,13 @@
109109
**
110110
** See also: [sqlite3_libversion()],
111111
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112112
** [sqlite_version()] and [sqlite_source_id()].
113113
*/
114
-#define SQLITE_VERSION "3.9.1"
115
-#define SQLITE_VERSION_NUMBER 3009001
116
-#define SQLITE_SOURCE_ID "2015-10-16 17:31:12 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02"
114
+#define SQLITE_VERSION "3.9.2"
115
+#define SQLITE_VERSION_NUMBER 3009002
116
+#define SQLITE_SOURCE_ID "2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328"
117117
118118
/*
119119
** CAPI3REF: Run-Time Library Version Numbers
120120
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121121
**
122122
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -109,13 +109,13 @@
109 **
110 ** See also: [sqlite3_libversion()],
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.9.1"
115 #define SQLITE_VERSION_NUMBER 3009001
116 #define SQLITE_SOURCE_ID "2015-10-16 17:31:12 767c1727fec4ce11b83f25b3f1bfcfe68a2c8b02"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
122
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -109,13 +109,13 @@
109 **
110 ** See also: [sqlite3_libversion()],
111 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112 ** [sqlite_version()] and [sqlite_source_id()].
113 */
114 #define SQLITE_VERSION "3.9.2"
115 #define SQLITE_VERSION_NUMBER 3009002
116 #define SQLITE_SOURCE_ID "2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
122

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button