Bug #38503 Constraint violation not reported
Submitted: 31 Jul 2008 19:58 Modified: 31 Aug 2008 20:43
Reporter: John Baker Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.051b OS:MacOS
Assigned to: CPU Architecture:Any

[31 Jul 2008 19:58] John Baker
Description:

On Mac OSX 10.4, 5.051b Executing a script was successful, but this should have failed.

 http://wiki.netbeans.org/attach/MySQL_jbaker/create-sample.sql

Using MySQL server 5.1.26-rc-community and supplied with NetBeans MySQL driver mysql-connector-java-5.1.5. 

Correctly reported the error

Result: "com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a
foreign key constraint fails (`sample`.`#sql-270_a`, CONSTRAINT `#sql-270_a_ibfk_1` FOREIGN KEY (`customer_id`)
REFERENCES `customer` (`customer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION)"

How to repeat:

Open  http://wiki.netbeans.org/attach/MySQL_jbaker/create-sample.sql
and execute.

On Mac OSX, execution is successful, but should have failed
[31 Jul 2008 20:43] Sveta Smirnova
Thank you for the report.

Please provide output of SHOW VARIABLES LIKE 'storage_engine'
[31 Aug 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".