~vkolesnikov/pbxt/pbxt-07-diskfull

« back to all changes in this revision

Viewing changes to pbxt/mysql-test-update/mysql-test/t/row.test

  • Committer: paul-mccullagh
  • Date: 2006-10-23 09:14:04 UTC
  • Revision ID: paul-mccullagh-918861e03d351978a9541168a96e58cc826734ee
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Initialise
 
2
--disable_warnings
 
3
drop table if exists t1;
 
4
--enable_warnings
 
5
 
 
6
select (1,2,3) IN ((3,2,3), (1,2,3), (1,3,3));
 
7
select row(10,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3));
 
8
select row(1,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3));
 
9
select row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3));
 
10
--disable_ps_warnings
 
11
select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'));
 
12
select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3));
 
13
--enable_ps_warnings
 
14
select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3));
 
15
select row('a',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
 
16
select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
 
17
select row('b',1.5,3) IN (row('b',NULL,3), row('a',1.5,3), row(1,3,3));
 
18
select row('b',1.5,3) IN (row('b',NULL,4), row('a',1.5,3), row(1,3,3));
 
19
select (1,2,(3,4)) IN ((3,2,(3,4)), (1,2,(3,4)));
 
20
-- error 1241
 
21
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4));
 
22
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
 
23
explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
 
24
 
 
25
SELECT (1,2,3)=(0,NULL,3);
 
26
SELECT (1,2,3)=(1,NULL,3);
 
27
# here's something for Sanja to fix :)
 
28
SELECT (1,2,3)=(1,NULL,0);
 
29
 
 
30
SELECT ROW(1,2,3)=ROW(1,2,3);
 
31
SELECT ROW(2,2,3)=ROW(1+1,2,3);
 
32
SELECT ROW(1,2,3)=ROW(1+1,2,3);
 
33
SELECT ROW(1,2,3)<ROW(1+1,2,3);
 
34
SELECT ROW(1,2,3)>ROW(1+1,2,3);
 
35
SELECT ROW(1,2,3)<=ROW(1+1,2,3);
 
36
SELECT ROW(1,2,3)>=ROW(1+1,2,3);
 
37
SELECT ROW(1,2,3)<>ROW(1+1,2,3);
 
38
SELECT ROW(NULL,2,3)=ROW(NULL,2,3);
 
39
SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3);
 
40
SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5));
 
41
SELECT ROW('test',2,3.33)=ROW('test',2,3.33);
 
42
-- error 1241
 
43
SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4);
 
44
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33));
 
45
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3));
 
46
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL));
 
47
-- error 1241
 
48
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4);
 
49
 
 
50
create table t1 ( a int, b int, c int);
 
51
insert into t1 values (1,2,3), (2,3,1), (3,2,1), (1,2,NULL);
 
52
select * from t1 where ROW(1,2,3)=ROW(a,b,c);
 
53
select * from t1 where ROW(0,2,3)=ROW(a,b,c);
 
54
select * from t1 where ROW(1,2,3)<ROW(a,b,c);
 
55
select ROW(a,2,3) IN(row(1,b,c), row(2,3,1)) from t1;
 
56
select ROW(c,2,3) IN(row(1,b,a), row(2,3,1)) from t1;
 
57
select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1;
 
58
select ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) from t1;
 
59
drop table t1;
 
60
 
 
61
-- error 1241
 
62
select ROW(1,1);
 
63
 
 
64
create table t1 (i int);
 
65
-- error 1241
 
66
select 1 from t1 where ROW(1,1);
 
67
-- error 1241
 
68
select count(*) from t1 order by ROW(1,1);
 
69
-- error 1241
 
70
select count(*) from t1 having (1,1) order by i;
 
71
drop table t1;
 
72
 
 
73
create table t1 (a int, b int);
 
74
insert into t1 values (1, 4);
 
75
insert into t1 values (10, 40);
 
76
insert into t1 values (1, 4);
 
77
insert into t1 values (10, 43);
 
78
insert into t1 values (1, 4);
 
79
insert into t1 values (10, 41);
 
80
insert into t1 values (1, 4);
 
81
insert into t1 values (10, 43);
 
82
insert into t1 values (1, 4);
 
83
select a, MAX(b), (1, MAX(b)) = (1, 4) from t1 group by a;
 
84
drop table t1;
 
85
SELECT ROW(2,10) <=> ROW(3,4);
 
86
SELECT ROW(NULL,10) <=> ROW(3,NULL);
 
87
 
 
88
# End of 4.1 tests
 
89
 
 
90
#
 
91
# Correct NULL handling in row comporison (BUG#12509)
 
92
#
 
93
SELECT ROW(1,1,1) = ROW(1,1,1) as `1`, ROW(1,1,1) = ROW(1,2,1) as `0`, ROW(1,NULL,1) = ROW(2,2,1) as `0`, ROW(1,NULL,1) = ROW(1,2,2) as `0`, ROW(1,NULL,1) = ROW(1,2,1) as `null` ;
 
94
select row(NULL,1)=(2,0);