Browse Source

unify "partitioning cannot do X" error messages

bb-10.6-MDEV-16983-period-fk
Nikita Malyavin 6 years ago
committed by Sergei Golubchik
parent
commit
e6af62189e
  1. 4
      mysql-test/main/partition.result
  2. 4
      mysql-test/main/partition.test
  3. 2
      mysql-test/main/partition_error.result
  4. 2
      mysql-test/main/partition_error.test
  5. 4
      mysql-test/main/partition_innodb.result
  6. 4
      mysql-test/main/partition_innodb.test
  7. 2
      mysql-test/suite/innodb/r/alter_partitioned.result
  8. 2
      mysql-test/suite/innodb/t/alter_partitioned.test
  9. 2
      mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result
  10. 2
      mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test
  11. 2
      sql/ha_partition.cc
  12. 6
      sql/share/errmsg-utf8.txt
  13. 2
      sql/sql_partition.cc
  14. 5
      sql/sql_table.cc
  15. 3
      storage/innobase/handler/ha_innodb.cc

4
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);

4
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);
#

2
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

2
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 #

4
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)

4
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;

2
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;

2
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),

2
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

2
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 **************"

2
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);
}

6
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"

2
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 */

5
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;
}
}

3
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);
}

Loading…
Cancel
Save