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

Ensure that the "push-down" optimization does not push constraints down into compound queries if any of the component queries uses window functions.

FossilOrigin-Name: 094dcfe779613301521e8bb990432df187b3686add75a3420b4a193f02f3467f
This commit is contained in:
dan
2020-06-10 10:58:15 +00:00
parent 7b4c4d4a67
commit f65e379919
4 changed files with 43 additions and 12 deletions

View File

@@ -4428,11 +4428,14 @@ static int pushDownWhereTerms(
){
Expr *pNew;
int nChng = 0;
Select *pSel;
if( pWhere==0 ) return 0;
if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */
#ifndef SQLITE_OMIT_WINDOWFUNC
if( pSubq->pWin ) return 0; /* restriction (6) */
for(pSel=pSubq; pSel; pSel=pSel->pPrior){
if( pSel->pWin ) return 0; /* restriction (6) */
}
#endif
#ifdef SQLITE_DEBUG