diff options
author | drh <drh@noemail.net> | 2013-10-31 17:38:01 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-10-31 17:38:01 +0000 |
commit | ee0ec8e1db6049e6c38c94fa08201ca73ef3f60a (patch) | |
tree | 541ba1456a5b331e71225dbb41fc36ef49c84853 /src/expr.c | |
parent | 6934fc7b6ffde4b1e24e277f0ac6fb783790e5db (diff) | |
download | sqlite-ee0ec8e1db6049e6c38c94fa08201ca73ef3f60a.tar.gz sqlite-ee0ec8e1db6049e6c38c94fa08201ca73ef3f60a.zip |
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
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index 99890d94c..24d866f19 100644 --- a/src/expr.c +++ b/src/expr.c @@ -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); |