1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge dator5.(none):/home/pappa/clean-mysql-5.1

into  dator5.(none):/home/pappa/bug17138


sql/ha_ndbcluster.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
This commit is contained in:
unknown
2006-06-21 21:24:04 -04:00
12 changed files with 117 additions and 38 deletions

View File

@ -976,12 +976,16 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
while ((error=table->file->ha_write_row(table->record[0])))
{
uint key_nr;
if (error != HA_WRITE_SKIP)
bool is_duplicate_key_error;
if (table->file->is_fatal_error(error, HA_CHECK_DUPP))
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 (info->ignore && !is_duplicate_key_error)
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 */
error=HA_ERR_FOUND_DUPP_KEY; /* Database can't find key */
goto err;
}
/* Read all columns for the row we are going to replace */
@ -1062,7 +1066,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->is_fatal_error(error, HA_CHECK_DUPP_KEY))
goto ok_or_after_trg_err;
goto err;
}
@ -1145,7 +1150,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->is_fatal_error(error, HA_CHECK_DUPP))
goto err;
table->file->restore_auto_increment();
goto ok_or_after_trg_err;