List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:March 10 2010 12:16am
Subject:re: Bug #44987: DELETE IGNORE and FK constraint
View as plain text  

>>>>> "Moritz" == Moritz Mertinkat <maurice-mysql@stripped>
> writes:

Moritz> Hi everybody,
Moritz> some weeks ago I came across a problem with DELETE IGNORE while using 
Moritz> foreign key constraints on MySQL 5.1.43.

Moritz> The problem is already known and has been verified, but no fix has been 
Moritz> made to far:

Moritz> I've supplied a patch ( 
Moritz> which is working quite well for me but somebody with a deeper
Moritz> understanding of the code should probably double-check it.

Moritz> Unfortunately it's not assigned to anyone which is why I'm writing to 
Moritz> this list :) I would really like to see this bug fixed in the next 
Moritz> release even though it's only "non-critical".

Moritz> Best regards,
Moritz> Moritz

I looked at your patch and it should work ok.

However, I would replace:

bool ignore= thd->lex->current_select->no_error;


bool ignore= !selext_lex->no_error;

I have now added your patch to MariaDB 5.1, with the differences that
we store warnings so that the user can see what went wrong.

The fix I used was:

+++ sql/   2010-03-10 00:13:26 +0000
@@ -335,8 +335,11 @@ bool mysql_delete(THD *thd, TABLE_LIST *
          InnoDB it can fail in a FOREIGN KEY error or an
          out-of-tablespace error.
-       error= 1;
-       break;
+        if (!select_lex->no_error)
+        {
+          error= 1;
+          break;
+        }


Check out MariaDB at
Bug #44987: DELETE IGNORE and FK constraintMoritz Mertinkat24 Feb
  • re: Bug #44987: DELETE IGNORE and FK constraintMichael Widenius10 Mar