mirror of
https://github.com/MariaDB/server.git
synced 2026-04-26 10:15:29 +02:00
Fix for a bug #2799.
Multi-table delete's with tables having foreign key constraints did not return the error. Also added tests for multi-table updates.
This commit is contained in:
parent
6c1795ee09
commit
e022b27860
3 changed files with 33 additions and 3 deletions
|
|
@ -347,7 +347,7 @@ bool multi_delete::send_data(List<Item> &values)
|
|||
table->status|= STATUS_DELETED;
|
||||
if (!(error=table->file->delete_row(table->record[0])))
|
||||
deleted++;
|
||||
else if (!table_being_deleted->next)
|
||||
else if (!table_being_deleted->next || table_being_deleted->table->file->has_transactions())
|
||||
{
|
||||
table->file->print_error(error,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
|
|
@ -450,7 +450,12 @@ int multi_delete::do_deletes(bool from_send_error)
|
|||
if ((local_error=table->file->delete_row(table->record[0])))
|
||||
{
|
||||
table->file->print_error(local_error,MYF(0));
|
||||
break;
|
||||
if (transactional_tables)
|
||||
{
|
||||
DBUG_RETURN(local_error);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
deleted++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue