diff options
author | drh <drh@noemail.net> | 2013-10-22 18:01:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-10-22 18:01:40 +0000 |
commit | bbbdc83b52cc704f1dcc8f1456ad9f1445e3b384 (patch) | |
tree | e0d925d89395420a1982cb5d3e6297484ae43cbe /src/expr.c | |
parent | 77e57dfbc8f40ecfdab70be2514165d5c74e914c (diff) | |
download | sqlite-bbbdc83b52cc704f1dcc8f1456ad9f1445e3b384.tar.gz sqlite-bbbdc83b52cc704f1dcc8f1456ad9f1445e3b384.zip |
The Index object now has nKeyCol and nColumn. nColumn is the total number
of columns and nKeyCol is the number of key columns. Currently these always
differ by one. Refactor aiColumn[] to be of type i16 instead of int.
FossilOrigin-Name: a106ce86cd4afd1f81603826de77df1fb25e9ab5
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c index eb2f54563..58895562d 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1532,8 +1532,8 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ sqlite3 *db = pParse->db; /* Database connection */ Table *pTab; /* Table <table>. */ Expr *pExpr; /* Expression <column> */ - int iCol; /* Index of column <column> */ - int iDb; /* Database idx for pTab */ + i16 iCol; /* Index of column <column> */ + i16 iDb; /* Database idx for pTab */ assert( p ); /* Because of isCandidateForInOpt(p) */ assert( p->pEList!=0 ); /* Because of isCandidateForInOpt(p) */ @@ -1541,7 +1541,7 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ assert( p->pSrc!=0 ); /* Because of isCandidateForInOpt(p) */ pTab = p->pSrc->a[0].pTab; pExpr = p->pEList->a[0].pExpr; - iCol = pExpr->iColumn; + iCol = (i16)pExpr->iColumn; /* Code an OP_VerifyCookie and OP_TableLock for <table>. */ iDb = sqlite3SchemaToIndex(db, pTab->pSchema); @@ -1579,7 +1579,7 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){ if( (pIdx->aiColumn[0]==iCol) && sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], 0)==pReq - && (!mustBeUnique || (pIdx->nColumn==1 && pIdx->onError!=OE_None)) + && (!mustBeUnique || (pIdx->nKeyCol==1 && pIdx->onError!=OE_None)) ){ int iAddr; char *pKey; |