summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-06-25 23:18:48 +0300
committerMonty <monty@mariadb.org>2015-06-25 23:18:48 +0300
commit2e941fe9fce7f1667993916ff3f238a283286d3f (patch)
tree2be9e9ab8801364e1971fa20ef96a1f6fc478403 /sql/table.cc
parentd199a0ffb0aac86881ea2db7dd78bc07b438dc67 (diff)
downloadmariadb-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/table.cc')
-rw-r--r--sql/table.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index e4dee77171d..f521056aaee 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -5194,7 +5194,7 @@ Item *Field_iterator_table::create_item(THD *thd)
if (item && thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
!thd->lex->in_sum_func && select->cur_pos_in_select_list != UNDEF_POS)
{
- select->non_agg_fields.push_back(item);
+ select->join->non_agg_fields.push_back(item);
item->marker= select->cur_pos_in_select_list;
select->set_non_agg_field_used(true);
}