Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.45
-
None
Description
MDEV-6697 introduced a bunch of new warning messages, many of which are totally confusing. No matter how hard I try, I cannot understand what they mean, it's very frustrating.
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
alter table t1 add foreign key(a,b) references t1(a);
|
|
Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Foreign key constraint parse error in foreign key(a,b) references t1(a) close to ). Too few referenced columns, you have 1 when you should have 2.
|
What close to what? What does the right bracket relate to?
Error in foreign key? Error in references?
create table t1(a int not null primary key, b int, key(b)) engine=innodb;
|
alter table t1 add foreign key(a) references t1(a,b);
|
|
| Warning | 150 | Alter table `test`.`t1` with foreign key constraint failed. Foreign key constraint parse error in foreign key(a) references t1(a,b) close to ). Too few referenced columns, you have 2 when you should have 1. |
|
How can it be too few if I have more than I should have?
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
|
...
|
| Warning | 150 | Create table `tmp`.`t2` with foreign key constraint failed. Referenced table `tmp`.`t1` not found in the data dictionary close to foreign key(a) references t1(a)) engine=innodb. |
|
Again, what close to what? Data dictionary to foreign keys? Referenced table to foreign keys?
And I never referenced `tmp`.`t1` – yes, I can guess why it appeared there, but it's still wrong.
...
Hi, I see, if you have suggestions on how to make these more readable that would be more than welcomed. Messages like near xxxx, mean that parser has found something unexpected starting on that string, it could be or not be the exactly the correct place where something is wrong.