diff options
author | unknown <ram@gw.mysql.r18.ru> | 2004-06-15 16:03:16 +0500 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2004-06-15 16:03:16 +0500 |
commit | 0f83847940dfa10ba641230607e52321f27df3a8 (patch) | |
tree | 28411be61405a826e3a2858d4e85950cfdd255f8 /mysql-test | |
parent | 125f840133735bc1031d06612aa04f07800066b2 (diff) | |
parent | 2ef5b0ed4e87c38ad031b3005cdbd05a09fef69b (diff) | |
download | mariadb-git-0f83847940dfa10ba641230607e52321f27df3a8.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b4035
sql/item_strfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_gconcat.result | 14 | ||||
-rw-r--r-- | mysql-test/t/func_gconcat.test | 12 |
2 files changed, 23 insertions, 3 deletions
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 43bcf94d6d9..0c744d1dff6 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -157,11 +157,8 @@ grp group_concat(c) 3 D,D,E 4 5 NULL -Warnings: -Warning 1260 1 line(s) was(were) cut by group_concat() show warnings; Level Code Message -Warning 1260 1 line(s) was(were) cut by group_concat() set group_concat_max_len = 1024; select group_concat(sum(a)) from t1 group by grp; ERROR HY000: Invalid use of group function @@ -310,3 +307,14 @@ GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) 1,2 2,4 DROP TABLE t1, t2; +CREATE TABLE t1 (a char(4)); +INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill'); +SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1 +HAVING names LIKE '%An%'; +names +John||Anna||Bill +SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1 +HAVING LEFT(names, 1) ='J'; +names +John###Anna###Bill +DROP TABLE t1; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 2448a1d3209..5ddc93e767b 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -189,3 +189,15 @@ INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1), (2); SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; DROP TABLE t1, t2; + +# +# Bug #4035: group_concat() and HAVING +# + +CREATE TABLE t1 (a char(4)); +INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill'); +SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1 + HAVING names LIKE '%An%'; +SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1 + HAVING LEFT(names, 1) ='J'; +DROP TABLE t1; |