From 54628879fcf511954669d1ee532f639f1f98db47 Mon Sep 17 00:00:00 2001 From: "igor@rurik.mysql.com" <> Date: Thu, 11 Dec 2003 14:55:48 -0800 Subject: Many files: Fixed a bug causing a crash for multi-update/multi-delete with impossible where (bug #1860). --- sql/sql_update.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/sql_update.cc') diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d5034644830..19df0661db3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -440,7 +440,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list, :all_tables(table_list), update_tables(0), thd(thd_arg), tmp_tables(0), updated(0), found(0), fields(field_list), values(value_list), table_count(0), copy_field(0), handle_duplicates(handle_duplicates_arg), - do_update(1), trans_safe(0) + do_update(1), trans_safe(0), tmp_tables_inited(0) {} @@ -622,6 +622,7 @@ multi_update::initialize_tables(JOIN *join) DBUG_RETURN(1); tmp_tables[cnt]->file->extra(HA_EXTRA_WRITE_CACHE); } + tmp_tables_inited= 1; DBUG_RETURN(0); } @@ -819,8 +820,11 @@ int multi_update::do_updates(bool from_send_error) ha_rows org_updated; TABLE *table; DBUG_ENTER("do_updates"); + - do_update= 0; // Don't retry this function + do_update= 0; // Don't retry this function + if (!tmp_tables_inited) + DBUG_RETURN(0); for (cur_table= update_tables; cur_table ; cur_table= cur_table->next) { table = cur_table->table; -- cgit v1.2.1