1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge branch 'mysql/5.5' into 5.5

This commit is contained in:
Sergei Golubchik
2016-04-20 15:25:55 +02:00
48 changed files with 476 additions and 159 deletions

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2011, 2013, Monty Program Ab.
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2011, 2016, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -774,7 +774,8 @@ int mysql_update(THD *thd,
error= 0;
}
else if (!ignore ||
table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
HA_CHECK_FK_ERROR))
{
/*
If (ignore && error is ignorable) we don't have to
@@ -782,7 +783,8 @@ int mysql_update(THD *thd,
*/
myf flags= 0;
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
HA_CHECK_FK_ERROR))
flags|= ME_FATALERROR; /* Other handler errors are fatal */
prepare_record_for_error_message(error, table);
@@ -790,6 +792,9 @@ int mysql_update(THD *thd,
error= 1;
break;
}
else if (ignore && !table->file->is_fatal_error(error,
HA_CHECK_FK_ERROR))
warn_fk_constraint_violation(thd, table, error);
}
if (table->triggers &&
@@ -1969,7 +1974,8 @@ int multi_update::send_data(List<Item> &not_used_values)
{
updated--;
if (!ignore ||
table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
HA_CHECK_FK_ERROR))
{
/*
If (ignore && error == is ignorable) we don't have to
@@ -1977,13 +1983,17 @@ int multi_update::send_data(List<Item> &not_used_values)
*/
myf flags= 0;
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY |
HA_CHECK_FK_ERROR))
flags|= ME_FATALERROR; /* Other handler errors are fatal */
prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(flags));
DBUG_RETURN(1);
}
else if (ignore && !table->file->is_fatal_error(error,
HA_CHECK_FK_ERROR))
warn_fk_constraint_violation(thd, table, error);
}
else
{
@@ -2256,11 +2266,15 @@ int multi_update::do_updates()
local_error != HA_ERR_RECORD_IS_THE_SAME)
{
if (!ignore ||
table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY))
table->file->is_fatal_error(local_error, HA_CHECK_DUP_KEY |
HA_CHECK_FK_ERROR))
{
err_table= table;
goto err;
}
else if (ignore && !table->file->is_fatal_error(local_error,
HA_CHECK_FK_ERROR))
warn_fk_constraint_violation(thd, table, local_error);
}
if (local_error != HA_ERR_RECORD_IS_THE_SAME)
updated++;