mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
BUG#17138: Crashes in stored procedure
Last round of review fixes BUILD/compile-pentium-gcov: No change sql/ha_ndbcluster.h: Last round of review changes sql/ha_partition.h: Last round of review changes sql/handler.h: Last round of review changes sql/item_sum.cc: Last round of review changes sql/sql_acl.cc: Last round of review changes sql/sql_insert.cc: Last round of review changes sql/sql_select.cc: Last round of review changes sql/sql_table.cc: Last round of review changes sql/sql_union.cc: Last round of review changes sql/sql_update.cc: Last round of review changes
This commit is contained in:
@ -977,20 +977,24 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
||||
{
|
||||
uint key_nr;
|
||||
bool is_duplicate_key_error;
|
||||
if (table->file->is_fatal_error(error, HA_CHECK_DUPP))
|
||||
if (table->file->is_fatal_error(error, HA_CHECK_DUP))
|
||||
goto err;
|
||||
table->file->restore_auto_increment(); // it's too early here! BUG#20188
|
||||
is_duplicate_key_error= table->file->is_fatal_error(error, 0);
|
||||
if (!is_duplicate_key_error)
|
||||
{
|
||||
/*
|
||||
We come here when we had an ignorable error which is not a duplicate
|
||||
key error. In this we ignore error if ignore flag is set, otherwise
|
||||
report error as usual. We will not do any duplicate key processing.
|
||||
*/
|
||||
if (info->ignore)
|
||||
goto ok_or_after_trg_err;
|
||||
else
|
||||
goto err;
|
||||
goto ok_or_after_trg_err; /* Ignoring a not fatal error, return 0 */
|
||||
goto err;
|
||||
}
|
||||
if ((int) (key_nr = table->file->get_dup_key(error)) < 0)
|
||||
{
|
||||
error=HA_ERR_FOUND_DUPP_KEY; /* Database can't find key */
|
||||
error= HA_ERR_FOUND_DUPP_KEY; /* Database can't find key */
|
||||
goto err;
|
||||
}
|
||||
/* Read all columns for the row we are going to replace */
|
||||
@ -1072,7 +1076,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
||||
table->record[0])))
|
||||
{
|
||||
if (info->ignore &&
|
||||
!table->file->is_fatal_error(error, HA_CHECK_DUPP_KEY))
|
||||
!table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
|
||||
goto ok_or_after_trg_err;
|
||||
goto err;
|
||||
}
|
||||
@ -1155,7 +1159,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
||||
else if ((error=table->file->ha_write_row(table->record[0])))
|
||||
{
|
||||
if (!info->ignore ||
|
||||
table->file->is_fatal_error(error, HA_CHECK_DUPP))
|
||||
table->file->is_fatal_error(error, HA_CHECK_DUP))
|
||||
goto err;
|
||||
table->file->restore_auto_increment();
|
||||
goto ok_or_after_trg_err;
|
||||
|
Reference in New Issue
Block a user