|
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)
|
|