aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-01-31 12:39:07 +0000
committerstephan <stephan@noemail.net>2025-01-31 12:39:07 +0000
commitd4bfa3465e78cd852506e9c28a733c45d9eec32e (patch)
tree83ca5b33ba9ade8933147757d12687ebe79794b4 /src/expr.c
parentcb46f1bb95ed8677e85207be7f667b0020d1f200 (diff)
parentefbf4815411adc7c63f7caf49c5f60cb6cccaaca (diff)
downloadsqlite-d4bfa3465e78cd852506e9c28a733c45d9eec32e.tar.gz
sqlite-d4bfa3465e78cd852506e9c28a733c45d9eec32e.zip
Merge trunk into opfs-sahpool-pause branch.
FossilOrigin-Name: 775a547eca2b0b3dbb6c03990236128a095cc34d28caec44b9a5072510c75b63
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index fcd3da213..8f898a1e3 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -3462,6 +3462,7 @@ static int findCompatibleInRhsSubrtn(
assert( pOp->opcode==OP_BeginSubrtn );
pSig = pOp->p4.pSubrtnSig;
assert( pSig!=0 );
+ if( !pSig->bComplete ) continue;
if( pNewSig->selId!=pSig->selId ) continue;
if( strcmp(pNewSig->zAff,pSig->zAff)!=0 ) continue;
pExpr->y.sub.iAddr = pSig->iAddr;
@@ -3508,6 +3509,7 @@ void sqlite3CodeRhsOfIN(
KeyInfo *pKeyInfo = 0; /* Key information */
int nVal; /* Size of vector pLeft */
Vdbe *v; /* The prepared statement under construction */
+ SubrtnSig *pSig = 0; /* Signature for this subroutine */
v = pParse->pVdbe;
assert( v!=0 );
@@ -3528,7 +3530,6 @@ void sqlite3CodeRhsOfIN(
** Compute a signature for the RHS of the IN operator to facility
** finding and reusing prior instances of the same IN operator.
*/
- SubrtnSig *pSig = 0;
assert( !ExprUseXSelect(pExpr) || pExpr->x.pSelect!=0 );
if( ExprUseXSelect(pExpr) && (pExpr->x.pSelect->selFlags & SF_All)==0 ){
pSig = sqlite3DbMallocRawNN(pParse->db, sizeof(pSig[0]));
@@ -3571,6 +3572,7 @@ void sqlite3CodeRhsOfIN(
pExpr->y.sub.iAddr =
sqlite3VdbeAddOp2(v, OP_BeginSubrtn, 0, pExpr->y.sub.regReturn) + 1;
if( pSig ){
+ pSig->bComplete = 0;
pSig->iAddr = pExpr->y.sub.iAddr;
pSig->regReturn = pExpr->y.sub.regReturn;
pSig->iTable = iTab;
@@ -3706,6 +3708,7 @@ void sqlite3CodeRhsOfIN(
sqlite3ReleaseTempReg(pParse, r1);
sqlite3ReleaseTempReg(pParse, r2);
}
+ if( pSig ) pSig->bComplete = 1;
if( pKeyInfo ){
sqlite3VdbeChangeP4(v, addr, (void *)pKeyInfo, P4_KEYINFO);
}