[MDEV-6697] Improve foreign keys warnings/errors Created: 2014-09-04  Updated: 2015-08-05  Resolved: 2015-08-05

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Fix Version/s: 5.5.45

Type: Task Priority: Major
Reporter: roberto spadim Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: upstream

Issue Links:
Blocks
is blocked by MDEV-6113 merge 5.7 innodb Closed
Sprint: 5.5.45, 10.1.7-1

 Description   

Hi guys, we should check if this should be merged or not from mysql
http://bugs.mysql.com/bug.php?id=73757

probably a document bug, or maybe not, just check to don't leave dba searching were is the erro, include a "create table report errors at show warnings about foreign keys" or something like this



 Comments   
Comment by Jan Lindström (Inactive) [ 2015-07-29 ]

Fix on 5.7 seems to me unsatisfactory :

mysql> create table t2(a int, constraint a foreign key a (a) references t1(a))engine=innodb;
ERROR 1215 (HY000): Cannot add foreign key constraint
mysql> show warnings\G
*************************** 1. row ***************************
  Level: Warning
   Code: 150
Message: Create table 'test/t2' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns.

This is unclear when there is more than one foreign key on table test/t2.

Comment by Jan Lindström (Inactive) [ 2015-07-30 ]

I can't change actual error messages on GA product. However, I can add additional or improved error messages to show warnings.

Generated at Thu Feb 08 07:13:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.