~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/t/metadata.test

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Test metadata
 
3
#
 
4
 
 
5
--disable_warnings
 
6
drop table if exists t1,t2;
 
7
--enable_warnings
 
8
--enable_metadata
 
9
 
 
10
#
 
11
# First some simple tests
 
12
#
 
13
 
 
14
select 1, 1.0, -1, "hello", NULL;
 
15
 
 
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));
 
17
select * from t1;
 
18
select a b, b c from t1 as t2;
 
19
drop table t1;
 
20
 
 
21
#
 
22
# Test metadata from ORDER BY (Bug #2654)
 
23
#
 
24
 
 
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');
 
29
 
 
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;
 
33
drop table t1,t2;
 
34
 
 
35
#
 
36
# variables union and derived tables metadata test
 
37
#
 
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');
 
41
set @arg00=1 ;
 
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;
 
46
drop table t1;
 
47
 
 
48
--disable_metadata
 
49
 
 
50
#
 
51
# Bug #11688: Bad mysql_info() results in multi-results
 
52
#
 
53
# No multi-statements in Drizzle
 
54
#
 
55
#--enable_info
 
56
#delimiter //;
 
57
#create table t1 (i int);
 
58
#insert into t1 values (1),(2),(3);
 
59
#select * from t1 where i = 2;
 
60
#drop table t1;//
 
61
#delimiter ;//
 
62
#--disable_info
 
63
 
 
64
# End of 4.1 tests
 
65
 
 
66
#
 
67
# Bug #28492: subselect returns LONG in >5.0.24a and LONGLONG in <=5.0.24a
 
68
#
 
69
--enable_metadata
 
70
select a.* from (select 2147483648 as v_large) a;
 
71
select a.* from (select 214748364 as v_small) a;
 
72
--disable_metadata
 
73
 
 
74
--echo End of 5.0 tests