mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Fix issues with quering from an auxiliary index that must refer back to the
PRIMARY KEY index of a WITHOUT ROWID table. FossilOrigin-Name: cff1f55c52ff57557d9b728a5cd830a367091794
This commit is contained in:
@@ -6191,7 +6191,13 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
for(; k<last; k++, pOp++){
|
||||
if( pOp->p1!=pLevel->iTabCur ) continue;
|
||||
if( pOp->opcode==OP_Column ){
|
||||
i16 x = sqlite3ColumnOfIndex(pIdx, pOp->p2);
|
||||
int x = pOp->p2;
|
||||
Table *pTab = pIdx->pTable;
|
||||
if( !HasRowid(pTab) ){
|
||||
Index *pPk = sqlite3PrimaryKeyIndex(pTab);
|
||||
x = pPk->aiColumn[x];
|
||||
}
|
||||
x = sqlite3ColumnOfIndex(pIdx, x);
|
||||
if( x>=0 ){
|
||||
pOp->p2 = x;
|
||||
pOp->p1 = pLevel->iIdxCur;
|
||||
|
||||
Reference in New Issue
Block a user