summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 4d675e61a4c..c9264916de1 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -3184,6 +3184,7 @@ void st_select_lex_node::fast_exclude()
for (; slave; slave= slave->next)
slave->fast_exclude();
+ prev= NULL; // to ensure correct behavior of st_select_lex_unit::is_excluded()
}
@@ -3258,9 +3259,7 @@ void st_select_lex_node::exclude_from_tree()
*/
void st_select_lex_node::exclude()
{
- /* exclude from global list */
- fast_exclude();
- /* exclude from other structures */
+ /* exclude the node from the tree */
exclude_from_tree();
/*
We do not need following statements, because prev pointer of first
@@ -3268,6 +3267,8 @@ void st_select_lex_node::exclude()
if (master->slave == this)
master->slave= next;
*/
+ /* exclude all nodes under this excluded node */
+ fast_exclude();
}