diff options
author | monty@mysql.com <> | 2005-07-04 03:42:33 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2005-07-04 03:42:33 +0300 |
commit | ec420bfb43b22db63a622d5c4f6498481070bb0c (patch) | |
tree | 502bf1c54d87aaf8e4cafea943108c20d146cacc /mysql-test/t/group_by.test | |
parent | e4bb8377c7dcfc7516e9da21bad6392d4898b35e (diff) | |
download | mariadb-git-ec420bfb43b22db63a622d5c4f6498481070bb0c.tar.gz |
Fixes during review of new code
- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling
Diffstat (limited to 'mysql-test/t/group_by.test')
-rw-r--r-- | mysql-test/t/group_by.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 9f920a1dd83..5d84098a84a 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -543,6 +543,29 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1 DROP TABLE t1; # +# Bug#11211: Ambiguous column reference in GROUP BY. +# + +create table t1 (c1 char(3), c2 char(3)); +create table t2 (c3 char(3), c4 char(3)); +insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2'); +insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2'); + +# query with ambiguous column reference 'c2' +--disable_ps_protocol +select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 +group by c2; +show warnings; +--enable_ps_protocol + +# this query has no ambiguity +select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 +group by t1.c1; + +show warnings; +drop table t1, t2; + +# # Test for bug #8614: GROUP BY 'const' with DISTINCT # |