1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

The sqlite3ExprCodeGetColumn() is not guaranteed to put the result in the

register requested.   Fix the skip-scan code generator for WITHOUT ROWID
tables so that it always checks the register and copies the result if it
lands in the wrong register.  Fix for ticket [8fd39115d8f46ece70e7d4b3].

FossilOrigin-Name: 793e206f9032d9205bdb3f447b136bed9a25fa22
This commit is contained in:
drh
2015-07-23 16:39:33 +00:00
parent 6b67a8ae03
commit d3e3f0b46e
4 changed files with 44 additions and 10 deletions

View File

@@ -1296,7 +1296,11 @@ Bitmask sqlite3WhereCodeOneLoopStart(
r = sqlite3GetTempRange(pParse, nPk);
for(iPk=0; iPk<nPk; iPk++){
int iCol = pPk->aiColumn[iPk];
sqlite3ExprCodeGetColumn(pParse, pTab, iCol, iCur, r+iPk, 0);
int rx;
rx = sqlite3ExprCodeGetColumn(pParse, pTab, iCol, iCur,r+iPk,0);
if( rx!=r+iPk ){
sqlite3VdbeAddOp2(v, OP_SCopy, rx, r+iPk);
}
}
/* Check if the temp table already contains this key. If so,