aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-09-29 17:20:14 +0000
committerdrh <drh@noemail.net>2015-09-29 17:20:14 +0000
commit4b92f98ccc298dfcd00c323fa912a22876a4e245 (patch)
tree1ab4a6bcee6112c6be590ce616c251c0e0a40e7e /src/expr.c
parente60856980a961ff8406df0c9b45529dfecadc863 (diff)
downloadsqlite-4b92f98ccc298dfcd00c323fa912a22876a4e245.tar.gz
sqlite-4b92f98ccc298dfcd00c323fa912a22876a4e245.zip
Use symbolic names XN_ROWID and XN_EXPR in place of the (-1) and (-2)
magic numbers in Index.aiColumn[]. Add asserts to help verify that Index.aiColumn[] is always used correctly. Fix one place in FK processing where Index.aiColumn[] was not being used correctly. FossilOrigin-Name: 7d272aa62cd4cbbf4b5d04e3b918de27671e8301
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c
index 3141cd9db..b52e814f3 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -2443,15 +2443,15 @@ void sqlite3ExprCodeLoadIndexColumn(
int regOut /* Store the index column value in this register */
){
i16 iTabCol = pIdx->aiColumn[iIdxCol];
- if( iTabCol>=(-1) ){
+ if( iTabCol==XN_EXPR ){
+ assert( pIdx->aColExpr );
+ assert( pIdx->aColExpr->nExpr>iIdxCol );
+ pParse->iSelfTab = iTabCur;
+ sqlite3ExprCode(pParse, pIdx->aColExpr->a[iIdxCol].pExpr, regOut);
+ }else{
sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur,
iTabCol, regOut);
- return;
}
- assert( pIdx->aColExpr );
- assert( pIdx->aColExpr->nExpr>iIdxCol );
- pParse->iSelfTab = iTabCur;
- sqlite3ExprCode(pParse, pIdx->aColExpr->a[iIdxCol].pExpr, regOut);
}
/*