aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-05-29 14:26:07 +0000
committerdrh <drh@noemail.net>2017-05-29 14:26:07 +0000
commit979dd1be5710eb2ed38a46b1712cf5da74947c2a (patch)
tree2c75713368428b53cfdbeac4ba2573f383c84dca /src/select.c
parentd8a295669c4308647717c54f58697746e99e37ce (diff)
downloadsqlite-979dd1be5710eb2ed38a46b1712cf5da74947c2a.tar.gz
sqlite-979dd1be5710eb2ed38a46b1712cf5da74947c2a.zip
Optimizations to the Walker object and its methods to make the code a little
smaller and to help it run a little faster. FossilOrigin-Name: 6854a34ed708259f2280f7ee56cec09f7fc99810dc739dc2814ddeae286aa2c4
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index a8547f811..9d4c15919 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4611,6 +4611,25 @@ int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
}
/*
+** No-op routine for the parse-tree walker for SELECT statements.
+** subquery in the parser tree.
+*/
+int sqlite3SelectWalkNoop(Walker *NotUsed, Select *NotUsed2){
+ UNUSED_PARAMETER2(NotUsed, NotUsed2);
+ return WRC_Continue;
+}
+
+#if SQLITE_DEBUG
+/*
+** Always assert. This xSelectCallback2 implementation proves that the
+** xSelectCallback2 is never invoked.
+*/
+void sqlite3SelectWalkAssert2(Walker *NotUsed, Select *NotUsed2){
+ UNUSED_PARAMETER2(NotUsed, NotUsed2);
+ assert( 0 );
+}
+#endif
+/*
** This routine "expands" a SELECT statement and all of its subqueries.
** For additional information on what it means to "expand" a SELECT
** statement, see the comment on the selectExpand worker callback above.
@@ -4625,11 +4644,11 @@ int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){
*/
static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
Walker w;
- memset(&w, 0, sizeof(w));
w.xExprCallback = sqlite3ExprWalkNoop;
w.pParse = pParse;
if( pParse->hasCompound ){
w.xSelectCallback = convertCompoundSelectToSubquery;
+ w.xSelectCallback2 = 0;
sqlite3WalkSelect(&w, pSelect);
}
w.xSelectCallback = selectExpander;
@@ -4689,7 +4708,7 @@ static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
static void sqlite3SelectAddTypeInfo(Parse *pParse, Select *pSelect){
#ifndef SQLITE_OMIT_SUBQUERY
Walker w;
- memset(&w, 0, sizeof(w));
+ w.xSelectCallback = sqlite3SelectWalkNoop;
w.xSelectCallback2 = selectAddSubqueryTypeInfo;
w.xExprCallback = sqlite3ExprWalkNoop;
w.pParse = pParse;