summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2003-03-12 17:11:48 +0200
committerSinisa@sinisa.nasamreza.org <>2003-03-12 17:11:48 +0200
commit77eb6e506319ec12d84cca0b540ad0aefbcc67dd (patch)
tree938d68ae42fc51ba5d2bdadd62b96e40e1e3d891 /sql/sql_update.cc
parent51e5344dfe741d067a26aa2efa271c2577aa4cac (diff)
downloadmariadb-git-77eb6e506319ec12d84cca0b540ad0aefbcc67dd.tar.gz
Better fix for "Halloween" effect ...
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 8258d6df6a5..adb60adb7d6 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -413,7 +413,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), on_the_fly(1)
+ do_update(1), trans_safe(0)
{}
@@ -538,15 +538,13 @@ multi_update::initialize_tables(JOIN *join)
main_table=join->join_tab->table;
trans_safe= transactional_tables= main_table->file->has_transactions();
log_delayed= trans_safe || main_table->tmp_table != NO_TMP_TABLE;
-#ifdef HAVE_INNOBASE_DB
- if (main_table->db_type == DB_TYPE_INNODB)
- on_the_fly=0;
-#endif
+ table_to_update= (main_table->file->table_flags() & HA_NOT_MULTI_UPDATE) ?
+ (TABLE *) 0 : main_table;
/* Create a temporary table for all tables after except main table */
for (table_ref= update_tables; table_ref; table_ref=table_ref->next)
{
TABLE *table=table_ref->table;
- if (!on_the_fly || table != main_table)
+ if (table != table_to_update)
{
uint cnt= table_ref->shared;
ORDER group;
@@ -626,7 +624,7 @@ bool multi_update::send_data(List<Item> &not_used_values)
uint offset= cur_table->shared;
table->file->position(table->record[0]);
- if (on_the_fly && table == main_table)
+ if (table == table_to_update)
{
table->status|= STATUS_UPDATED;
store_record(table,1);
@@ -719,7 +717,7 @@ int multi_update::do_updates(bool from_send_error)
for (cur_table= update_tables; cur_table ; cur_table= cur_table->next)
{
table = cur_table->table;
- if (on_the_fly && table == main_table)
+ if (table == table_to_update)
continue; // Already updated
org_updated= updated;