Wrong warning message during foreign key creation failure (not compatible charset)
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Triaged
|
Medium
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
Percona Server 5.6 report misleading warning when foreign key creation fails due to incompatible foreign key character set.
Reproduction:
test> create table a(id varchar(1) character set utf8mb4, primary key(id));
test> create table b(id varchar(1) character set utf8, b_id varchar(1) character set utf8, primary key(id), CONSTRAINT a_fkey FOREIGN KEY (b_id) REFERENCES a (id));
ERROR 1215 (HY000): Cannot add foreign key constraint
test> show warnings
```
root@perconatra
+------
| Level | Code | Message |
+------
| Warning | 150 | Create table 'test/b' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns.
|
| Error | 1215 | Cannot add foreign key constraint |
+------
2 rows in set (0.00 sec)
```
Expected:
Something more meaningful than column not appearing in index a first column.
Changed in percona-server: | |
assignee: | nobody → Sveta Smirnova (svetasmirnova) |
Tested on Percona server 5.6.36