summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 5128b1284dd..81e3dca50ae 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -368,8 +368,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
}
}
}
- else
+ /*
+ Don't try unlocking the row if skip_record reported an error since in
+ this case the transaction might have been rolled back already.
+ */
+ else if (!thd->is_error())
table->file->unlock_row(); // Row failed selection, release lock on it
+ else
+ break;
}
killed_status= thd->killed;
if (killed_status != NOT_KILLED || thd->is_error())