The sqlite3ExprCodeFactorable() routine should make a copy of non-factorable

expressions, as they might be coming from a DEFAULT or generated column
in a table constraint.

FossilOrigin-Name: a2d6f108c5d07559b125823a04c9cb072c80be80d7913097891a6192c7e1e225
This commit is contained in:
drh
2020-03-10 02:57:37 +00:00
parent afa1ecac9b
commit 088489e8d9
4 changed files with 19 additions and 9 deletions
+2 -1
View File
@@ -2850,6 +2850,7 @@ void sqlite3CodeRhsOfIN(
/* Begin coding the subroutine */
ExprSetProperty(pExpr, EP_Subrtn);
assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
pExpr->y.sub.regReturn = ++pParse->nMem;
pExpr->y.sub.iAddr =
sqlite3VdbeAddOp2(v, OP_Integer, 0, pExpr->y.sub.regReturn) + 1;
@@ -4604,7 +4605,7 @@ void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr, int target){
if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){
sqlite3ExprCodeAtInit(pParse, pExpr, target);
}else{
sqlite3ExprCode(pParse, pExpr, target);
sqlite3ExprCodeCopy(pParse, pExpr, target);
}
}