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

Avoid creating a co-routine incrementally for a VALUES clause that has affinities other than NONE.

FossilOrigin-Name: 4229b12b327b05561dcf49b8585a66467d17d4e998b14eff65eb886f2434b53c
This commit is contained in:
dan
2024-03-13 15:34:44 +00:00
parent 5badd048d2
commit 609aba00d9
4 changed files with 24 additions and 8 deletions

View File

@@ -593,6 +593,17 @@ static int multiValueIsConstant(ExprList *pRow){
return 1;
}
static int multiValueIsConstantNoAff(ExprList *pRow){
int ii;
if( multiValueIsConstant(pRow)==0 ) return 0;
for(ii=0; ii<pRow->nExpr; ii++){
assert( pRow->a[ii].pExpr->affExpr==0 );
if( 0!=sqlite3ExprAffinity(pRow->a[ii].pExpr) ) return 0;
}
return 1;
}
Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList *pRow){
SrcItem *p;
SelectDest dest;
@@ -603,6 +614,7 @@ Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList *pRow){
|| pParse->bHasWith
|| multiValueIsConstant(pRow)==0
|| pLeft->pPrior
|| (pLeft->pSrc->nSrc==0 && multiValueIsConstantNoAff(pLeft->pEList)==0)
){
int f = SF_Values | SF_MultiValue;
if( pLeft->pPrior || pLeft->pSrc->nSrc ){