~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_gconcat.test

Merged in changes from Andrey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
drop table if exists t1, t2;
6
6
--enable_warnings
7
7
 
8
 
create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null);
 
8
create table t1 (grp int, a bigint, c char(10) not null, d char(10) not null);
9
9
insert into t1 values (1,1,"a","a");
10
10
insert into t1 values (2,2,"b","a");
11
11
insert into t1 values (2,3,"c","b");
131
131
# Problem with GROUP BY (Bug #2695)
132
132
#
133
133
 
134
 
CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL);
 
134
CREATE TABLE t1 (id1 int(4) NOT NULL, id2 int(4) NOT NULL);
135
135
INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3);
136
 
CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
 
136
CREATE TABLE t2 (id1 int(4) NOT NULL);
137
137
INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
138
138
SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1;
139
139
SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
333
333
#
334
334
 
335
335
CREATE TABLE t1 (
336
 
  aID smallint(5) unsigned NOT NULL auto_increment,
 
336
  aID int(5) NOT NULL auto_increment,
337
337
  sometitle varchar(255) NOT NULL default '',
338
 
  bID smallint(5) unsigned NOT NULL,
 
338
  bID int(5) NOT NULL,
339
339
  PRIMARY KEY  (aID),
340
340
  UNIQUE KEY sometitle (sometitle)
341
341
);
343
343
INSERT INTO t1 SET sometitle = 'title2', bID = 1;
344
344
 
345
345
CREATE TABLE t2 (
346
 
  bID smallint(5) unsigned NOT NULL auto_increment,
 
346
  bID int(5) NOT NULL auto_increment,
347
347
  somename varchar(255) NOT NULL default '',
348
348
  PRIMARY KEY  (bID),
349
349
  UNIQUE KEY somename (somename)
397
397
#
398
398
# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
399
399
#
400
 
create table t1 (f1 int unsigned, f2 varchar(255));
 
400
create table t1 (f1 int, f2 varchar(255));
401
401
insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
402
402
--enable_metadata
403
403
select f2,group_concat(f1) from t1 group by f2;
485
485
#
486
486
# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
487
487
#
488
 
create table t1 (f1 int unsigned, f2 varchar(255));
 
488
create table t1 (f1 int, f2 varchar(255));
489
489
insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
490
490
--enable_metadata
491
491
select f2,group_concat(f1) from t1 group by f2;