From 9a132fa76c50c09c77989443d8609b858f634b98 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 12 Aug 2013 11:09:33 +0200 Subject: [PATCH] Bug#16860588:CRASH WITH CREATE TABLE ... LIKE .. AND PARTITION VALUES IN (NULL) The code assumed there was at least one list element in LIST partitioned table. Fixed by checking the number of list elements. --- sql/partition_info.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 7272978df1d..958f77f5bd0 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2214,11 +2214,10 @@ int partition_info::fix_parser_data(THD *thd) { part_elem= it++; List_iterator list_val_it(part_elem->list_val_list); - j= 0; num_elements= part_elem->list_val_list.elements; DBUG_ASSERT(part_type == RANGE_PARTITION ? num_elements == 1U : TRUE); - do + for (j= 0; j < num_elements; j++) { part_elem_value *val= list_val_it++; if (column_list) @@ -2253,7 +2252,7 @@ int partition_info::fix_parser_data(THD *thd) list_val_it.remove(); } } - } while (++j < num_elements); + } } while (++i < num_parts); DBUG_RETURN(FALSE); }