diff options
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index f89b234f5b0..027a21db7ac 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -466,11 +466,14 @@ int st_select_lex_unit::exec() } res= sl->join->error; offset_limit_cnt= sl->offset_limit; - if (!res && union_result->flush()) + if (!res) { - examined_rows+= thd->examined_row_count; - thd->lex->current_select= lex_select_save; - DBUG_RETURN(1); + examined_rows+= thd->examined_row_count; + if (union_result->flush()) + { + thd->lex->current_select= lex_select_save; + DBUG_RETURN(1); + } } } if (res) |