diff options
author | dan <dan@noemail.net> | 2018-01-18 19:00:54 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2018-01-18 19:00:54 +0000 |
commit | 1a3a3086163d90e6e71d1c103a2e0dc93438f368 (patch) | |
tree | f9564f85d3bb3fe0e8640aa0dc0ed025e97aee13 /src/expr.c | |
parent | 5a7da86f5bc2f5b18320911ae82730a76b459f6c (diff) | |
download | sqlite-1a3a3086163d90e6e71d1c103a2e0dc93438f368.tar.gz sqlite-1a3a3086163d90e6e71d1c103a2e0dc93438f368.zip |
Use a loop to avoid recursion in the heightOfSelect() function.
FossilOrigin-Name: 86de43595cb2ecebd680fe654affcfb9fbcfff6575c893293ae298124a357bfe
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr.c b/src/expr.c index a63de5d9f..1b8773492 100644 --- a/src/expr.c +++ b/src/expr.c @@ -658,15 +658,15 @@ static void heightOfExprList(ExprList *p, int *pnHeight){ } } } -static void heightOfSelect(Select *p, int *pnHeight){ - if( p ){ +static void heightOfSelect(Select *pSelect, int *pnHeight){ + Select *p; + for(p=pSelect; p; p=p->pPrior){ heightOfExpr(p->pWhere, pnHeight); heightOfExpr(p->pHaving, pnHeight); heightOfExpr(p->pLimit, pnHeight); heightOfExprList(p->pEList, pnHeight); heightOfExprList(p->pGroupBy, pnHeight); heightOfExprList(p->pOrderBy, pnHeight); - heightOfSelect(p->pPrior, pnHeight); } } |