Skip to content

Commit 97fad85

Browse files
author
Kailasnath Nagarkar
committed
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.
1 parent 55a2bab commit 97fad85

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sql/item_subselect.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -1789,8 +1789,12 @@ bool subselect_union_engine::is_executed() const
17891789

17901790
bool subselect_union_engine::no_rows()
17911791
{
1792+
bool rows_present= false;
1793+
17921794
/* Check if we got any rows when reading UNION result from temp. table: */
1793-
return test(!unit->fake_select_lex->join->send_records);
1795+
if (unit->fake_select_lex->join)
1796+
rows_present= test(!unit->fake_select_lex->join->send_records);
1797+
return rows_present;
17941798
}
17951799

17961800
void subselect_uniquesubquery_engine::cleanup()

0 commit comments

Comments
 (0)