Skip to content

Commit e6af621

Browse files
FooBarriorvuvova
authored andcommitted
unify "partitioning cannot do X" error messages
1 parent 3bef848 commit e6af621

15 files changed

+23
-23
lines changed

mysql-test/main/partition.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ drop table t1;
306306
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
307307
ENGINE=MyISAM
308308
PARTITION BY HASH (a);
309-
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
309+
ERROR HY000: Partitioned tables do not support FOREIGN KEY
310310
CREATE TABLE t1 (
311311
pk INT NOT NULL AUTO_INCREMENT,
312312
PRIMARY KEY (pk)
@@ -1514,7 +1514,7 @@ s1
15141514
2
15151515
drop table t2;
15161516
create temporary table t1 (a int) partition by hash(a);
1517-
ERROR HY000: Cannot create temporary table with partitions
1517+
ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
15181518
create table t1 (a int, b int) partition by list (a)
15191519
(partition p1 values in (1), partition p2 values in (2));
15201520
alter table t1 add primary key (b);

mysql-test/main/partition.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ drop table t1;
290290
#
291291
# Bug#36001: Partitions: spelling and using some error messages
292292
#
293-
--error ER_FOREIGN_KEY_ON_PARTITIONED
293+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
294294
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
295295
ENGINE=MyISAM
296296
PARTITION BY HASH (a);
@@ -1422,7 +1422,7 @@ drop table t2;
14221422
#
14231423
# Bug #17497: Partitions: crash if add partition on temporary table
14241424
#
1425-
--error ER_PARTITION_NO_TEMPORARY
1425+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
14261426
create temporary table t1 (a int) partition by hash(a);
14271427

14281428
#

mysql-test/main/partition_error.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
754754
#
755755
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
756756
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
757-
ERROR HY000: Cannot create temporary table with partitions
757+
ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
758758
DROP TABLE t1;
759759
#
760760
# Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with

mysql-test/main/partition_error.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ PARTITION BY HASH (c) PARTITIONS 4;
788788
--echo # with temporary table and partitions
789789
--echo #
790790
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
791-
--error ER_PARTITION_NO_TEMPORARY
791+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
792792
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
793793
DROP TABLE t1;
794794
--echo #

mysql-test/main/partition_innodb.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ KEY parent_id (parent_id)
246246
) ENGINE=InnoDB;
247247
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1;
248248
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
249-
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
249+
ERROR HY000: Partitioned tables do not support FOREIGN KEY
250250
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2;
251251
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
252-
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
252+
ERROR HY000: Partitioned tables do not support FOREIGN KEY
253253
DROP TABLE t1, t2;
254254
create table t1 (a varchar(5), b int signed, c varchar(10), d datetime)
255255
partition by range columns(b,c)

mysql-test/main/partition_innodb.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ CREATE TABLE t1 (
240240

241241
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1;
242242

243-
--error ER_FOREIGN_KEY_ON_PARTITIONED
243+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
244244
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
245245

246246
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2;
247247

248-
--error ER_FOREIGN_KEY_ON_PARTITIONED
248+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
249249
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
250250

251251
DROP TABLE t1, t2;

mysql-test/suite/innodb/r/alter_partitioned.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
66
PARTITION BY RANGE(a)
77
(PARTITION pa VALUES LESS THAN (2),
88
PARTITION pb VALUES LESS THAN (4));
9-
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
9+
ERROR HY000: Partitioned tables do not support FOREIGN KEY
1010
DROP TABLE t1;

mysql-test/suite/innodb/t/alter_partitioned.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PARTITION BY RANGE(a)
66
(PARTITION pa VALUES LESS THAN (3),
77
PARTITION pb VALUES LESS THAN (5));
88

9-
--error ER_FOREIGN_KEY_ON_PARTITIONED
9+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
1010
CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
1111
PARTITION BY RANGE(a)
1212
(PARTITION pa VALUES LESS THAN (2),

mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CREATE TEMPORARY TABLE t1 (a INT NOT NULL);
44
LOAD DATA INFILE 'x' INTO TABLE x;
55
ERROR 42S02: Table 'test.x' doesn't exist
66
CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);
7-
ERROR HY000: Cannot create temporary table with partitions
7+
ERROR HY000: Partitioned tables do not support CREATE TEMPORARY TABLE
88
"************** DROP TEMPORARY TABLE Should be present in Binary log **************"
99
include/show_binlog_events.inc
1010
Log_name Pos Event_type Server_id End_log_pos Info

mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CREATE TEMPORARY TABLE t1 (a INT NOT NULL);
3838
--error ER_NO_SUCH_TABLE
3939
LOAD DATA INFILE 'x' INTO TABLE x;
4040

41-
--error ER_PARTITION_NO_TEMPORARY
41+
--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
4242
CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x);
4343

4444
--echo "************** DROP TEMPORARY TABLE Should be present in Binary log **************"

sql/ha_partition.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ int ha_partition::create(const char *name, TABLE *table_arg,
725725
/* Not allowed to create temporary partitioned tables */
726726
if (create_info && create_info->tmp_table())
727727
{
728-
my_error(ER_PARTITION_NO_TEMPORARY, MYF(0));
728+
my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), "CREATE TEMPORARY TABLE");
729729
DBUG_RETURN(TRUE);
730730
}
731731

sql/share/errmsg-utf8.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5889,10 +5889,8 @@ ER_PARTITION_MGMT_ON_NONPARTITIONED
58895889
eng "Partition management on a not partitioned table is not possible"
58905890
ger "Partitionsverwaltung einer nicht partitionierten Tabelle ist nicht möglich"
58915891
swe "Partitioneringskommando på en opartitionerad tabell är inte möjligt"
5892-
ER_FOREIGN_KEY_ON_PARTITIONED
5893-
eng "Foreign key clause is not yet supported in conjunction with partitioning"
5894-
ger "Fremdschlüssel-Beschränkungen sind im Zusammenhang mit Partitionierung nicht zulässig"
5895-
swe "Foreign key klausul är inte ännu implementerad i kombination med partitionering"
5892+
ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
5893+
eng "Partitioned tables do not support %s"
58965894
ER_DROP_PARTITION_NON_EXISTENT
58975895
eng "Error in list of partitions to %-.64s"
58985896
ger "Fehler in der Partitionsliste bei %-.64s"

sql/sql_partition.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4814,7 +4814,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
48144814
if (table->part_info && (alter_info->flags & (ALTER_ADD_FOREIGN_KEY |
48154815
ALTER_DROP_FOREIGN_KEY)))
48164816
{
4817-
my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0));
4817+
my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), "FOREIGN KEY");
48184818
DBUG_RETURN(TRUE);
48194819
}
48204820
/* Remove partitioning on a not partitioned table is not possible */

sql/sql_table.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4724,7 +4724,7 @@ handler *mysql_create_frm_image(THD *thd, const LEX_CSTRING &db,
47244724

47254725
if (create_info->tmp_table())
47264726
{
4727-
my_error(ER_PARTITION_NO_TEMPORARY, MYF(0));
4727+
my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0), "CREATE TEMPORARY TABLE");
47284728
goto err;
47294729
}
47304730
if ((part_engine_type == partition_hton) &&
@@ -4850,7 +4850,8 @@ handler *mysql_create_frm_image(THD *thd, const LEX_CSTRING &db,
48504850
{
48514851
if (key->type == Key::FOREIGN_KEY)
48524852
{
4853-
my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0));
4853+
my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING, MYF(0),
4854+
"FOREIGN KEY");
48544855
goto err;
48554856
}
48564857
}

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12445,7 +12445,8 @@ create_table_info_t::create_foreign_keys()
1244512445
/* How could one make a referenced table to be a
1244612446
* partition? */
1244712447
ut_ad(0);
12448-
my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0));
12448+
my_error(ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING,
12449+
MYF(0), "FOREIGN KEY");
1244912450
return (DB_CANNOT_ADD_CONSTRAINT);
1245012451
}
1245112452

0 commit comments

Comments
 (0)