diff options
author | Monty <monty@mariadb.org> | 2015-06-25 23:18:48 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-06-25 23:18:48 +0300 |
commit | 2e941fe9fce7f1667993916ff3f238a283286d3f (patch) | |
tree | 2be9e9ab8801364e1971fa20ef96a1f6fc478403 /sql/sql_union.cc | |
parent | d199a0ffb0aac86881ea2db7dd78bc07b438dc67 (diff) | |
download | mariadb-git-2e941fe9fce7f1667993916ff3f238a283286d3f.tar.gz |
Fixed crashing bug when using ONLY_FULL_GROUP_BY in a stored procedure/trigger that is repeatedly executed.
This is MDEV-7601, including it's sub tasks MDEV-7594, MDEV-7555, MDEV-7590, MDEV-7581, MDEV-7589
The problem was that select_lex->non_agg_fields was not properly reset for re-execution and this caused an overwrite of a random memory position.
The fix was move non_agg_fields from select_lext to JOIN, which is properly reset.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 6e2e6e06ff7..87d3e86b2c7 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1021,7 +1021,6 @@ bool st_select_lex::cleanup() { error= (bool) ((uint) error | (uint) lex_unit->cleanup()); } - non_agg_fields.empty(); inner_refs_list.empty(); exclude_from_table_unique_test= FALSE; DBUG_RETURN(error); @@ -1032,6 +1031,7 @@ void st_select_lex::cleanup_all_joins(bool full) { SELECT_LEX_UNIT *unit; SELECT_LEX *sl; + DBUG_ENTER("st_select_lex::cleanup_all_joins"); if (join) join->cleanup(full); @@ -1039,6 +1039,7 @@ void st_select_lex::cleanup_all_joins(bool full) for (unit= first_inner_unit(); unit; unit= unit->next_unit()) for (sl= unit->first_select(); sl; sl= sl->next_select()) sl->cleanup_all_joins(full); + DBUG_VOID_RETURN; } |