From 682c8a36ca503f53db50628463424f205b609ab0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 May 2013 16:07:13 +0300 Subject: MDEV-4290: Fix agregate function resolution in derived tables (no name resolution over a derived table border) --- mysql-test/r/func_group.result | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'mysql-test/r/func_group.result') diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index bd77f800f67..5fa37f577e9 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -2097,3 +2097,31 @@ avg(export_set( 3, 'y', sha(i))) group_concat(d) 0 2008-10-02 0 2010-12-12 drop table t1; +# +# MDEV-4290: crash in st_select_lex::mark_as_dependent +# +create table `t1`(`a` int); +select 1 from t1 v1 right join t1 on count(*); +ERROR HY000: Invalid use of group function +select 1 from t1 order by +( +select 1 from +( +select 1 from t1 v1 right join t1 on count(*) +) v +); +ERROR HY000: Invalid use of group function +insert into t1 values (1),(1),(2),(2); +select count(*) from t1; +count(*) +4 +select z from (select count(*) as z from t1) v; +z +4 +# next is how it implemented now (may be changed in case of dependent +# derived tables) +select z from (select count(*) as z from t1) v group by 1; +z +4 +drop table t1; +# end of 5.3 tests -- cgit v1.2.1