Commit 97fad851 authored by Kailasnath Nagarkar's avatar Kailasnath Nagarkar

Bug #23303485 : HANDLE_FATAL_SIGNAL (SIG=11) IN

                SUBSELECT_UNION_ENGINE::NO_ROWS

This patch is specific for mysql-5.5

ISSUE: When max_join_size is used and union query
       results in evaluation of tuples greater than
       max_join_size, the join object is not created,
       and is set to NULL.
       However, this join object is further dereferenced
       by union logic to determine if query resulted in
       any number of rows being returned.
       Since, the object is NULL, it results in
       program terminating abnormally.

SOLUTION: Added check to verify if join object is created.
          If join object is created, it will be used to
          determine if query resulted in any number of rows.
          Else, when join object is not created, we return
          'false' indicating that there were no rows for the
          query.
parent 55a2babc
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -1789,8 +1789,12 @@ bool subselect_union_engine::is_executed() const
bool subselect_union_engine::no_rows()
{
bool rows_present= false;
/* Check if we got any rows when reading UNION result from temp. table: */
return test(!unit->fake_select_lex->join->send_records);
if (unit->fake_select_lex->join)
rows_present= test(!unit->fake_select_lex->join->send_records);
return rows_present;
}
void subselect_uniquesubquery_engine::cleanup()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment