6
drop table if exists t1,t2;
11
# First some simple tests
14
select 1, 1.0, -1, "hello", NULL;
16
create table t1 (a int, b int, c int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), n char(10));
18
select a b, b c from t1 as t2;
22
# Test metadata from ORDER BY (Bug #2654)
25
CREATE TABLE t1 (id int default NULL, data varchar(255) default NULL);
26
INSERT INTO t1 VALUES (1,'male'),(2,'female');
27
CREATE TABLE t2 (id int default NULL, data char(3) default '0');
28
INSERT INTO t2 VALUES (1,'yes'),(2,'no');
30
select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id;
31
select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id;
32
select t1.id from t1 union select t2.id from t2;
36
# variables union and derived tables metadata test
38
create table t1 ( a int, b varchar(30), primary key(a));
39
insert into t1 values (1,'one');
40
insert into t1 values (2,'two');
42
select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1;
43
select * from (select @arg00) aaa;
44
select 1 union select 1;
45
select * from (select 1 union select 1) aaa;
51
# Bug #11688: Bad mysql_info() results in multi-results
53
# No multi-statements in Drizzle
57
#create table t1 (i int);
58
#insert into t1 values (1),(2),(3);
59
#select * from t1 where i = 2;
67
# Bug #28492: subselect returns LONG in >5.0.24a and LONGLONG in <=5.0.24a
70
select a.* from (select 2147483648 as v_large) a;
71
select a.* from (select 214748364 as v_small) a;
74
--echo End of 5.0 tests