1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +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:
drh
2013-10-31 17:38:01 +00:00
parent 6934fc7b6f
commit ee0ec8e1db
5 changed files with 22 additions and 11 deletions

View File

@@ -2222,7 +2222,11 @@ void sqlite3ExprCodeGetColumnOfTable(
sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut);
}else{
int op = IsVirtual(pTab) ? OP_VColumn : OP_Column;
sqlite3VdbeAddOp3(v, op, iTabCur, iCol, regOut);
int x = iCol;
if( !HasRowid(pTab) ){
x = sqlite3ColumnOfIndex(sqlite3PrimaryKeyIndex(pTab), iCol);
}
sqlite3VdbeAddOp3(v, op, iTabCur, x, regOut);
}
if( iCol>=0 ){
sqlite3ColumnDefault(v, pTab, iCol, regOut);