From e9447881eb13378b06f0939091ab4e258a83ad51 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Apr 2004 04:33:58 +0300 Subject: Portability fixes Fixed problems with group_concat() and HAVING Updated crash-me values sql-bench/limits/mysql-4.0.cfg: Rename: sql-bench/limits/mysql.cfg -> sql-bench/limits/mysql-4.0.cfg include/my_global.h: Safety fix libmysqld/Makefile.am: Portability fix (For AIX 64 bit) mysql-test/r/func_gconcat.result: More tests mysql-test/t/func_gconcat.test: More tests sql/field.cc: Cleanups sql/init.cc: moved thread_stack_min to right place sql/item_sum.cc: Fixed problems with group_concat() and HAVING Removed some not needed variables sql/item_sum.h: Fixed problems with group_concat() and HAVING Removed some not needed variables sql/mysqld.cc: Moved thread_stack_min to right place to handle case where we didn't get as much stack space as we asked for sql/sql_parse.cc: More debugging sql/sql_select.cc: Cleanup sql/sql_yacc.yy: Fixed handling of Item_group_concat() in having. (Arguments should not be handled as refs) --- mysql-test/r/func_gconcat.result | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'mysql-test/r/func_gconcat.result') diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 3ab43ce11d5..dccd87e3d75 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -59,11 +59,16 @@ grp group_concat(d order by a desc) 1 a 2 b,a 3 c,d,d,b,b,a -select grp,group_concat(a order by a,d+c) from t1 group by grp; -grp group_concat(a order by a,d+c) +select grp,group_concat(a order by a,d+c-ascii(c)-a) from t1 group by grp; +grp group_concat(a order by a,d+c-ascii(c)-a) 1 1 2 2,3 3 4,5,6,7,8,9 +select grp,group_concat(a order by d+c-ascii(c),a) from t1 group by grp; +grp group_concat(a order by d+c-ascii(c),a) +1 1 +2 3,2 +3 7,8,4,6,9,5 select grp,group_concat(c order by 1) from t1 group by grp; grp group_concat(c order by 1) 1 a @@ -197,9 +202,21 @@ NULL drop table t1; drop table t2; create table t1 (bar varchar(32)); -insert into t1 values('test'),('test2'); -select * from t1 having group_concat(bar)=''; +insert into t1 values('test1'),('test2'); +select group_concat(bar order by concat(bar,bar)) from t1; +group_concat(bar order by concat(bar,bar)) +test1,test2 +select group_concat(bar order by concat(bar,bar) desc) from t1; +group_concat(bar order by concat(bar,bar) desc) +test2,test1 +select bar from t1 having group_concat(bar)=''; +bar +select bar from t1 having instr(group_concat(bar), "test") > 0; +bar +test1 +select bar from t1 having instr(group_concat(bar order by concat(bar,bar) desc), "test2,test1") > 0; bar +test1 drop table t1; create table t1 (a int, a1 varchar(10)); create table t2 (a0 int); @@ -246,7 +263,7 @@ id1 concat_id drop table t1,t2; create table t1 (s1 char(10), s2 int not null); insert into t1 values ('a',2),('b',2),('c',1),('a',3),('b',4),('c',4); -select distinct s1 from t1 order by s2; +select distinct s1 from t1 order by s2,s1; s1 c a -- cgit v1.2.1