diff options
author | dan <Dan Kennedy> | 2024-03-13 15:34:44 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2024-03-13 15:34:44 +0000 |
commit | 609aba00d930c4909a1dfa313645847de5804b68 (patch) | |
tree | a3b5b54060f27d7d7a8e4e783ef852cd16391351 /src | |
parent | 5badd048d2e63b900683eefd01a3427a3d82b277 (diff) | |
download | sqlite-609aba00d930c4909a1dfa313645847de5804b68.tar.gz sqlite-609aba00d930c4909a1dfa313645847de5804b68.zip |
Avoid creating a co-routine incrementally for a VALUES clause that has affinities other than NONE.
FossilOrigin-Name: 4229b12b327b05561dcf49b8585a66467d17d4e998b14eff65eb886f2434b53c
Diffstat (limited to 'src')
-rw-r--r-- | src/insert.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/insert.c b/src/insert.c index 071d9aeff..10eafaa41 100644 --- a/src/insert.c +++ b/src/insert.c @@ -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 ){ |