From e6af62189e4b2979b5d9b6628d71407f45fea751 Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Fri, 10 Jan 2020 23:17:38 +1000 Subject: [PATCH] unify "partitioning cannot do X" error messages --- mysql-test/main/partition.result | 4 ++-- mysql-test/main/partition.test | 4 ++-- mysql-test/main/partition_error.result | 2 +- mysql-test/main/partition_error.test | 2 +- mysql-test/main/partition_innodb.result | 4 ++-- mysql-test/main/partition_innodb.test | 4 ++-- mysql-test/suite/innodb/r/alter_partitioned.result | 2 +- mysql-test/suite/innodb/t/alter_partitioned.test | 2 +- mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result | 2 +- mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test | 2 +- sql/ha_partition.cc | 2 +- sql/share/errmsg-utf8.txt | 6 ++---- sql/sql_partition.cc | 2 +- sql/sql_table.cc | 5 +++-- storage/innobase/handler/ha_innodb.cc | 3 ++- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result index 9861b189c34..b132cf90f2c 100644 --- a/mysql-test/main/partition.result +++ b/mysql-test/main/partition.result @@ -306,7 +306,7 @@ drop table t1; CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a)) ENGINE=MyISAM PARTITION BY HASH (a); -ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning +ERROR HY000: Partitioned tables do not support FOREIGN KEY CREATE TABLE t1 ( pk INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (pk) @@ -1514,7 +1514,7 @@ s1 2 drop table t2; create temporary table t1 (a int) partition by hash(a); -ERROR HY000: Cannot create temporary table with partitions +ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE create table t1 (a int, b int) partition by list (a) (partition p1 values in (1), partition p2 values in (2)); alter table t1 add primary key (b); diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test index c016d201ee2..15f263747fe 100644 --- a/mysql-test/main/partition.test +++ b/mysql-test/main/partition.test @@ -290,7 +290,7 @@ drop table t1; # # Bug#36001: Partitions: spelling and using some error messages # ---error ER_FOREIGN_KEY_ON_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a)) ENGINE=MyISAM PARTITION BY HASH (a); @@ -1422,7 +1422,7 @@ drop table t2; # # Bug #17497: Partitions: crash if add partition on temporary table # ---error ER_PARTITION_NO_TEMPORARY +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING create temporary table t1 (a int) partition by hash(a); # diff --git a/mysql-test/main/partition_error.result b/mysql-test/main/partition_error.result index ee1d6e92c51..5f42064219b 100644 --- a/mysql-test/main/partition_error.result +++ b/mysql-test/main/partition_error.result @@ -754,7 +754,7 @@ ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning # CREATE TABLE t1 (a INT) PARTITION BY HASH(a); CREATE TEMPORARY TABLE tmp_t1 LIKE t1; -ERROR HY000: Cannot create temporary table with partitions +ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE DROP TABLE t1; # # Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with diff --git a/mysql-test/main/partition_error.test b/mysql-test/main/partition_error.test index 8739c93fe92..7436bb060d2 100644 --- a/mysql-test/main/partition_error.test +++ b/mysql-test/main/partition_error.test @@ -788,7 +788,7 @@ PARTITION BY HASH (c) PARTITIONS 4; --echo # with temporary table and partitions --echo # CREATE TABLE t1 (a INT) PARTITION BY HASH(a); ---error ER_PARTITION_NO_TEMPORARY +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING CREATE TEMPORARY TABLE tmp_t1 LIKE t1; DROP TABLE t1; --echo # diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result index 7d7039a8d4a..e212dadd06a 100644 --- a/mysql-test/main/partition_innodb.result +++ b/mysql-test/main/partition_innodb.result @@ -246,10 +246,10 @@ KEY parent_id (parent_id) ) ENGINE=InnoDB; ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1; ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id); -ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning +ERROR HY000: Partitioned tables do not support FOREIGN KEY ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2; ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id); -ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning +ERROR HY000: Partitioned tables do not support FOREIGN KEY DROP TABLE t1, t2; create table t1 (a varchar(5), b int signed, c varchar(10), d datetime) partition by range columns(b,c) diff --git a/mysql-test/main/partition_innodb.test b/mysql-test/main/partition_innodb.test index 16fd7ea60ef..cdf4e257e70 100644 --- a/mysql-test/main/partition_innodb.test +++ b/mysql-test/main/partition_innodb.test @@ -240,12 +240,12 @@ CREATE TABLE t1 ( ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1; ---error ER_FOREIGN_KEY_ON_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id); ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2; ---error ER_FOREIGN_KEY_ON_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id); DROP TABLE t1, t2; diff --git a/mysql-test/suite/innodb/r/alter_partitioned.result b/mysql-test/suite/innodb/r/alter_partitioned.result index ee8233be5c1..1e7ac1dadae 100644 --- a/mysql-test/suite/innodb/r/alter_partitioned.result +++ b/mysql-test/suite/innodb/r/alter_partitioned.result @@ -6,5 +6,5 @@ CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB PARTITION BY RANGE(a) (PARTITION pa VALUES LESS THAN (2), PARTITION pb VALUES LESS THAN (4)); -ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning +ERROR HY000: Partitioned tables do not support FOREIGN KEY DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/alter_partitioned.test b/mysql-test/suite/innodb/t/alter_partitioned.test index 9bf6c8f047a..19b712c2657 100644 --- a/mysql-test/suite/innodb/t/alter_partitioned.test +++ b/mysql-test/suite/innodb/t/alter_partitioned.test @@ -6,7 +6,7 @@ PARTITION BY RANGE(a) (PARTITION pa VALUES LESS THAN (3), PARTITION pb VALUES LESS THAN (5)); ---error ER_FOREIGN_KEY_ON_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB PARTITION BY RANGE(a) (PARTITION pa VALUES LESS THAN (2), diff --git a/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result b/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result index 5cb2cd36d02..a85b286328b 100644 --- a/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result +++ b/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result @@ -4,7 +4,7 @@ CREATE TEMPORARY TABLE t1 (a INT NOT NULL); LOAD DATA INFILE 'x' INTO TABLE x; ERROR 42S02: Table 'test.x' doesn't exist CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x); -ERROR HY000: Cannot create temporary table with partitions +ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE "************** DROP TEMPORARY TABLE Should be present in Binary log **************" include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test b/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test index e75f34b0b56..8624d3c9f1b 100644 --- a/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test +++ b/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test @@ -38,7 +38,7 @@ CREATE TEMPORARY TABLE t1 (a INT NOT NULL); --error ER_NO_SUCH_TABLE LOAD DATA INFILE 'x' INTO TABLE x; ---error ER_PARTITION_NO_TEMPORARY +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x); --echo "************** DROP TEMPORARY TABLE Should be present in Binary log **************" diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 271355e45d6..16000c8afca 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -725,7 +725,7 @@ int ha_partition::create(const char *name, TABLE *table_arg, /* Not allowed to create temporary partitioned tables */ if (create_info && create_info->tmp_table()) { - my_error(ER_PARTITION_NO_TEMPORARY, MYF(0)); + my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), "CREATE TEMPORARY TABLE"); DBUG_RETURN(TRUE); } diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index d406c72d33c..64683023d9d 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -5889,10 +5889,8 @@ ER_PARTITION_MGMT_ON_NONPARTITIONED eng "Partition management on a not partitioned table is not possible" ger "Partitionsverwaltung einer nicht partitionierten Tabelle ist nicht möglich" swe "Partitioneringskommando på en opartitionerad tabell är inte möjligt" -ER_FOREIGN_KEY_ON_PARTITIONED - eng "Foreign key clause is not yet supported in conjunction with partitioning" - ger "Fremdschlüssel-Beschränkungen sind im Zusammenhang mit Partitionierung nicht zulässig" - swe "Foreign key klausul är inte ännu implementerad i kombination med partitionering" +ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING + eng "Partitioned tables do not support %s" ER_DROP_PARTITION_NON_EXISTENT eng "Error in list of partitions to %-.64s" ger "Fehler in der Partitionsliste bei %-.64s" diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index f722dc54fb4..e08432a2318 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4814,7 +4814,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, if (table->part_info && (alter_info->flags & (ALTER_ADD_FOREIGN_KEY | ALTER_DROP_FOREIGN_KEY))) { - my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0)); + my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), "FOREIGN KEY"); DBUG_RETURN(TRUE); } /* Remove partitioning on a not partitioned table is not possible */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1538f26d449..8dcc4e238d3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4724,7 +4724,7 @@ handler *mysql_create_frm_image(THD *thd, const LEX_CSTRING &db, if (create_info->tmp_table()) { - my_error(ER_PARTITION_NO_TEMPORARY, MYF(0)); + my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), "CREATE TEMPORARY TABLE"); goto err; } if ((part_engine_type == partition_hton) && @@ -4850,7 +4850,8 @@ handler *mysql_create_frm_image(THD *thd, const LEX_CSTRING &db, { if (key->type == Key::FOREIGN_KEY) { - my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0)); + my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), + "FOREIGN KEY"); goto err; } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 02722623bf5..d3370c84f99 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12445,7 +12445,8 @@ create_table_info_t::create_foreign_keys() /* How could one make a referenced table to be a * partition? */ ut_ad(0); - my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0)); + my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, + MYF(0), "FOREIGN KEY"); return (DB_CANNOT_ADD_CONSTRAINT); }