diff options
author | Nikita Malyavin <nikitamalyavin@gmail.com> | 2020-01-10 23:17:38 +1000 |
---|---|---|
committer | Nikita Malyavin <nikitamalyavin@gmail.com> | 2020-02-21 13:49:32 +1000 |
commit | 5887de00e9e3015aab0ae6def6dc147a6a3c0e0d (patch) | |
tree | 84f839cb3c848374b26159d780e8dc5e6a0f84f7 | |
parent | 58e8cf889ee0c856d8d4fde441474231cd4c7997 (diff) | |
download | mariadb-git-5887de00e9e3015aab0ae6def6dc147a6a3c0e0d.tar.gz |
fix error messages
-rw-r--r-- | mysql-test/main/partition.result | 4 | ||||
-rw-r--r-- | mysql-test/main/partition.test | 4 | ||||
-rw-r--r-- | mysql-test/main/partition_error.result | 2 | ||||
-rw-r--r-- | mysql-test/main/partition_error.test | 2 | ||||
-rw-r--r-- | mysql-test/main/partition_innodb.result | 4 | ||||
-rw-r--r-- | mysql-test/main/partition_innodb.test | 4 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/alter_partitioned.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/alter_partitioned.test | 2 | ||||
-rw-r--r-- | mysql-test/suite/period/r/overlaps.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/period/t/overlaps.test | 6 | ||||
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test | 2 | ||||
-rw-r--r-- | sql/ha_partition.cc | 2 | ||||
-rw-r--r-- | sql/share/errmsg-utf8.txt | 12 | ||||
-rw-r--r-- | sql/sql_partition.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 11 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 3 |
17 files changed, 37 insertions, 37 deletions
diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result index 5a7795394ec..571ae0f94c5 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 89db3e92162..96dfbb8cfd4 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 090e74b6079..6f90457f5b7 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 1a05ce6e20d..fece1fa7911 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/period/r/overlaps.result b/mysql-test/suite/period/r/overlaps.result index ed62fa16779..e6de0123292 100644 --- a/mysql-test/suite/period/r/overlaps.result +++ b/mysql-test/suite/period/r/overlaps.result @@ -70,7 +70,7 @@ ERROR HY000: Period `p` is not found in table create or replace table t(id int, s date, e date, period for p(s,e), primary key(id, s, p without overlaps)); -ERROR HY000: Key `(null)` should not contain period fields in order to make it WITHOUT OVERLAPS +ERROR HY000: Key `(null)` cannot explicitly include column `s` create or replace table t(id int, s date, e date, period for p(s,e), primary key(id)); @@ -155,18 +155,18 @@ create or replace table t1 (x int, s date, e date, period for p(s,e), primary key(x, p without overlaps) ) partition by key (x); -ERROR HY000: Period WITHOUT OVERLAPS is not implemented for partitioned tables +ERROR HY000: Partitioned tables do not support WITHOUT OVERLAPS create or replace table t1 (x int, s date, e date, period for p(s,e), primary key(x, p without overlaps)); alter table t1 partition by key (x); -ERROR HY000: Period WITHOUT OVERLAPS is not implemented for partitioned tables +ERROR HY000: Partitioned tables do not support WITHOUT OVERLAPS create or replace table t1 (x int, s date, e date, period for p (s, e)) partition by hash (x); alter table t1 add primary key (x, p without overlaps); -ERROR HY000: Period WITHOUT OVERLAPS is not implemented for partitioned tables +ERROR HY000: Partitioned tables do not support WITHOUT OVERLAPS create or replace table t2 (x int, s date, e date, period for p (s, e), key(x, p without overlaps)); -ERROR HY000: Period WITHOUT OVERLAPS is only allowed for unique keys +ERROR HY000: Only UNIQUE or PRIMARY keys can be WITHOUT OVERLAPS create or replace database test; diff --git a/mysql-test/suite/period/t/overlaps.test b/mysql-test/suite/period/t/overlaps.test index 1fd06db1cd5..d89b8bb2b87 100644 --- a/mysql-test/suite/period/t/overlaps.test +++ b/mysql-test/suite/period/t/overlaps.test @@ -139,7 +139,7 @@ create or replace table t1 like t; --replace_result $default_engine DEFAULT_ENGINE show create table t1; ---error ER_PERIOD_WITHOUT_OVERLAPS_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING create or replace table t1 (x int, s date, e date, period for p(s,e), primary key(x, p without overlaps) @@ -148,12 +148,12 @@ create or replace table t1 (x int, s date, e date, create or replace table t1 (x int, s date, e date, period for p(s,e), primary key(x, p without overlaps)); ---error ER_PERIOD_WITHOUT_OVERLAPS_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING alter table t1 partition by key (x); create or replace table t1 (x int, s date, e date, period for p (s, e)) partition by hash (x); ---error ER_PERIOD_WITHOUT_OVERLAPS_PARTITIONED +--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING alter table t1 add primary key (x, p without overlaps); --error ER_PERIOD_WITHOUT_OVERLAPS_NON_UNIQUE 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 d36a58aef20..53de2fd087a 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -711,7 +711,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 d9427c27606..ca9ea42e3e3 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" @@ -7946,8 +7944,6 @@ ER_PART_STARTS_BEYOND_INTERVAL ER_GALERA_REPLICATION_NOT_SUPPORTED eng "DDL-statement is forbidden as table storage engine does not support Galera replication" ER_KEY_CONTAINS_PERIOD_FIELDS - eng "Key %`s should not contain period fields in order to make it WITHOUT OVERLAPS" -ER_PERIOD_WITHOUT_OVERLAPS_PARTITIONED - eng "Period WITHOUT OVERLAPS is not implemented for partitioned tables" + eng "Key %`s cannot explicitly include column %`s" ER_PERIOD_WITHOUT_OVERLAPS_NON_UNIQUE - eng "Period WITHOUT OVERLAPS is only allowed for unique keys" + eng "Only UNIQUE or PRIMARY keys can be WITHOUT OVERLAPS" diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 5885e3715bf..eee9c248951 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4815,7 +4815,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 0b4719e3db4..b1633eacb95 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4591,7 +4591,8 @@ static bool append_system_key_parts(THD *thd, HA_CREATE_INFO *create_info, { // Unfortunately partitions do not support searching upper/lower bounds // (i.e. ha_index_read_map with KEY_OR_PREV, KEY_OR_NEXT) - my_error(ER_PERIOD_WITHOUT_OVERLAPS_PARTITIONED, MYF(0)); + my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), + "WITHOUT OVERLAPS"); return true; } const auto &period_start= create_info->period_info.period.start; @@ -4602,7 +4603,8 @@ static bool append_system_key_parts(THD *thd, HA_CREATE_INFO *create_info, if (period_start.streq(key_part->field_name) || period_end.streq(key_part->field_name)) { - my_error(ER_KEY_CONTAINS_PERIOD_FIELDS, MYF(0), key->name.str); + my_error(ER_KEY_CONTAINS_PERIOD_FIELDS, MYF(0), key->name.str, + key_part->field_name); return true; } } @@ -4715,7 +4717,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) && @@ -4841,7 +4843,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 a36cc87a201..7db85780beb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12454,7 +12454,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); } |