mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix a bug in the lead() and lag() window functions causing them to fail when
used in queries featuring multiple window functions. FossilOrigin-Name: 3839fb18f917e4f705821198d624b19d84eb07f1ee29ad23314ab7cec6bf6a2b
This commit is contained in:
@@ -1108,7 +1108,7 @@ static void windowPartitionCache(
|
||||
if( pMWin->pPartition ){
|
||||
int addr;
|
||||
ExprList *pPart = pMWin->pPartition;
|
||||
int nPart = (pPart ? pPart->nExpr : 0);
|
||||
int nPart = pPart->nExpr;
|
||||
int regNewPart = reg + pMWin->nBufferCol;
|
||||
KeyInfo *pKeyInfo = sqlite3KeyInfoFromExprList(pParse, pPart, 0, 0);
|
||||
|
||||
@@ -1175,7 +1175,7 @@ static void windowReturnOneRow(
|
||||
}
|
||||
else if( pFunc->xSFunc==leadStepFunc || pFunc->xSFunc==lagStepFunc ){
|
||||
int nArg = pWin->pOwner->x.pList->nExpr;
|
||||
int iEph = pWin->iEphCsr;
|
||||
int iEph = pMWin->iEphCsr;
|
||||
int csr = pWin->csrApp;
|
||||
int lbl = sqlite3VdbeMakeLabel(v);
|
||||
int tmpReg = sqlite3GetTempReg(pParse);
|
||||
|
Reference in New Issue
Block a user