mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#17138: Error in stored procedure due to fatal error when not really
a fatal error. New handling of ignore error in place. mysql-test/t/partition.test: New test case sql/ha_ndbcluster.h: New handler method to check if error can be ignored sql/ha_partition.h: New handler method to check if error can be ignored sql/handler.h: New handler method to check if error can be ignored sql/sql_acl.cc: Use new handler method sql/sql_insert.cc: Use new handler method sql/sql_table.cc: Use new handler method sql/sql_union.cc: Use new handler method sql/sql_update.cc: Use new handler method
This commit is contained in:
@@ -541,13 +541,14 @@ int mysql_update(THD *thd,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!ignore || error != HA_ERR_FOUND_DUPP_KEY)
|
||||
else if (!ignore ||
|
||||
table->file->cannot_ignore_error(error, HA_CHECK_DUPP_KEY))
|
||||
{
|
||||
/*
|
||||
If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to
|
||||
If (ignore && error is ignorable) we don't have to
|
||||
do anything; otherwise...
|
||||
*/
|
||||
if (error != HA_ERR_FOUND_DUPP_KEY)
|
||||
if (table->file->cannot_ignore_error(error, HA_CHECK_DUPP_KEY))
|
||||
thd->fatal_error(); /* Other handler errors are fatal */
|
||||
table->file->print_error(error,MYF(0));
|
||||
error= 1;
|
||||
@@ -1417,13 +1418,14 @@ bool multi_update::send_data(List<Item> ¬_used_values)
|
||||
table->record[0])))
|
||||
{
|
||||
updated--;
|
||||
if (!ignore || error != HA_ERR_FOUND_DUPP_KEY)
|
||||
if (!ignore ||
|
||||
table->file->cannot_ignore_error(error, HA_CHECK_DUPP_KEY))
|
||||
{
|
||||
/*
|
||||
If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to
|
||||
If (ignore && error == is ignorable) we don't have to
|
||||
do anything; otherwise...
|
||||
*/
|
||||
if (error != HA_ERR_FOUND_DUPP_KEY)
|
||||
if (table->file->cannot_ignore_error(error, HA_CHECK_DUPP_KEY))
|
||||
thd->fatal_error(); /* Other handler errors are fatal */
|
||||
table->file->print_error(error,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
@@ -1452,8 +1454,7 @@ bool multi_update::send_data(List<Item> ¬_used_values)
|
||||
/* Write row, ignoring duplicated updates to a row */
|
||||
if ((error= tmp_table->file->ha_write_row(tmp_table->record[0])))
|
||||
{
|
||||
if (error != HA_ERR_FOUND_DUPP_KEY &&
|
||||
error != HA_ERR_FOUND_DUPP_UNIQUE &&
|
||||
if (tmp_table->file->cannot_ignore_error(error, HA_CHECK_DUPP) &&
|
||||
create_myisam_from_heap(thd, tmp_table,
|
||||
tmp_table_param + offset, error, 1))
|
||||
{
|
||||
@@ -1576,7 +1577,8 @@ int multi_update::do_updates(bool from_send_error)
|
||||
if ((local_error=table->file->ha_update_row(table->record[1],
|
||||
table->record[0])))
|
||||
{
|
||||
if (!ignore || local_error != HA_ERR_FOUND_DUPP_KEY)
|
||||
if (!ignore ||
|
||||
table->file->cannot_ignore_error(local_error, HA_CHECK_DUPP_KEY))
|
||||
goto err;
|
||||
}
|
||||
updated++;
|
||||
|
||||
Reference in New Issue
Block a user