diff options
author | unknown <mikael/pappa@dator5.(none)> | 2006-09-04 11:18:34 -0400 |
---|---|---|
committer | unknown <mikael/pappa@dator5.(none)> | 2006-09-04 11:18:34 -0400 |
commit | 8b50dee746acba1e35e32d99f14a2fff029aa1dd (patch) | |
tree | 36c12c2feab9aa7e48d1dd1965fb41d8484c8af4 /sql/ha_partition.cc | |
parent | 16de51bc0783c8f97fe42e293932e93091c7100f (diff) | |
download | mariadb-git-8b50dee746acba1e35e32d99f14a2fff029aa1dd.tar.gz |
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:
Inserted wrong handlers into the new_file_array which later caused
havoc in rename_partitions
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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 |