summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 0ed25c3913d..7c48f8eaded 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -2671,6 +2671,8 @@ int multi_update::do_updates()
table = cur_table->table;
if (table == table_to_update)
continue; // Already updated
+ if (table->file->pushed_rowid_filter)
+ table->file->disable_pushed_rowid_filter();
org_updated= updated;
tmp_table= tmp_tables[cur_table->shared];
tmp_table->file->extra(HA_EXTRA_CACHE); // Change to read cache
@@ -2865,7 +2867,8 @@ int multi_update::do_updates()
check_opt_it.rewind();
while (TABLE *tbl= check_opt_it++)
tbl->file->ha_rnd_end();
-
+ if (table->file->save_pushed_rowid_filter)
+ table->file->enable_pushed_rowid_filter();
}
DBUG_RETURN(0);
@@ -2876,6 +2879,8 @@ err:
}
err2:
+ if (table->file->save_pushed_rowid_filter)
+ table->file->enable_pushed_rowid_filter();
if (table->file->inited)
(void) table->file->ha_rnd_end();
if (tmp_table->file->inited)
@@ -3126,6 +3131,11 @@ bool Sql_cmd_update::prepare_inner(THD *thd)
goto err;
}
+ if (!multitable &&
+ select_lex->sj_subselects.elements &&
+ !select_lex->order_list.elements &&
+ select_lex->master_unit()->lim.get_select_limit() == HA_POS_ERROR)
+ multitable= true;
}
free_join= false;