summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-12-09 00:37:17 +0300
committerunknown <konstantin@mysql.com>2004-12-09 00:37:17 +0300
commit998209d36b93e1a0b6e2078b004a0cdbbaf5a712 (patch)
tree2f3c0d3a4b5c23216259de234496b30dac8169d9 /sql/item_subselect.cc
parent45643bc6aa24c7649b969f6ae58892090fc89736 (diff)
downloadmariadb-git-998209d36b93e1a0b6e2078b004a0cdbbaf5a712.tar.gz
A fix and test case for Bug#6873 "PS, having with subquery, crash
during execute" mysql-test/r/ps.result: Test results updated (Bug#6873) mysql-test/t/ps.test: A test case for Bug#6873 "PS, having with subquery, crash during execute". sql/item_subselect.cc: If we transform having subtree, modify SELECT_LEX::having pointer to point to the new having tree root.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 1265d0b3557..69941b36ca0 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
// did we changed top item of WHERE condition
if (unit->outer_select()->where == (*ref))
unit->outer_select()->where= substitution; // correct WHERE for PS
+ else if (unit->outer_select()->having == (*ref))
+ unit->outer_select()->having= substitution; // correct HAVING for PS
(*ref)= substitution;
substitution->name= name;