diff options
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index ecc2a54bdd8..b3a7227678d 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -303,7 +303,8 @@ int select_union_recursive::send_data(List<Item> &values) { int rc= select_unit::send_data(values); - if (write_err != HA_ERR_FOUND_DUPP_KEY && + if (rc == 0 && + write_err != HA_ERR_FOUND_DUPP_KEY && write_err != HA_ERR_FOUND_DUPP_UNIQUE) { int err; @@ -1360,6 +1361,9 @@ bool st_select_lex_unit::exec() if (saved_error) DBUG_RETURN(saved_error); + if (union_result) + union_result->init(); + if (uncacheable || !item || !item->assigned() || describe) { if (!fake_select_lex && !(with_element && with_element->is_recursive)) |