~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_gconcat.test

  • Committer: Daniel Nichter
  • Date: 2011-10-23 16:01:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2448.
  • Revision ID: daniel@percona.com-20111023160137-7ac3blgz8z4tf8za
Add Administration Getting Started and Logging.  Capitalize SQL clause keywords.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
# Test transfer to real values
51
51
 
52
 
select grp, group_concat(a separator "")+0 from t1 group by grp;
53
 
select grp, group_concat(a separator "")+0.0 from t1 group by grp;
54
 
select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
 
52
select grp, group_concat(a separator "")+0 from t1 group by grp;
 
53
select grp, group_concat(a separator "")+0.0 from t1 group by grp;
 
54
select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
55
55
drop table t1;
56
56
 
57
57
# Test NULL values
69
69
 
70
70
# Test errors
71
71
 
72
 
--error 1111
 
72
--error ER_INVALID_GROUP_FUNC_USE
73
73
select group_concat(sum(c)) from t1 group by grp;
74
 
--error 1054
 
74
--error ER_BAD_FIELD_ERROR
75
75
select grp,group_concat(c order by 2) from t1 group by grp;
76
76
 
77
77
drop table t1;
104
104
create table t1(id int);
105
105
create table t2(id int);
106
106
insert into t1 values(0),(1);
107
 
select group_concat(t1.id) FROM t1,t2;
 
107
select group_concat(t1.id) FROM t1,t2 where t2.id < 2;
108
108
drop table t1;
109
109
drop table t2;
110
110
 
190
190
CREATE TABLE t2 ( a int );
191
191
INSERT INTO t1 VALUES (1), (2);
192
192
INSERT INTO t2 VALUES (1), (2);
193
 
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
 
193
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 WHERE t1.a < 3 GROUP BY t1.a;
194
194
DROP TABLE t1, t2;
195
195
 
196
196
#
272
272
select collation(a) from t1;
273
273
select collation(group_concat(a)) from t1;
274
274
create table t2 select group_concat(a) as a from t1;
 
275
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
275
276
show create table t2;
276
277
select collation(group_concat(a,b)) from t1;
277
278
drop table t1;
450
451
  x text not null,
451
452
  y integer not null
452
453
);
453
 
insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0);
 
454
insert into t1 values (repeat('a', 1022), 0), (repeat( 0xc3b7, 4), 0);
454
455
let $1= 10;
455
456
while ($1)
456
457
{
601
602
 FROM
602
603
  t1 AS t1,
603
604
  t1 AS t2
 
605
 WHERE t2.a IS NULL
604
606
 GROUP BY 1
605
607
) AS s1;
606
608
DROP TABLE t1;