diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_union.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 511ba1df41b..fd988d53e53 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1259,11 +1259,11 @@ bool st_select_lex_unit::optimize() { item->assigned(0); // We will reinit & rexecute unit item->reset(); - if (table->is_created()) - { - table->file->ha_delete_all_rows(); - table->file->info(HA_STATUS_VARIABLE); - } + } + if (table->is_created()) + { + table->file->ha_delete_all_rows(); + table->file->info(HA_STATUS_VARIABLE); } /* re-enabling indexes for next subselect iteration */ if (union_distinct && table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL)) |