Bug #16025 Error message [-4005] reports wrong columnname / add foreign key
Submitted: 27 Dec 2005 23:51 Modified: 28 Dec 2005 15:30
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MaxDB Severity:S3 (Non-critical)
Version:Kernel 7.5.0 Build 030-121-100-791 OS:Linux (Linux/RH)
Assigned to: Ulf Wendel CPU Architecture:Any

[27 Dec 2005 23:51] [ name withheld ]
Description:
A statement like 'alter table <tablename> add foreign key <fkname> (<colspec>) references <tablename> (<colspec>) reports the wrong error message (the wrong columnname) as shown by the following example:

If we have two tables a and b as
  create table a (a1 char(1))
  create table b (b1 char(1) key)
the statement
  alter table a add foreign key a_b (a1) references b (b2)
causes the wrong error message (com.sap.dbtech.jdbc.exceptions.DatabaseException): [-4005] (at 54): Unknown column name:A1

of course, the correct errormessage should point to B2 ([-4005] (at 54): Unknown column name:B2)

How to repeat:
  create table a (a1 char(1))
  create table b (b1 char(1) key)
  alter table a add foreign key a_b (a1) references b (b2)
[28 Dec 2005 12:09] Ulf Wendel
Verified - thanks for the report! I'll provide a PTS number (http://sapdb.org/webpts) once it has been filed.

Regards,
Ulf
[28 Dec 2005 15:30] Ulf Wendel
Hi,

you can track the issue on sapdb.org/webpts. The PTS number is 1139515. I've closed the issue on bugs.mysql.com.

Thanks for your support!
Ulf