Skip to content

Commit 93dd02d

Browse files
author
Jan Wedvik
committed
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 21c7f8b commit 93dd02d

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
@@ -252,9 +252,8 @@ static bool AddSubqueryPaths(const Item *item_arg, const char *source_text,
252252
"Select #%d (subquery in %s; run only once)",
253253
query_block->select_number, source_text);
254254
}
255-
if (query_block->join->needs_finalize) {
256-
qe->finalize(current_thd);
257-
}
255+
256+
qe->finalize(current_thd);
258257
AccessPath *path;
259258
if (qe->root_access_path() != nullptr) {
260259
path = qe->root_access_path();

0 commit comments

Comments
 (0)