From 7b50447aa6d051b8d14bb01ef14802cb8ffee223 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 16 Jan 2016 18:45:26 +0400 Subject: MDEV-9407 Illegal mix of collation when using GROUP_CONCAT in a VIEW MDEV-9408 CREATE TABLE SELECT MAX(int_column) creates different columns for table vs view There were three almost identical pieces of the code: - Field *Item_func::tmp_table_field(); - Field *Item_sum::create_tmp_field(); - Field *create_tmp_field_from_item(); with a difference in very small details (hence the bugs): Only Item_func::tmp_table_field() was correct, the other two were not. Removing the two incorrect pieces of the redundant code. Joining these three functions/methods into a single virtual method Item::create_tmp_field(). Additionally, moving Item::make_string_field() and Item::tmp_table_field_from_field_type() from the public into the protected section of the class declaration, as they are now not needed outside of Item. --- sql/sql_insert.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d1db45c446e..e27cc6de073 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3892,8 +3892,8 @@ void select_insert::abort_result_set() { Field *Item::create_field_for_create_select(THD *thd, TABLE *table) { Field *def_field, *tmp_field; - return create_tmp_field(thd, table, this, type(), - (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, 0); + return ::create_tmp_field(thd, table, this, type(), + (Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0, 0); } -- cgit v1.2.1