aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2018-01-18 19:00:54 +0000
committerdan <dan@noemail.net>2018-01-18 19:00:54 +0000
commit1a3a3086163d90e6e71d1c103a2e0dc93438f368 (patch)
treef9564f85d3bb3fe0e8640aa0dc0ed025e97aee13 /src/expr.c
parent5a7da86f5bc2f5b18320911ae82730a76b459f6c (diff)
downloadsqlite-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.c6
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);
}
}