summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorunknown <mattiasj@mattias-jonssons-macbook.local>2007-11-20 11:21:00 +0100
committerunknown <mattiasj@mattias-jonssons-macbook.local>2007-11-20 11:21:00 +0100
commit4b71b92711fad6ca71e31890068763fab5f4090d (patch)
treefeeac50020914d1a4642df600d412a328930cb18 /sql/ha_partition.cc
parent6fcc984eb8c401a53cc0c450508b8688db9dfa0e (diff)
downloadmariadb-git-4b71b92711fad6ca71e31890068763fab5f4090d.tar.gz
Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault
Problem was for LINEAR HASH/KEY. Crashes because of wrong partition id returned when creating the new altered partitions. (because of wrong linear hash mask) Solution: Update the linear hash mask before using it for the new altered table. mysql-test/r/partition_hash.result: Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault test result mysql-test/t/partition_hash.test: Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentatition fault test case sql/ha_partition.cc: Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault Updating the linear hash mask before using it. sql/sql_partition.cc: Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault exporting the set_linear_hash_mask function (static -> non static) sql/sql_partition.h: Bug#30822: ALTER TABLE COALESCE PARTITION causes segmentation fault exporting the set_linear_hash_mask function (static -> non static)
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index b53a5e3da97..d1b20896d9a 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1531,6 +1531,14 @@ int ha_partition::copy_partitions(ulonglong *copied, ulonglong *deleted)
longlong func_value;
DBUG_ENTER("ha_partition::copy_partitions");
+ if (m_part_info->linear_hash_ind)
+ {
+ if (m_part_info->part_type == HASH_PARTITION)
+ set_linear_hash_mask(m_part_info, m_part_info->no_parts);
+ else
+ set_linear_hash_mask(m_part_info, m_part_info->no_subparts);
+ }
+
while (reorg_part < m_reorged_parts)
{
handler *file= m_reorged_file[reorg_part];