diff options
author | drh <drh@noemail.net> | 2015-08-25 16:57:52 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-08-25 16:57:52 +0000 |
commit | 1f9ca2c84ca1601fde33eab74d376ac1b1c9d3b0 (patch) | |
tree | 27077a7e223e2bf5378c681d1a0a5e29e3aa7c40 /src/analyze.c | |
parent | a514b8eb0cc9c6773171381a1dfe5b456d963a97 (diff) | |
download | sqlite-1f9ca2c84ca1601fde33eab74d376ac1b1c9d3b0.tar.gz sqlite-1f9ca2c84ca1601fde33eab74d376ac1b1c9d3b0.zip |
Add code to maintain indexes with expression arguments across DELETE, INSERT,
and UPDATE statements. Legacy tests pass, but the new code paths are still
largely untested. The query planner currently makes no effort to use
expression indexes.
FossilOrigin-Name: efaabdb71626bdc03768e87e186c72f6f3da75b2
Diffstat (limited to 'src/analyze.c')
-rw-r--r-- | src/analyze.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/analyze.c b/src/analyze.c index 59518cdc3..3e531bd72 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -1186,6 +1186,7 @@ static void analyzeOneTable( regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol); for(j=0; j<pPk->nKeyCol; j++){ k = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[j]); + assert( k>=0 && k<pTab->nCol ); sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j); VdbeComment((v, "%s", pTab->aCol[pPk->aiColumn[j]].zName)); } @@ -1235,12 +1236,10 @@ static void analyzeOneTable( ** be taken */ VdbeCoverageNeverTaken(v); #ifdef SQLITE_ENABLE_STAT3 - sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, - pIdx->aiColumn[0], regSample); + sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, 0, regSample); #else for(i=0; i<nCol; i++){ - i16 iCol = pIdx->aiColumn[i]; - sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, iCol, regCol+i); + sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, i, regCol+i); } sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol, regSample); #endif |