1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Make sure the target register is allocated before adding the bogus

OP_Variable opcode in isLikeOrGlob().  Bugfix for the new 
sqlite3_reoptimize() logic.

FossilOrigin-Name: e74f8dc436213b7ef754adcab5ef7554d774474c
This commit is contained in:
drh
2009-10-17 13:13:02 +00:00
parent 03c7b99988
commit bec451f8ad
3 changed files with 23 additions and 10 deletions

View File

@@ -695,9 +695,12 @@ static int isLikeOrGlob(
** value of the variable means there is no need to invoke the LIKE
** function, then no OP_Variable will be added to the program.
** This causes problems for the sqlite3_bind_parameter_name()
** API. To workaround them, add a dummy OP_Variable here. */
sqlite3ExprCodeTarget(pParse, pRight, 1);
** API. To workaround them, add a dummy OP_Variable here.
*/
int r1 = sqlite3GetTempReg(pParse);
sqlite3ExprCodeTarget(pParse, pRight, r1);
sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0);
sqlite3ReleaseTempReg(pParse, r1);
}
}
}else{