revision-id: 3d83b4324f7222c03e1d7f84f430218414ad5707 (mariadb-10.4.3-54-g3d83b4324f7) parent(s): 1271aacaeed48df45b26b97748cbe6f683c6b465 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2019-03-11 17:25:14 +0100 message: c --- sql/sql_lex.cc | 14 ++++---------- sql/sql_lex.h | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 64096e5be86..7f2499d4dff 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -8839,18 +8839,12 @@ void st_select_lex_unit::reset_distinct() } -void st_select_lex_unit::fix_distinct(st_select_lex_unit *new_unit) +void st_select_lex_unit::fix_distinct() { if (union_distinct) { if (this != union_distinct->master_unit()) - { - DBUG_ASSERT(new_unit == union_distinct->master_unit()); - new_unit->union_distinct= union_distinct; reset_distinct(); - } - else - new_unit->reset_distinct(); } } @@ -9090,7 +9084,7 @@ bool LEX::parsed_unit_in_brackets(SELECT_LEX_UNIT *unit) /* There is a priority jump starting from first_in_nest */ if (create_priority_nest(first_in_nest) == NULL) return true; - unit->reset_distinct(); + unit->fix_distinct(); } push_select(unit->fake_select_lex); return false; @@ -9238,7 +9232,7 @@ SELECT_LEX_UNIT *LEX::parsed_select_expr_cont(SELECT_LEX_UNIT *unit, /* There is a priority jump starting from first_in_nest */ if ((last= create_priority_nest(first_in_nest)) == NULL) return NULL; - unit->reset_distinct(); + unit->fix_distinct(); } sel1->first_nested= last->first_nested; } @@ -9276,7 +9270,7 @@ bool LEX::parsed_body_unit(SELECT_LEX_UNIT *unit) /* There is a priority jump starting from first_in_nest */ if (create_priority_nest(first_in_nest) == NULL) return true; - unit->reset_distinct(); + unit->fix_distinct(); } push_select(unit->fake_select_lex); return false; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index b78a010d4b7..61816bee803 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -995,7 +995,7 @@ class st_select_lex_unit: public st_select_lex_node { unit_common_op common_op(); void reset_distinct(); - void fix_distinct(st_select_lex_unit *new_unit); + void fix_distinct(); void register_select_chain(SELECT_LEX *first_sel);