summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2021-02-15 16:28:44 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2021-02-16 11:53:13 +0530
commit7e9a6b7f09bfb00e781d8ca63dfe7701900c368b (patch)
tree79d3e1ed300525dcc14e4a1fca0b4b322c807636 /sql/item_subselect.cc
parenta461e4d306bc53134cefa0eeeb624f3d9eba70f8 (diff)
downloadmariadb-git-7e9a6b7f09bfb00e781d8ca63dfe7701900c368b.tar.gz
MDEV-24779: main.subselect fails in buildbot with --ps-protocol
Follow-up fix to commit 26f5033(MDEV-23449) The GROUP BY clause inside IN/ALL/ANY subquery is removed when there is no aggregate function or HAVING clause in the subquery. When the GROUP BY clause is removed, a subquery can also be removed if it part of the GROUP BY clause. This is done inside the function remove_redundant_subquery_clauses. Here we walk over the GROUP BY list and remove a subselect from its unit via the callback function eliminate_subselect_processor. The issue here was that when the query was being re-executed it was trying to reinitialize the select that was removed as stated above. This is not required, so the fix would be to remove select_lex both from tree lex structure and the global list of nodes so that we don't do the reinitialization again.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 802bfca64b7..1ef74d19172 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -368,7 +368,7 @@ bool Item_subselect::mark_as_eliminated_processor(void *arg)
bool Item_subselect::eliminate_subselect_processor(void *arg)
{
unit->item= NULL;
- unit->exclude_from_tree();
+ unit->exclude();
eliminated= TRUE;
return FALSE;
}