[MDEV-12100] INSERT silently ignored Created: 2017-02-21  Updated: 2017-03-02  Resolved: 2017-03-02

Status: Closed
Project: MariaDB Server
Component/s: Triggers
Affects Version/s: 10.1.21
Fix Version/s: 10.1.22, 10.2.5

Type: Bug Priority: Critical
Reporter: Christian Rishøj Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu 16.04.2 LTS


Attachments: File ignored_insert.sql     File my.cnf    
Issue Links:
Duplicate
is duplicated by MDEV-11842 Fail to insert on a table where a fie... Closed

 Description   

The following test case reproduces an issue where an INSERT is silently ignored by MariaDB. Rather than actually inserting the row, or reporting a foreign key error, the insert apparently succeeds with the spurious message "0 rows affected".

Actual result from the last two INSERTs in the attached SQL script:

Query OK, 0 rows affected (0.00 sec)
 
Query OK, 0 rows affected (0.00 sec)

After dropping the trigger, the INSERTs work as expected:

Query OK, 1 row affected, 3 warnings (0.01 sec)
 
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`supplierItems`, CONSTRAINT `supplierItems_ibfk_2` FOREIGN KEY (`itemId`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)



 Comments   
Comment by Elena Stepanova [ 2017-02-21 ]

It appears to be a duplicate of MDEV-11842.

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