summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2016-06-23 17:50:07 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2016-08-29 16:17:46 +0200
commita02642b66e06f95b80fa9ee592ba50eb61dc2f17 (patch)
tree32474ae49d56b0b502f0284ecb8b1587544c1f6e /sql/item_sum.cc
parent00d84eada2806431fdd10f4dbcffdff450be2ee0 (diff)
downloadmariadb-git-a02642b66e06f95b80fa9ee592ba50eb61dc2f17.tar.gz
MDEV-10017: Get unexpected `Empty Set` for correlated subquery with aggregate functions (part 1)mariadb-10.1.17
Make aggregate function dependency visible.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 5220521b95a..540eefcc79a 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -380,6 +380,16 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref)
sl->master_unit()->item->with_sum_func= 1;
}
thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL);
+
+ if ((thd->lex->describe & DESCRIBE_EXTENDED) && aggr_sel)
+ {
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
+ ER_WARN_AGGFUNC_DEPENDENCE,
+ ER_THD(thd, ER_WARN_AGGFUNC_DEPENDENCE),
+ func_name(),
+ thd->lex->current_select->select_number,
+ aggr_sel->select_number);
+ }
return FALSE;
}