diff options
author | unknown <pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-03-22 10:52:12 -0500 |
---|---|---|
committer | unknown <pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-03-22 10:52:12 -0500 |
commit | 81a463adeb9c5c3ed1dd6162cc097c93927156cb (patch) | |
tree | a49bb89a31363161657850ef24f668373508a61b | |
parent | 1c6f84f8284a297c166c1a53ab117df9b9a5239c (diff) | |
download | mariadb-git-81a463adeb9c5c3ed1dd6162cc097c93927156cb.tar.gz |
OPTIMIZE, ANALYZE, CHECK, REPAIR and REBUILD only supported if fast_alter_partition flag set
mysql-test/r/ndb_partition_key.result:
New test cases for BUG #16819, 16821, and 16822
mysql-test/t/ndb_partition_key.test:
New test cases for BUG #16819, 16821, and 16822
sql/handler.h:
ensure we don't get hanging after calling change_partition
-rw-r--r-- | mysql-test/r/ndb_partition_key.result | 14 | ||||
-rw-r--r-- | mysql-test/t/ndb_partition_key.test | 19 | ||||
-rw-r--r-- | sql/handler.h | 2 | ||||
-rw-r--r-- | sql/sql_partition.cc | 5 |
4 files changed, 39 insertions, 1 deletions
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result index 87b019c83e2..121bbe45ead 100644 --- a/mysql-test/r/ndb_partition_key.result +++ b/mysql-test/r/ndb_partition_key.result @@ -165,3 +165,17 @@ ENGINE=NDB PARTITION BY KEY(c3) PARTITIONS 5; ALTER TABLE t1 COALESCE PARTITION 4; DROP TABLE t1; +CREATE TABLE t1 (a int primary key) +ENGINE=NDB +PARTITION BY KEY(a); +ALTER TABLE t1 OPTIMIZE PARTITION p0; +ERROR HY000: Table storage engine for 't1' doesn't have this option +ALTER TABLE t1 CHECK PARTITION p0; +ERROR HY000: Table storage engine for 't1' doesn't have this option +ALTER TABLE t1 REPAIR PARTITION p0; +ERROR HY000: Table storage engine for 't1' doesn't have this option +ALTER TABLE t1 ANALYZE PARTITION p0; +ERROR HY000: Table storage engine for 't1' doesn't have this option +ALTER TABLE t1 REBUILD PARTITION p0; +ERROR HY000: Table storage engine for 't1' doesn't have this option +DROP TABLE t1; diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/t/ndb_partition_key.test index d43dc7e49e4..0fd99f8674e 100644 --- a/mysql-test/t/ndb_partition_key.test +++ b/mysql-test/t/ndb_partition_key.test @@ -153,3 +153,22 @@ b'0', ALTER TABLE t1 COALESCE PARTITION 4; DROP TABLE t1; + +# +# Bug 16822: OPTIMIZE TABLE hangs test +# +CREATE TABLE t1 (a int primary key) +ENGINE=NDB +PARTITION BY KEY(a); +--error 1031 +ALTER TABLE t1 OPTIMIZE PARTITION p0; +--error 1031 +ALTER TABLE t1 CHECK PARTITION p0; +--error 1031 +ALTER TABLE t1 REPAIR PARTITION p0; +--error 1031 +ALTER TABLE t1 ANALYZE PARTITION p0; +--error 1031 +ALTER TABLE t1 REBUILD PARTITION p0; +DROP TABLE t1; + diff --git a/sql/handler.h b/sql/handler.h index a7a12c225d4..50088af1d28 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1387,7 +1387,7 @@ public: ulonglong *deleted, const void *pack_frm_data, uint pack_frm_len) - { return HA_ERR_WRONG_COMMAND; } + { print_error(HA_ERR_WRONG_COMMAND, MYF(0)); return TRUE; } virtual int drop_partitions(const char *path) { return HA_ERR_WRONG_COMMAND; } virtual int rename_partitions(const char *path) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 57e6a986987..552c99518b7 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4499,6 +4499,11 @@ that are reorganised. my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), ptr); DBUG_RETURN(TRUE); } + if (!(*fast_alter_partition)) + { + table->file->print_error(HA_ERR_WRONG_COMMAND, MYF(0)); + DBUG_RETURN(TRUE); + } } else if (alter_info->flags & ALTER_COALESCE_PARTITION) { |