From 814b81ad6b8583fdaa67fa2c6999feac0a5a0a26 Mon Sep 17 00:00:00 2001 From: "mikael/pappa@dator5.(none)" <> Date: Mon, 4 Sep 2006 11:18:34 -0400 Subject: [PATCH] BUG#21210: ALTER TABLE t1 REORGANIZE PARTITION crashes when using InnoDB Inserted wrong handlers into the new_file_array which later caused havoc in rename_partitions --- sql/ha_partition.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 30c64760c88..377f5dbc83c 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1360,6 +1360,7 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, i= 0; part_count= 0; orig_count= 0; + first= TRUE; part_it.rewind(); do { @@ -1387,9 +1388,16 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, DBUG_RETURN(ER_OUTOFMEMORY); } } while (++j < no_subparts); + if (part_elem->part_state == PART_CHANGED) + orig_count+= no_subparts; + else if (temp_partitions && first) + { + orig_count+= (no_subparts * temp_partitions); + first= FALSE; + } } } while (++i < no_parts); - + first= FALSE; /* Step 5: Create the new partitions and also open, lock and call external_lock