1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +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:
unknown
2006-06-19 20:56:50 -04:00
parent b19c1896ad
commit d90d673daf
9 changed files with 86 additions and 23 deletions

View File

@ -979,6 +979,9 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
if (error != HA_WRITE_SKIP)
goto err;
table->file->restore_auto_increment(); // it's too early here! BUG#20188
if (info->ignore &&
!table->file->cannot_ignore_error(error, 0))
goto ok_or_after_trg_err;
if ((int) (key_nr = table->file->get_dup_key(error)) < 0)
{
error=HA_WRITE_SKIP; /* Database can't find key */
@ -1062,7 +1065,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
if ((error=table->file->ha_update_row(table->record[1],
table->record[0])))
{
if ((error == HA_ERR_FOUND_DUPP_KEY) && info->ignore)
if (info->ignore &&
!table->file->cannot_ignore_error(error, HA_CHECK_DUPP_KEY))
goto ok_or_after_trg_err;
goto err;
}
@ -1148,7 +1152,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 ||
(error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE))
table->file->cannot_ignore_error(error, HA_CHECK_DUPP))
goto err;
table->file->restore_auto_increment();
}