1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Fix the OP_DeferredSeek index-to-table column map in P4 so that it works

with generated columns.  Ticket [ce22a07731530118]

FossilOrigin-Name: 36c11ad51fe9ab1bde0b98d0ea9b8588e07d168cd8027486749372894941ad93
This commit is contained in:
drh
2019-11-06 17:31:18 +00:00
parent b1129c423f
commit 4fb24c82cd
4 changed files with 24 additions and 9 deletions

View File

@@ -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);
}