diff options
author | unknown <mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-05-10 12:53:40 -0400 |
---|---|---|
committer | unknown <mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-05-10 12:53:40 -0400 |
commit | 4e3f4e970f6476d3b6b79077e26ddcb5a24ef80a (patch) | |
tree | 15485e03be56b9839d6e8ab9f610939e568fad1b /sql/sql_partition.cc | |
parent | 3065eeb3f8cff732e1a462b58996105881c7ca88 (diff) | |
download | mariadb-git-4e3f4e970f6476d3b6b79077e26ddcb5a24ef80a.tar.gz |
BUG#19010: Fix issues with that ALTER TABLE from auto-partitioned NDB table doesn't work unless primary key exists on table.
mysql-test/r/ndb_bitfield.result:
Test cases changes now that auto-partitioning is remembered in frm file
mysql-test/r/ndb_dd_basic.result:
Test cases changes now that auto-partitioning is remembered in frm file
mysql-test/r/ndb_dd_disk2memory.result:
Test cases changes now that auto-partitioning is remembered in frm file
mysql-test/r/ndb_gis.result:
Test cases changes now that auto-partitioning is remembered in frm file
mysql-test/r/ndb_partition_key.result:
New test cases for auto-partitioning change that was made to fix bug
mysql-test/r/rpl_ndb_UUID.result:
Test cases changes now that auto-partitioning is remembered in frm file
mysql-test/r/rpl_ndb_dd_advance.result:
Test cases changes now that auto-partitioning is remembered in frm file
mysql-test/t/ndb_partition_key.test:
New test cases for auto-partitioning change that was made to fix bug
sql/partition_info.h:
New boolean to keep track of auto partitioned or not
sql/sql_partition.cc:
Ensure that auto-partitiong flag is reset when partitions are dropped, added, reorganised or coalesced.
Ensure that auto-partitioned tables are altered into non-partitioned table when ALTER TABLE t1 engine=X
is performed.
sql/sql_show.cc:
Only print partition info for non-auto-partitioned tables
sql/sql_table.cc:
Set auto partition flag when auto partitions are generated in create table
sql/table.cc:
Fix reading of frm file where new auto-partition flag is introduced.
sql/table.h:
New flag for auto partition on share object
sql/unireg.cc:
Fix code for writing frm to also write autopartition flag at end of partition info, fix some length issues
at the same time that was in this part that caused no problems since partition info always was the last info
in the file.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 0442ad724d2..cc580578c7e 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4075,6 +4075,7 @@ that are reorganised. tab_part_info->use_default_partitions= FALSE; } tab_part_info->use_default_no_partitions= FALSE; + tab_part_info->is_auto_partitioned= FALSE; } } else if (alter_info->flags == ALTER_DROP_PARTITION) @@ -4090,6 +4091,8 @@ that are reorganised. uint no_parts_dropped= alter_info->partition_names.elements; uint no_parts_found= 0; List_iterator<partition_element> part_it(tab_part_info->partitions); + + tab_part_info->is_auto_partitioned= FALSE; if (!(tab_part_info->part_type == RANGE_PARTITION || tab_part_info->part_type == LIST_PARTITION)) { @@ -4274,7 +4277,10 @@ state of p1. tab_part_info->no_parts= no_parts_remain; } if (!(alter_info->flags & ALTER_TABLE_REORG)) + { tab_part_info->use_default_no_partitions= FALSE; + tab_part_info->is_auto_partitioned= FALSE; + } } else if (alter_info->flags == ALTER_REORGANIZE_PARTITION) { @@ -4293,6 +4299,8 @@ state of p1. uint no_parts_new= thd->work_part_info->partitions.elements; partition_info *alt_part_info= thd->work_part_info; uint check_total_partitions; + + tab_part_info->is_auto_partitioned= FALSE; if (no_parts_reorged > tab_part_info->no_parts) { my_error(ER_REORG_PARTITION_NOT_EXIST, MYF(0)); @@ -4533,7 +4541,22 @@ the generated partition syntax in a correct manner. Make sure change of engine happens to all partitions. */ DBUG_PRINT("info", ("partition changed")); - set_engine_all_partitions(thd->work_part_info, create_info->db_type); + if (table->part_info->is_auto_partitioned) + { + /* + If the user originally didn't specify partitioning to be + used we can remove it now. + */ + thd->work_part_info= NULL; + } + else + { + /* + Ensure that all partitions have the proper engine set-up + */ + set_engine_all_partitions(thd->work_part_info, + create_info->db_type); + } *partition_changed= TRUE; } } |