mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixes during review of new pushed code:
Remove wrong fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash Safety fix for bug #13855 "select distinct with group by caused server crash" client/mysqlimport.c: Remove not used variable myisam/myisam_ftdump.c: Fixed compiler warning sql/item_cmpfunc.cc: Removed compiler warning sql/sql_handler.cc: Remove wrong fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash. It's better to let mysql_lock_tables reopen the TABLE object in case of OPTIMIZE TABLE and fix items AFTER mysql_lock_table() instead of before sql/sql_select.cc: Safety fix for bug #13855 "select distinct with group by caused server crash" The previous patch only removed the symptomps, this fix removed the cause of the problem (Which was that not all hidden_fields was stored in the temporary table)
This commit is contained in:
@ -4082,7 +4082,14 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
*(reg_field++) =new_field;
|
||||
}
|
||||
if (!--hidden_field_count)
|
||||
{
|
||||
hidden_null_count=null_count;
|
||||
/*
|
||||
We need to update hidden_field_count as we may have stored group
|
||||
functions with constant arguments
|
||||
*/
|
||||
param->hidden_field_count= (uint) (reg_field - table->field);
|
||||
}
|
||||
}
|
||||
DBUG_ASSERT(field_count >= (uint) (reg_field - table->field));
|
||||
field_count= (uint) (reg_field - table->field);
|
||||
@ -4270,7 +4277,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
}
|
||||
}
|
||||
|
||||
if (distinct)
|
||||
if (distinct && field_count != param->hidden_field_count)
|
||||
{
|
||||
/*
|
||||
Create an unique key or an unique constraint over all columns
|
||||
|
Reference in New Issue
Block a user