Fossil SCM
Minor changes to SQLite 3.8.1 as it nears release.
Commit
93c258250b4ccf6687aeb14b97e3f1819cf822ac
Parent
0b9f725e1506d78…
2 files changed
+28
-24
+1
-1
+28
-24
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -135,11 +135,11 @@ | ||
| 135 | 135 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 136 | 136 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 137 | 137 | */ |
| 138 | 138 | #define SQLITE_VERSION "3.8.1" |
| 139 | 139 | #define SQLITE_VERSION_NUMBER 3008001 |
| 140 | -#define SQLITE_SOURCE_ID "2013-10-14 13:21:00 1660efbe46439734c7dc1674994ceb86a9b41d1a" | |
| 140 | +#define SQLITE_SOURCE_ID "2013-10-14 21:14:42 9f66dd7e3790c04f0ab724419f5381bd21f9ebad" | |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 | ** CAPI3REF: Run-Time Library Version Numbers |
| 144 | 144 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 145 | 145 | ** |
| @@ -12468,14 +12468,14 @@ | ||
| 12468 | 12468 | SQLITE_PRIVATE int sqlite3FkRequired(Parse*, Table*, int*, int); |
| 12469 | 12469 | SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*); |
| 12470 | 12470 | SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *); |
| 12471 | 12471 | #else |
| 12472 | 12472 | #define sqlite3FkActions(a,b,c,d,e,f) |
| 12473 | - #define sqlite3FkCheck(a,b,c,d) | |
| 12473 | + #define sqlite3FkCheck(a,b,c,d,e,f) | |
| 12474 | 12474 | #define sqlite3FkDropTable(a,b,c) |
| 12475 | - #define sqlite3FkOldmask(a,b) 0 | |
| 12476 | - #define sqlite3FkRequired(a,b,c,d,e,f) 0 | |
| 12475 | + #define sqlite3FkOldmask(a,b) 0 | |
| 12476 | + #define sqlite3FkRequired(a,b,c,d) 0 | |
| 12477 | 12477 | #endif |
| 12478 | 12478 | #ifndef SQLITE_OMIT_FOREIGN_KEY |
| 12479 | 12479 | SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*); |
| 12480 | 12480 | SQLITE_PRIVATE int sqlite3FkLocateIndex(Parse*,Table*,FKey*,Index**,int**); |
| 12481 | 12481 | #else |
| @@ -81300,11 +81300,11 @@ | ||
| 81300 | 81300 | ** The sqlite_stat2 table is superseded by sqlite_stat3, which is only |
| 81301 | 81301 | ** created and used by SQLite versions 3.7.9 and later and with |
| 81302 | 81302 | ** SQLITE_ENABLE_STAT3 defined. The functionality of sqlite_stat3 |
| 81303 | 81303 | ** is a superset of sqlite_stat2. The sqlite_stat4 is an enhanced |
| 81304 | 81304 | ** version of sqlite_stat3 and is only available when compiled with |
| 81305 | -** SQLITE_ENABLE_STAT4 and in SQLite versions 3.8.0 and later. It is | |
| 81305 | +** SQLITE_ENABLE_STAT4 and in SQLite versions 3.8.1 and later. It is | |
| 81306 | 81306 | ** not possible to enable both STAT3 and STAT4 at the same time. If they |
| 81307 | 81307 | ** are both enabled, then STAT4 takes precedence. |
| 81308 | 81308 | ** |
| 81309 | 81309 | ** For most applications, sqlite_stat1 provides all the statisics required |
| 81310 | 81310 | ** for the query planner to make good choices. |
| @@ -81376,16 +81376,16 @@ | ||
| 81376 | 81376 | ** |
| 81377 | 81377 | ** The sqlite_stat4 table contains multiple entries for each index. |
| 81378 | 81378 | ** The idx column names the index and the tbl column is the table of the |
| 81379 | 81379 | ** index. If the idx and tbl columns are the same, then the sample is |
| 81380 | 81380 | ** of the INTEGER PRIMARY KEY. The sample column is a blob which is the |
| 81381 | -** binary encoding of a key from the index, with the trailing rowid | |
| 81382 | -** omitted. The nEq column is a list of integers. The first integer | |
| 81383 | -** is the approximate number of entries in the index whose left-most | |
| 81384 | -** column exactly matches the left-most column of the sample. The second | |
| 81385 | -** integer in nEq is the approximate number of entries in the index where | |
| 81386 | -** the first two columns match the first two columns of the sample. | |
| 81381 | +** binary encoding of a key from the index. The nEq column is a | |
| 81382 | +** list of integers. The first integer is the approximate number | |
| 81383 | +** of entries in the index whose left-most column exactly matches | |
| 81384 | +** the left-most column of the sample. The second integer in nEq | |
| 81385 | +** is the approximate number of entries in the index where the | |
| 81386 | +** first two columns match the first two columns of the sample. | |
| 81387 | 81387 | ** And so forth. nLt is another list of integers that show the approximate |
| 81388 | 81388 | ** number of entries that are strictly less than the sample. The first |
| 81389 | 81389 | ** integer in nLt contains the number of entries in the index where the |
| 81390 | 81390 | ** left-most column is less than the left-most column of the sample. |
| 81391 | 81391 | ** The K-th integer in the nLt entry is the number of index entries |
| @@ -96781,12 +96781,12 @@ | ||
| 96781 | 96781 | if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; |
| 96782 | 96782 | sqlite3OpenTable(pParse, 0, iDb, pTab, OP_OpenRead); |
| 96783 | 96783 | sqlite3VdbeAddOp4(v, OP_String8, 0, regResult, 0, pTab->zName, |
| 96784 | 96784 | P4_TRANSIENT); |
| 96785 | 96785 | for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
| 96786 | - pParent = sqlite3LocateTable(pParse, 0, pFK->zTo, zDb); | |
| 96787 | - if( pParent==0 ) break; | |
| 96786 | + pParent = sqlite3FindTable(db, pFK->zTo, zDb); | |
| 96787 | + if( pParent==0 ) continue; | |
| 96788 | 96788 | pIdx = 0; |
| 96789 | 96789 | sqlite3TableLock(pParse, iDb, pParent->tnum, 0, pParent->zName); |
| 96790 | 96790 | x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, 0); |
| 96791 | 96791 | if( x==0 ){ |
| 96792 | 96792 | if( pIdx==0 ){ |
| @@ -96799,22 +96799,24 @@ | ||
| 96799 | 96799 | }else{ |
| 96800 | 96800 | k = 0; |
| 96801 | 96801 | break; |
| 96802 | 96802 | } |
| 96803 | 96803 | } |
| 96804 | + assert( pParse->nErr>0 || pFK==0 ); | |
| 96804 | 96805 | if( pFK ) break; |
| 96805 | 96806 | if( pParse->nTab<i ) pParse->nTab = i; |
| 96806 | 96807 | addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, 0); |
| 96807 | 96808 | for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
| 96808 | - pParent = sqlite3LocateTable(pParse, 0, pFK->zTo, zDb); | |
| 96809 | - assert( pParent!=0 ); | |
| 96809 | + pParent = sqlite3FindTable(db, pFK->zTo, zDb); | |
| 96810 | 96810 | pIdx = 0; |
| 96811 | 96811 | aiCols = 0; |
| 96812 | - x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols); | |
| 96813 | - assert( x==0 ); | |
| 96812 | + if( pParent ){ | |
| 96813 | + x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols); | |
| 96814 | + assert( x==0 ); | |
| 96815 | + } | |
| 96814 | 96816 | addrOk = sqlite3VdbeMakeLabel(v); |
| 96815 | - if( pIdx==0 ){ | |
| 96817 | + if( pParent && pIdx==0 ){ | |
| 96816 | 96818 | int iKey = pFK->aCol[0].iFrom; |
| 96817 | 96819 | assert( iKey>=0 && iKey<pTab->nCol ); |
| 96818 | 96820 | if( iKey!=pTab->iPKey ){ |
| 96819 | 96821 | sqlite3VdbeAddOp3(v, OP_Column, 0, iKey, regRow); |
| 96820 | 96822 | sqlite3ColumnDefault(v, pTab, iKey, regRow); |
| @@ -96828,17 +96830,19 @@ | ||
| 96828 | 96830 | sqlite3VdbeAddOp2(v, OP_Goto, 0, addrOk); |
| 96829 | 96831 | sqlite3VdbeJumpHere(v, sqlite3VdbeCurrentAddr(v)-2); |
| 96830 | 96832 | }else{ |
| 96831 | 96833 | for(j=0; j<pFK->nCol; j++){ |
| 96832 | 96834 | sqlite3ExprCodeGetColumnOfTable(v, pTab, 0, |
| 96833 | - aiCols ? aiCols[j] : pFK->aCol[0].iFrom, regRow+j); | |
| 96835 | + aiCols ? aiCols[j] : pFK->aCol[j].iFrom, regRow+j); | |
| 96834 | 96836 | sqlite3VdbeAddOp2(v, OP_IsNull, regRow+j, addrOk); |
| 96835 | 96837 | } |
| 96836 | - sqlite3VdbeAddOp3(v, OP_MakeRecord, regRow, pFK->nCol, regKey); | |
| 96837 | - sqlite3VdbeChangeP4(v, -1, | |
| 96838 | - sqlite3IndexAffinityStr(v,pIdx), P4_TRANSIENT); | |
| 96839 | - sqlite3VdbeAddOp4Int(v, OP_Found, i, addrOk, regKey, 0); | |
| 96838 | + if( pParent ){ | |
| 96839 | + sqlite3VdbeAddOp3(v, OP_MakeRecord, regRow, pFK->nCol, regKey); | |
| 96840 | + sqlite3VdbeChangeP4(v, -1, | |
| 96841 | + sqlite3IndexAffinityStr(v,pIdx), P4_TRANSIENT); | |
| 96842 | + sqlite3VdbeAddOp4Int(v, OP_Found, i, addrOk, regKey, 0); | |
| 96843 | + } | |
| 96840 | 96844 | } |
| 96841 | 96845 | sqlite3VdbeAddOp2(v, OP_Rowid, 0, regResult+1); |
| 96842 | 96846 | sqlite3VdbeAddOp4(v, OP_String8, 0, regResult+2, 0, |
| 96843 | 96847 | pFK->zTo, P4_TRANSIENT); |
| 96844 | 96848 | sqlite3VdbeAddOp2(v, OP_Integer, i-1, regResult+3); |
| @@ -126328,11 +126332,11 @@ | ||
| 126328 | 126332 | int bMaxSet = 0; |
| 126329 | 126333 | sqlite3_int64 iMax = 0; /* Largest docid for all iterators */ |
| 126330 | 126334 | int i; /* Used to iterate through tokens */ |
| 126331 | 126335 | |
| 126332 | 126336 | /* Advance the iterator for each token in the phrase once. */ |
| 126333 | - for(i=0; rc==SQLITE_OK && i<p->nToken; i++){ | |
| 126337 | + for(i=0; rc==SQLITE_OK && i<p->nToken && bEof==0; i++){ | |
| 126334 | 126338 | rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); |
| 126335 | 126339 | if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
| 126336 | 126340 | iMax = a[i].iDocid; |
| 126337 | 126341 | bMaxSet = 1; |
| 126338 | 126342 | } |
| 126339 | 126343 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -135,11 +135,11 @@ | |
| 135 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 136 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 137 | */ |
| 138 | #define SQLITE_VERSION "3.8.1" |
| 139 | #define SQLITE_VERSION_NUMBER 3008001 |
| 140 | #define SQLITE_SOURCE_ID "2013-10-14 13:21:00 1660efbe46439734c7dc1674994ceb86a9b41d1a" |
| 141 | |
| 142 | /* |
| 143 | ** CAPI3REF: Run-Time Library Version Numbers |
| 144 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 145 | ** |
| @@ -12468,14 +12468,14 @@ | |
| 12468 | SQLITE_PRIVATE int sqlite3FkRequired(Parse*, Table*, int*, int); |
| 12469 | SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*); |
| 12470 | SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *); |
| 12471 | #else |
| 12472 | #define sqlite3FkActions(a,b,c,d,e,f) |
| 12473 | #define sqlite3FkCheck(a,b,c,d) |
| 12474 | #define sqlite3FkDropTable(a,b,c) |
| 12475 | #define sqlite3FkOldmask(a,b) 0 |
| 12476 | #define sqlite3FkRequired(a,b,c,d,e,f) 0 |
| 12477 | #endif |
| 12478 | #ifndef SQLITE_OMIT_FOREIGN_KEY |
| 12479 | SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*); |
| 12480 | SQLITE_PRIVATE int sqlite3FkLocateIndex(Parse*,Table*,FKey*,Index**,int**); |
| 12481 | #else |
| @@ -81300,11 +81300,11 @@ | |
| 81300 | ** The sqlite_stat2 table is superseded by sqlite_stat3, which is only |
| 81301 | ** created and used by SQLite versions 3.7.9 and later and with |
| 81302 | ** SQLITE_ENABLE_STAT3 defined. The functionality of sqlite_stat3 |
| 81303 | ** is a superset of sqlite_stat2. The sqlite_stat4 is an enhanced |
| 81304 | ** version of sqlite_stat3 and is only available when compiled with |
| 81305 | ** SQLITE_ENABLE_STAT4 and in SQLite versions 3.8.0 and later. It is |
| 81306 | ** not possible to enable both STAT3 and STAT4 at the same time. If they |
| 81307 | ** are both enabled, then STAT4 takes precedence. |
| 81308 | ** |
| 81309 | ** For most applications, sqlite_stat1 provides all the statisics required |
| 81310 | ** for the query planner to make good choices. |
| @@ -81376,16 +81376,16 @@ | |
| 81376 | ** |
| 81377 | ** The sqlite_stat4 table contains multiple entries for each index. |
| 81378 | ** The idx column names the index and the tbl column is the table of the |
| 81379 | ** index. If the idx and tbl columns are the same, then the sample is |
| 81380 | ** of the INTEGER PRIMARY KEY. The sample column is a blob which is the |
| 81381 | ** binary encoding of a key from the index, with the trailing rowid |
| 81382 | ** omitted. The nEq column is a list of integers. The first integer |
| 81383 | ** is the approximate number of entries in the index whose left-most |
| 81384 | ** column exactly matches the left-most column of the sample. The second |
| 81385 | ** integer in nEq is the approximate number of entries in the index where |
| 81386 | ** the first two columns match the first two columns of the sample. |
| 81387 | ** And so forth. nLt is another list of integers that show the approximate |
| 81388 | ** number of entries that are strictly less than the sample. The first |
| 81389 | ** integer in nLt contains the number of entries in the index where the |
| 81390 | ** left-most column is less than the left-most column of the sample. |
| 81391 | ** The K-th integer in the nLt entry is the number of index entries |
| @@ -96781,12 +96781,12 @@ | |
| 96781 | if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; |
| 96782 | sqlite3OpenTable(pParse, 0, iDb, pTab, OP_OpenRead); |
| 96783 | sqlite3VdbeAddOp4(v, OP_String8, 0, regResult, 0, pTab->zName, |
| 96784 | P4_TRANSIENT); |
| 96785 | for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
| 96786 | pParent = sqlite3LocateTable(pParse, 0, pFK->zTo, zDb); |
| 96787 | if( pParent==0 ) break; |
| 96788 | pIdx = 0; |
| 96789 | sqlite3TableLock(pParse, iDb, pParent->tnum, 0, pParent->zName); |
| 96790 | x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, 0); |
| 96791 | if( x==0 ){ |
| 96792 | if( pIdx==0 ){ |
| @@ -96799,22 +96799,24 @@ | |
| 96799 | }else{ |
| 96800 | k = 0; |
| 96801 | break; |
| 96802 | } |
| 96803 | } |
| 96804 | if( pFK ) break; |
| 96805 | if( pParse->nTab<i ) pParse->nTab = i; |
| 96806 | addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, 0); |
| 96807 | for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
| 96808 | pParent = sqlite3LocateTable(pParse, 0, pFK->zTo, zDb); |
| 96809 | assert( pParent!=0 ); |
| 96810 | pIdx = 0; |
| 96811 | aiCols = 0; |
| 96812 | x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols); |
| 96813 | assert( x==0 ); |
| 96814 | addrOk = sqlite3VdbeMakeLabel(v); |
| 96815 | if( pIdx==0 ){ |
| 96816 | int iKey = pFK->aCol[0].iFrom; |
| 96817 | assert( iKey>=0 && iKey<pTab->nCol ); |
| 96818 | if( iKey!=pTab->iPKey ){ |
| 96819 | sqlite3VdbeAddOp3(v, OP_Column, 0, iKey, regRow); |
| 96820 | sqlite3ColumnDefault(v, pTab, iKey, regRow); |
| @@ -96828,17 +96830,19 @@ | |
| 96828 | sqlite3VdbeAddOp2(v, OP_Goto, 0, addrOk); |
| 96829 | sqlite3VdbeJumpHere(v, sqlite3VdbeCurrentAddr(v)-2); |
| 96830 | }else{ |
| 96831 | for(j=0; j<pFK->nCol; j++){ |
| 96832 | sqlite3ExprCodeGetColumnOfTable(v, pTab, 0, |
| 96833 | aiCols ? aiCols[j] : pFK->aCol[0].iFrom, regRow+j); |
| 96834 | sqlite3VdbeAddOp2(v, OP_IsNull, regRow+j, addrOk); |
| 96835 | } |
| 96836 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regRow, pFK->nCol, regKey); |
| 96837 | sqlite3VdbeChangeP4(v, -1, |
| 96838 | sqlite3IndexAffinityStr(v,pIdx), P4_TRANSIENT); |
| 96839 | sqlite3VdbeAddOp4Int(v, OP_Found, i, addrOk, regKey, 0); |
| 96840 | } |
| 96841 | sqlite3VdbeAddOp2(v, OP_Rowid, 0, regResult+1); |
| 96842 | sqlite3VdbeAddOp4(v, OP_String8, 0, regResult+2, 0, |
| 96843 | pFK->zTo, P4_TRANSIENT); |
| 96844 | sqlite3VdbeAddOp2(v, OP_Integer, i-1, regResult+3); |
| @@ -126328,11 +126332,11 @@ | |
| 126328 | int bMaxSet = 0; |
| 126329 | sqlite3_int64 iMax = 0; /* Largest docid for all iterators */ |
| 126330 | int i; /* Used to iterate through tokens */ |
| 126331 | |
| 126332 | /* Advance the iterator for each token in the phrase once. */ |
| 126333 | for(i=0; rc==SQLITE_OK && i<p->nToken; i++){ |
| 126334 | rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); |
| 126335 | if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
| 126336 | iMax = a[i].iDocid; |
| 126337 | bMaxSet = 1; |
| 126338 | } |
| 126339 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -135,11 +135,11 @@ | |
| 135 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 136 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 137 | */ |
| 138 | #define SQLITE_VERSION "3.8.1" |
| 139 | #define SQLITE_VERSION_NUMBER 3008001 |
| 140 | #define SQLITE_SOURCE_ID "2013-10-14 21:14:42 9f66dd7e3790c04f0ab724419f5381bd21f9ebad" |
| 141 | |
| 142 | /* |
| 143 | ** CAPI3REF: Run-Time Library Version Numbers |
| 144 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 145 | ** |
| @@ -12468,14 +12468,14 @@ | |
| 12468 | SQLITE_PRIVATE int sqlite3FkRequired(Parse*, Table*, int*, int); |
| 12469 | SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*); |
| 12470 | SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *); |
| 12471 | #else |
| 12472 | #define sqlite3FkActions(a,b,c,d,e,f) |
| 12473 | #define sqlite3FkCheck(a,b,c,d,e,f) |
| 12474 | #define sqlite3FkDropTable(a,b,c) |
| 12475 | #define sqlite3FkOldmask(a,b) 0 |
| 12476 | #define sqlite3FkRequired(a,b,c,d) 0 |
| 12477 | #endif |
| 12478 | #ifndef SQLITE_OMIT_FOREIGN_KEY |
| 12479 | SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*); |
| 12480 | SQLITE_PRIVATE int sqlite3FkLocateIndex(Parse*,Table*,FKey*,Index**,int**); |
| 12481 | #else |
| @@ -81300,11 +81300,11 @@ | |
| 81300 | ** The sqlite_stat2 table is superseded by sqlite_stat3, which is only |
| 81301 | ** created and used by SQLite versions 3.7.9 and later and with |
| 81302 | ** SQLITE_ENABLE_STAT3 defined. The functionality of sqlite_stat3 |
| 81303 | ** is a superset of sqlite_stat2. The sqlite_stat4 is an enhanced |
| 81304 | ** version of sqlite_stat3 and is only available when compiled with |
| 81305 | ** SQLITE_ENABLE_STAT4 and in SQLite versions 3.8.1 and later. It is |
| 81306 | ** not possible to enable both STAT3 and STAT4 at the same time. If they |
| 81307 | ** are both enabled, then STAT4 takes precedence. |
| 81308 | ** |
| 81309 | ** For most applications, sqlite_stat1 provides all the statisics required |
| 81310 | ** for the query planner to make good choices. |
| @@ -81376,16 +81376,16 @@ | |
| 81376 | ** |
| 81377 | ** The sqlite_stat4 table contains multiple entries for each index. |
| 81378 | ** The idx column names the index and the tbl column is the table of the |
| 81379 | ** index. If the idx and tbl columns are the same, then the sample is |
| 81380 | ** of the INTEGER PRIMARY KEY. The sample column is a blob which is the |
| 81381 | ** binary encoding of a key from the index. The nEq column is a |
| 81382 | ** list of integers. The first integer is the approximate number |
| 81383 | ** of entries in the index whose left-most column exactly matches |
| 81384 | ** the left-most column of the sample. The second integer in nEq |
| 81385 | ** is the approximate number of entries in the index where the |
| 81386 | ** first two columns match the first two columns of the sample. |
| 81387 | ** And so forth. nLt is another list of integers that show the approximate |
| 81388 | ** number of entries that are strictly less than the sample. The first |
| 81389 | ** integer in nLt contains the number of entries in the index where the |
| 81390 | ** left-most column is less than the left-most column of the sample. |
| 81391 | ** The K-th integer in the nLt entry is the number of index entries |
| @@ -96781,12 +96781,12 @@ | |
| 96781 | if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; |
| 96782 | sqlite3OpenTable(pParse, 0, iDb, pTab, OP_OpenRead); |
| 96783 | sqlite3VdbeAddOp4(v, OP_String8, 0, regResult, 0, pTab->zName, |
| 96784 | P4_TRANSIENT); |
| 96785 | for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
| 96786 | pParent = sqlite3FindTable(db, pFK->zTo, zDb); |
| 96787 | if( pParent==0 ) continue; |
| 96788 | pIdx = 0; |
| 96789 | sqlite3TableLock(pParse, iDb, pParent->tnum, 0, pParent->zName); |
| 96790 | x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, 0); |
| 96791 | if( x==0 ){ |
| 96792 | if( pIdx==0 ){ |
| @@ -96799,22 +96799,24 @@ | |
| 96799 | }else{ |
| 96800 | k = 0; |
| 96801 | break; |
| 96802 | } |
| 96803 | } |
| 96804 | assert( pParse->nErr>0 || pFK==0 ); |
| 96805 | if( pFK ) break; |
| 96806 | if( pParse->nTab<i ) pParse->nTab = i; |
| 96807 | addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, 0); |
| 96808 | for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
| 96809 | pParent = sqlite3FindTable(db, pFK->zTo, zDb); |
| 96810 | pIdx = 0; |
| 96811 | aiCols = 0; |
| 96812 | if( pParent ){ |
| 96813 | x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols); |
| 96814 | assert( x==0 ); |
| 96815 | } |
| 96816 | addrOk = sqlite3VdbeMakeLabel(v); |
| 96817 | if( pParent && pIdx==0 ){ |
| 96818 | int iKey = pFK->aCol[0].iFrom; |
| 96819 | assert( iKey>=0 && iKey<pTab->nCol ); |
| 96820 | if( iKey!=pTab->iPKey ){ |
| 96821 | sqlite3VdbeAddOp3(v, OP_Column, 0, iKey, regRow); |
| 96822 | sqlite3ColumnDefault(v, pTab, iKey, regRow); |
| @@ -96828,17 +96830,19 @@ | |
| 96830 | sqlite3VdbeAddOp2(v, OP_Goto, 0, addrOk); |
| 96831 | sqlite3VdbeJumpHere(v, sqlite3VdbeCurrentAddr(v)-2); |
| 96832 | }else{ |
| 96833 | for(j=0; j<pFK->nCol; j++){ |
| 96834 | sqlite3ExprCodeGetColumnOfTable(v, pTab, 0, |
| 96835 | aiCols ? aiCols[j] : pFK->aCol[j].iFrom, regRow+j); |
| 96836 | sqlite3VdbeAddOp2(v, OP_IsNull, regRow+j, addrOk); |
| 96837 | } |
| 96838 | if( pParent ){ |
| 96839 | sqlite3VdbeAddOp3(v, OP_MakeRecord, regRow, pFK->nCol, regKey); |
| 96840 | sqlite3VdbeChangeP4(v, -1, |
| 96841 | sqlite3IndexAffinityStr(v,pIdx), P4_TRANSIENT); |
| 96842 | sqlite3VdbeAddOp4Int(v, OP_Found, i, addrOk, regKey, 0); |
| 96843 | } |
| 96844 | } |
| 96845 | sqlite3VdbeAddOp2(v, OP_Rowid, 0, regResult+1); |
| 96846 | sqlite3VdbeAddOp4(v, OP_String8, 0, regResult+2, 0, |
| 96847 | pFK->zTo, P4_TRANSIENT); |
| 96848 | sqlite3VdbeAddOp2(v, OP_Integer, i-1, regResult+3); |
| @@ -126328,11 +126332,11 @@ | |
| 126332 | int bMaxSet = 0; |
| 126333 | sqlite3_int64 iMax = 0; /* Largest docid for all iterators */ |
| 126334 | int i; /* Used to iterate through tokens */ |
| 126335 | |
| 126336 | /* Advance the iterator for each token in the phrase once. */ |
| 126337 | for(i=0; rc==SQLITE_OK && i<p->nToken && bEof==0; i++){ |
| 126338 | rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); |
| 126339 | if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
| 126340 | iMax = a[i].iDocid; |
| 126341 | bMaxSet = 1; |
| 126342 | } |
| 126343 |
+1
-1
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.8.1" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3008001 |
| 112 | -#define SQLITE_SOURCE_ID "2013-10-14 13:21:00 1660efbe46439734c7dc1674994ceb86a9b41d1a" | |
| 112 | +#define SQLITE_SOURCE_ID "2013-10-14 21:14:42 9f66dd7e3790c04f0ab724419f5381bd21f9ebad" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.1" |
| 111 | #define SQLITE_VERSION_NUMBER 3008001 |
| 112 | #define SQLITE_SOURCE_ID "2013-10-14 13:21:00 1660efbe46439734c7dc1674994ceb86a9b41d1a" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.1" |
| 111 | #define SQLITE_VERSION_NUMBER 3008001 |
| 112 | #define SQLITE_SOURCE_ID "2013-10-14 21:14:42 9f66dd7e3790c04f0ab724419f5381bd21f9ebad" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |