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/unireg.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/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index bbb4d970d37..58c8123c98e 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -130,8 +130,14 @@ bool mysql_create_frm(THD *thd, const char *file_name, /* str_db_type */ create_info->extra_size= (2 + str_db_type.length + 2 + create_info->connect_string.length); - /* Partition */ - create_info->extra_size+= 9; + /* + Partition: + Length of partition info = 4 byte + Potential NULL byte at end of partition info string = 1 byte + Indicator if auto-partitioned table = 1 byte + => Total 6 byte + */ + create_info->extra_size+= 6; #ifdef WITH_PARTITION_STORAGE_ENGINE if (part_info) { @@ -203,17 +209,19 @@ bool mysql_create_frm(THD *thd, const char *file_name, #ifdef WITH_PARTITION_STORAGE_ENGINE if (part_info) { + char auto_partitioned= part_info->is_auto_partitioned ? 1 : 0; int4store(buff, part_info->part_info_len); if (my_write(file, (const byte*)buff, 4, MYF_RW) || my_write(file, (const byte*)part_info->part_info_string, - part_info->part_info_len + 1, MYF_RW)) + part_info->part_info_len + 1, MYF_RW) || + my_write(file, (const byte*)&auto_partitioned, 1, MYF_RW)) goto err; } else #endif { - bzero(buff, 9); - if (my_write(file, (byte*) buff, 9, MYF_RW)) + bzero(buff, 6); + if (my_write(file, (byte*) buff, 6, MYF_RW)) goto err; } for (i= 0; i < keys; i++) |