Index: ext/misc/json1.c ================================================================== --- ext/misc/json1.c +++ ext/misc/json1.c @@ -2502,18 +2502,18 @@ { "json_tree", &jsonTreeModule }, }; #endif for(i=0; idb; - int i; - for(i=0; inExpr; i++){ - Expr *p = pList->a[i].pExpr; - if( p->op==TK_FUNCTION ){ - FuncDef *pDef; - int nArg = 0; - if( !ExprHasProperty(p, EP_TokenOnly) && p->x.pList ){ - nArg = p->x.pList->nExpr; - } - pDef = sqlite3FindFunction(db, p->u.zToken, nArg, db->enc, 0); - if( pDef && (pDef->funcFlags & SQLITE_FUNC_SUBTYPE) ){ - return 1; - } - } - } - } - return 0; -} - /* ** Append a copy of each expression in expression-list pAppend to ** expression list pList. Return a pointer to the result list. */ static ExprList *exprListAppendList( @@ -990,11 +964,11 @@ ** sub-select expression list. Also allocate two registers for each ** window function - one for the accumulator, another for interim ** results. */ for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ ExprList *pArgs = pWin->pOwner->x.pList; - if( exprListContainsSubtype(pParse, pArgs) ){ + if( pWin->pFunc->funcFlags & SQLITE_FUNC_SUBTYPE ){ selectWindowRewriteEList(pParse, pMWin, pSrc, pArgs, pTab, &pSublist); pWin->iArgCol = (pSublist ? pSublist->nExpr : 0); pWin->bExprArgs = 1; }else{ pWin->iArgCol = (pSublist ? pSublist->nExpr : 0);