1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Ensure that if a multi-row VALUES cannot be coded while being parsed, the SF_MultiValue flag is correctly set.

FossilOrigin-Name: 94791824a6f04782aac6bc16c182685e2d6ebf5c688dc9f8d59e479c6fd5a40e
This commit is contained in:
dan
2024-03-13 15:44:31 +00:00
parent 609aba00d9
commit e116fa153f
3 changed files with 13 additions and 10 deletions

View File

@@ -616,13 +616,16 @@ Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList *pRow){
|| pLeft->pPrior
|| (pLeft->pSrc->nSrc==0 && multiValueIsConstantNoAff(pLeft->pEList)==0)
){
/* This row of the VALUES clause cannot be coded immediately. */
int f = SF_Values | SF_MultiValue;
if( pLeft->pPrior || pLeft->pSrc->nSrc ){
if( pLeft->pSrc->nSrc ){
sqlite3MultiValuesEnd(pParse, pLeft);
f = SF_Values;
}else if( pLeft->pPrior ){
/* In this case set the SF_MultiValue flag only if it was set on
** the previous Select structure. */
f = (f & pLeft->selFlags);
}
/* This VALUES clause is part of a VIEW or some other schema item. In
** this case the co-routine cannot be coded immediately. */
pSelect = sqlite3SelectNew(pParse,pRow,0,0,0,0,0,f,0);
pLeft->selFlags &= ~SF_MultiValue;
if( pSelect ){