From 0f5df8e1612c97ebdb7959fde62c91a51f796868 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 07:39:35 -0400 Subject: [PATCH] BUG#17455: Wrong results from Repair/Optimize .. table for partitioned tables mysql-test/r/partition.result: New test case mysql-test/t/partition.test: New test case sql/ha_partition.cc: Fixed error handling --- mysql-test/r/partition.result | 10 ++++++++++ mysql-test/t/partition.test | 13 +++++++++++++ sql/ha_partition.cc | 6 ++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 0da071374ea..fbcd688798f 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -886,4 +886,14 @@ s1 2 3 drop table t1; +create table t1 (a int) +engine=MEMORY +partition by key (a); +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note The storage engine for the table doesn't support optimize +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 272cdc27af6..6461f24ffd2 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1009,4 +1009,17 @@ select auto_increment from information_schema.tables where table_name='t1'; select * from t1; drop table t1; +# +# Bug 17455 Partitions: Wrong message and error when using Repair/Optimize +# table on partitioned table +# +create table t1 (a int) +engine=MEMORY +partition by key (a); + +REPAIR TABLE t1; +OPTIMIZE TABLE t1; + +drop table t1; + --echo End of 5.1 tests diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index b1a5a447b6f..abe79fb131d 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1108,8 +1108,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, part)); if ((error= handle_opt_part(thd, check_opt, m_file[part], flag))) { - my_error(ER_GET_ERRNO, MYF(0), error); - DBUG_RETURN(TRUE); + DBUG_RETURN(error); } } while (++j < no_subparts); } @@ -1118,8 +1117,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, DBUG_PRINT("info", ("Optimize partition %u", i)); if ((error= handle_opt_part(thd, check_opt, m_file[i], flag))) { - my_error(ER_GET_ERRNO, MYF(0), error); - DBUG_RETURN(TRUE); + DBUG_RETURN(error); } } }