diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2021-01-25 13:02:28 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2021-03-31 21:25:29 +0300 |
commit | b9d1c6574b845ddf843dd5a8e506593e74352c69 (patch) | |
tree | 28c873ed91e02206d3c30e9923e76636d338e54a | |
parent | d6d3d9ae2ffb1df8eebfe0c922394bbc7b12e4ed (diff) | |
download | mariadb-git-b9d1c6574b845ddf843dd5a8e506593e74352c69.tar.gz |
MDEV-23446 goto error cleanup
-rw-r--r-- | sql/sql_update.cc | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index ff301267484..c66a474c18b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -2350,10 +2350,10 @@ int multi_update::send_data(List<Item> ¬_used_values) { TABLE_LIST *cur_table; DBUG_ENTER("multi_update::send_data"); - int error= 0; for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local) { + int error= 0; TABLE *table= cur_table->table; uint offset= cur_table->shared; /* @@ -2423,21 +2423,7 @@ int multi_update::send_data(List<Item> ¬_used_values) updated--; if (!ignore || table->file->is_fatal_error(error, HA_CHECK_ALL)) - { -error: - /* - If (ignore && error == is ignorable) we don't have to - do anything; otherwise... - */ - myf flags= 0; - - if (table->file->is_fatal_error(error, HA_CHECK_ALL)) - 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); - } + goto error; } else { @@ -2513,7 +2499,22 @@ error: } } } - } + continue; +error: + DBUG_ASSERT(error > 0); + /* + If (ignore && error == is ignorable) we don't have to + do anything; otherwise... + */ + myf flags= 0; + + if (table->file->is_fatal_error(error, HA_CHECK_ALL)) + 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); + } // for (cur_table) DBUG_RETURN(0); } |