Skip to content

Commit 170ff58

Browse files
Jan Wedvikdahlerlend
authored andcommitted
Bug#35710383 mysql server 8.1.0 crashed at GetAccessPathsFromItem
This commit removes a redundant if-test to fix the above bug. For the failing query, the optimizer short-circuits planning for a subquery in a projection due to an impossible HAVING condition. This then triggered the null pointer error. Change-Id: Id36450f92c872eb520d583d2902dd8d9b7803843
1 parent 3c15b14 commit 170ff58

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sql/join_optimizer/explain_access_path.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,8 @@ static bool GetAccessPathsFromItem(Item *item_arg, const char *source_text,
235235
"Select #%d (subquery in %s; run only once)",
236236
query_block->select_number, source_text);
237237
}
238-
if (query_block->join->needs_finalize) {
239-
subselect->unit->finalize(current_thd);
240-
}
238+
239+
subselect->unit->finalize(current_thd);
241240
AccessPath *path;
242241
if (subselect->unit->root_access_path() != nullptr) {
243242
path = subselect->unit->root_access_path();

0 commit comments

Comments
 (0)