diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-11-10 11:22:51 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-11-10 11:22:51 +0100 |
commit | 78a31db6b322ec0e63601ed471feaedc0ad2987c (patch) | |
tree | 471b5e5211d8a895071dd9f130d3df477c242496 /sql/sql_union.cc | |
parent | 06a9a366a3df18b02a97fce8e585229f0c01bd09 (diff) | |
download | mariadb-git-bb-10.3-MDEV-13723.tar.gz |
MDEV-13723: Server crashes in ha_heap::find_unique_row or Assertion `0' failed in st_select_lex_unit::optimize with INTERSECTbb-10.3-MDEV-13723
With INTERSECT/EXCEPT fakt that subquery item of IN/ALL/ANY was not assigned value does not mean that temporary table used for calculating unit is empty (records could be deleted).
Diffstat (limited to 'sql/sql_union.cc')
-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)) |