aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wherecode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index b9801407b..4d125fdb6 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -1054,8 +1054,12 @@ static void codeDeferredSeek(
if( ai ){
ai[0] = pTab->nCol;
for(i=0; i<pIdx->nColumn-1; i++){
+ int x1, x2;
assert( pIdx->aiColumn[i]<pTab->nCol );
- if( pIdx->aiColumn[i]>=0 ) ai[pIdx->aiColumn[i]+1] = i+1;
+ x1 = pIdx->aiColumn[i];
+ x2 = sqlite3TableColumnToStorage(pTab, x1);
+ testcase( x1!=x2 );
+ if( pIdx->aiColumn[i]>=0 ) ai[x2+1] = i+1;
}
sqlite3VdbeChangeP4(v, -1, (char*)ai, P4_INTARRAY);
}