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

Correctly deal with multi-row VALUES clauses that contain window functions.

FossilOrigin-Name: 26d991f214db143976e2593d3564b5003eb3539a2728d1a0ccae2a2accece76f
This commit is contained in:
drh
2019-12-07 13:42:47 +00:00
parent c7a046e282
commit 29cdbadf8a
4 changed files with 27 additions and 9 deletions

View File

@@ -2474,6 +2474,7 @@ static int multiSelectValues(
assert( p->selFlags & SF_Values );
assert( p->op==TK_ALL || (p->op==TK_SELECT && p->pPrior==0) );
assert( p->pNext==0 || p->pEList->nExpr==p->pNext->pEList->nExpr );
if( p->pWin ) return -1;
if( p->pPrior==0 ) break;
assert( p->pPrior->pNext==p );
p = p->pPrior;
@@ -2564,7 +2565,8 @@ static int multiSelect(
*/
if( p->selFlags & SF_MultiValue ){
rc = multiSelectValues(pParse, p, &dest);
goto multi_select_end;
if( rc>=0 ) goto multi_select_end;
rc = SQLITE_OK;
}
/* Make sure all SELECTs in the statement have the same number of elements