maria-discuss team mailing list archive
Mailing list archive
Re: INSERT IGNORE and triggers
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
> * Is this standard SQL behaior?
There is no INSERT IGNORE in the standard, we can define freely how it
> Here is a trigger example to show what I mean:
> CREATE TRIGGER bi_t
> BEFORE INSERT
> ON t
> FOR EACH ROW
> SIGNAL SQLSTATE '23000'
> SET MYSQL_ERRNO = 1048;