Bug #45726 Test case disabled in sys_vars.foreign_key_checks_func.test
Submitted: 24 Jun 2009 19:00
Reporter: Alexander Nozdrin Email Updates:
Status: Verified Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.4 OS:Any
Assigned to: CPU Architecture:Any
Tags: disabled

[24 Jun 2009 19:00] Alexander Nozdrin
Description:
sys_vars.foreign_key_checks_func.test:

# Test disabled as error description is different. The resulting description has
# difference in code #sql-xxx_2 where xxx is different for each run.
#--Error ER_NO_REFERENCED_ROW_2
#ALTER TABLE t2
#ADD CONSTRAINT fk FOREIGN KEY (b) REFERENCES t1 (a);

How to repeat:
*
[13 Dec 2010 5:31] Sandeep Doddaballapur
Following is a description on the issue and the steps to repeat 

 mysql> create database test2;
Query OK, 1 row affected (0.01 sec)

mysql> use test2;
Database changed
mysql> CREATE TABLE t1(a INT PRIMARY KEY)ENGINE = INNODB;
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE t2(a INT PRIMARY KEY,b INT)ENGINE = INNODB;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO t1 values (1),(2),(3);
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> INSERT INTO t2 values (10,1),(20,4);
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> ALTER TABLE t2
    -> ADD CONSTRAINT fk FOREIGN KEY (b) REFERENCES t1 (a);
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test2`.<result 2 when explaining filename '#sql-1355_1'>, CONSTRAINT `fk` FOREIGN KEY (`b`) REFERENCES `t1` (`a`))

The error code : 1452 and sql state code : 23000

The diff in every run will be in "sql-xxxx_x" in the above error line.

The description in the error comment "<result 2 when explaining filename '#sql-1355_1'>" does not clearly describe the comment - needs a change to more clearly explain to user as to whats happening at that place.
[13 Dec 2010 6:38] Anitha Gopi
Staale,
Transferring to you to check if we can have a more meaningful error message.