~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/union.result

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
515
515
insert into t2 (group_name) values ('Group A');
516
516
insert into t2 (group_name) values ('Group B');
517
517
insert into t3 (user_id, group_id) values (1,1);
518
 
select 1 'is_in_group', a.user_name, c.group_name, b.id from t1 a, t3 b, t2 c where a.id = b.user_id and b.group_id = c.id UNION  select 0 'is_in_group', a.user_name, c.group_name, null from t1 a CROSS JOIN t2 c;
 
518
select 1 'is_in_group', a.user_name, c.group_name, b.id from t1 a, t3 b, t2 c where a.id = b.user_id and b.group_id = c.id UNION  select 0 'is_in_group', a.user_name, c.group_name, null from t1 a, t2 c;
519
519
is_in_group     user_name       group_name      id
520
520
1       Tester  Group A 1
521
521
0       Tester  Group A NULL
539
539
select * from t1;
540
540
a
541
541
a
542
 
aa
543
542
show create table t1;
544
543
Table   Create Table
545
544
t1      CREATE TABLE `t1` (
546
 
  `a` VARCHAR(2) COLLATE utf8_general_ci NOT NULL DEFAULT ''
 
545
  `a` VARCHAR(1) COLLATE utf8_general_ci NOT NULL DEFAULT ''
547
546
) ENGINE=DEFAULT COLLATE = utf8_general_ci
548
547
drop table t1;
549
548
create table t1 SELECT 12 as a UNION select "aa" as a;
554
553
show create table t1;
555
554
Table   Create Table
556
555
t1      CREATE TABLE `t1` (
557
 
  `a` VARBINARY(8) NOT NULL DEFAULT ''
 
556
  `a` VARBINARY(4) NOT NULL DEFAULT ''
558
557
) ENGINE=DEFAULT COLLATE = utf8_general_ci
559
558
drop table t1;
560
559
create table t1 SELECT 12 as a UNION select 12.2 as a;
666
665
show create table t1;
667
666
Table   Create Table
668
667
t1      CREATE TABLE `t1` (
669
 
  `dt` VARBINARY(40) DEFAULT NULL
 
668
  `dt` VARBINARY(19) DEFAULT NULL
670
669
) ENGINE=DEFAULT COLLATE = utf8_general_ci
671
670
drop table t1;
672
671
create table t1 SELECT dt from t2 UNION select sv from t2;
766
765
show create table t1;
767
766
Table   Create Table
768
767
t1      CREATE TABLE `t1` (
769
 
  `test` VARCHAR(5) COLLATE utf8_general_ci NOT NULL DEFAULT ''
 
768
  `test` VARCHAR(4) COLLATE utf8_general_ci NOT NULL DEFAULT ''
770
769
) ENGINE=DEFAULT COLLATE = utf8_general_ci
771
770
drop table t1;
772
771
create table t1 (s char(200));
1159
1158
create table t1 (foo varchar(100)) collate=utf8_bin;
1160
1159
insert into t1 (foo) values ("foo");
1161
1160
select foo from t1 union select 'bar' as foo from dual;
1162
 
ERROR 42S02: Unknown table 'test.dual'
 
1161
ERROR 42S02: Table 'test.dual' doesn't exist
1163
1162
select foo from t1 union select 'bar' as foo;
1164
1163
foo
1165
1164
foo
1196
1195
show create table t2;
1197
1196
Table   Create Table
1198
1197
t2      CREATE TABLE `t2` (
1199
 
  `a` VARCHAR(12) COLLATE utf8_general_ci DEFAULT NULL
 
1198
  `a` VARCHAR(5) COLLATE utf8_general_ci DEFAULT NULL
1200
1199
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1201
1200
select row_format from data_dictionary.TABLES where table_schema="test" and table_name="t2";
1202
1201
row_format
1204
1203
show create table t2;
1205
1204
Table   Create Table
1206
1205
t2      CREATE TABLE `t2` (
1207
 
  `a` VARCHAR(12) COLLATE utf8_general_ci DEFAULT NULL
 
1206
  `a` VARCHAR(5) COLLATE utf8_general_ci DEFAULT NULL
1208
1207
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1209
1208
drop table t1,t2;
1210
1209
CREATE TABLE t1 (a mediumtext);
1359
1358
select '12' union select '12345';
1360
1359
12
1361
1360
12
1362
 
12345
1363
1361
CREATE TABLE t1 (a int);
1364
1362
INSERT INTO t1 VALUES (3),(1),(2),(4),(1);
1365
1363
SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test;