[Maria-discuss] INSERT IGNORE and triggers
![](https://secure.gravatar.com/avatar/06fb7e7f8217ef0e572a8334567b7559.jpg?s=120&d=mm&r=g)
Hello. As we all know, IGNORE "catches" some errors and turns them into warnings. But I've noticed that it does not catch the same errors if they were issued by a trigger (using SIGNAL). * Is this by design? * Is this standard SQL behaior? Here is a trigger example to show what I mean: CREATE TRIGGER bi_t BEFORE INSERT ON t FOR EACH ROW BEGIN SIGNAL SQLSTATE '23000' SET MYSQL_ERRNO = 1048; END Regards Federico
![](https://secure.gravatar.com/avatar/39b623a1559cf9c69ac3d9d4fb44e7fe.jpg?s=120&d=mm&r=g)
Hi, Federico! On Jun 22, Federico Razzoli wrote:
Hello. As we all know, IGNORE "catches" some errors and turns them into warnings. But I've noticed that it does not catch the same errors if they were issued by a trigger (using SIGNAL).
* Is this by design?
INSERT IGNORE is much older than triggers and SIGNAL. And I don't think that when SIGNAL was implemented this use case was considered.
* Is this standard SQL behaior?
There is no INSERT IGNORE in the standard, we can define freely how it should work.
Here is a trigger example to show what I mean:
CREATE TRIGGER bi_t BEFORE INSERT ON t FOR EACH ROW BEGIN SIGNAL SQLSTATE '23000' SET MYSQL_ERRNO = 1048; END
Regards, Sergei
participants (2)
-
Federico Razzoli
-
Sergei Golubchik