~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/pbxt/delete.result

  • Committer: Monty Taylor
  • Date: 2009-03-08 23:45:12 UTC
  • mto: (923.2.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 921.
  • Revision ID: mordred@inaugust.com-20090308234512-tqkygxtu1iaig23s
Removed C99 isnan() usage, which allows us to remove the util/math.{cc,h} workarounds. Yay for standards!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
drop table if exists t1,t2,t3,t11,t12;
2
 
CREATE TABLE t1 (a int, b int);
3
 
INSERT INTO t1 VALUES (1,1);
4
 
INSERT INTO t1 VALUES (1,2);
5
 
INSERT INTO t1 VALUES (1,3);
6
 
DELETE from t1 where a=1 limit 1;
7
 
DELETE from t1 where a=1;
8
 
INSERT INTO t1 VALUES (1,1);
9
 
DELETE from t1;
10
 
INSERT INTO t1 VALUES (1,2);
11
 
DELETE from t1;
12
 
INSERT INTO t1 VALUES (1,2);
13
 
SET AUTOCOMMIT=0;
14
 
DELETE from t1;
15
 
SET AUTOCOMMIT=1;
16
 
drop table t1;
17
 
create table t1 (
18
 
a bigint not null,
19
 
b bigint not null default 0,
20
 
c bigint not null default 0,
21
 
d bigint not null default 0,
22
 
e bigint not null default 0,
23
 
f bigint not null default 0,
24
 
g bigint not null default 0,
25
 
h bigint not null default 0,
26
 
i bigint not null default 0,
27
 
j bigint not null default 0,
28
 
primary key (a,b,c,d,e,f,g,h,i,j));
29
 
insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
30
 
delete from t1 where a=26;
31
 
drop table t1;
32
 
create table t1 (
33
 
a bigint not null,
34
 
b bigint not null default 0,
35
 
c bigint not null default 0,
36
 
d bigint not null default 0,
37
 
e bigint not null default 0,
38
 
f bigint not null default 0,
39
 
g bigint not null default 0,
40
 
h bigint not null default 0,
41
 
i bigint not null default 0,
42
 
j bigint not null default 0,
43
 
primary key (a,b,c,d,e,f,g,h,i,j));
44
 
insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
45
 
delete from t1 where a=27;
46
 
drop table t1;
47
 
CREATE TABLE `t1` (
48
 
`i` int NOT NULL default '0',
49
 
`i2` int NOT NULL default '0',
50
 
PRIMARY KEY  (`i`)
51
 
);
52
 
drop table t1;
53
 
CREATE TEMPORARY TABLE t1 (
54
 
bool     char(0) default NULL,
55
 
not_null varchar(20) NOT NULL default '',
56
 
misc     integer not null,
57
 
PRIMARY KEY  (not_null)
58
 
) ENGINE=MyISAM;
59
 
INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
60
 
select * from t1 where misc > 5 and bool is null;
61
 
bool    not_null        misc
62
 
NULL    c       6
63
 
NULL    d       7
64
 
delete   from t1 where misc > 5 and bool is null;
65
 
select * from t1 where misc > 5 and bool is null;
66
 
bool    not_null        misc
67
 
select count(*) from t1;
68
 
count(*)
69
 
2
70
 
delete from t1 where 1 > 2;
71
 
select count(*) from t1;
72
 
count(*)
73
 
2
74
 
delete from t1 where 3 > 2;
75
 
select count(*) from t1;
76
 
count(*)
77
 
0
78
 
drop table t1;
79
 
create table t11 (a int NOT NULL, b int, primary key (a));
80
 
create table t12 (a int NOT NULL, b int, primary key (a));
81
 
create table t2 (a int NOT NULL, b int, primary key (a));
82
 
insert into t11 values (0, 10),(1, 11),(2, 12);
83
 
insert into t12 values (33, 10),(0, 11),(2, 12);
84
 
insert into t2 values (1, 21),(2, 12),(3, 23);
85
 
select * from t11;
86
 
a       b
87
 
0       10
88
 
1       11
89
 
2       12
90
 
select * from t12;
91
 
a       b
92
 
0       11
93
 
2       12
94
 
33      10
95
 
select * from t2;
96
 
a       b
97
 
1       21
98
 
2       12
99
 
3       23
100
 
select * from t11;
101
 
a       b
102
 
0       10
103
 
1       11
104
 
2       12
105
 
select * from t12;
106
 
a       b
107
 
0       11
108
 
2       12
109
 
33      10
110
 
select * from t11;
111
 
a       b
112
 
0       10
113
 
1       11
114
 
2       12
115
 
select * from t12;
116
 
a       b
117
 
0       11
118
 
2       12
119
 
33      10
120
 
delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
121
 
ERROR 21000: Subquery returns more than 1 row
122
 
select * from t11;
123
 
a       b
124
 
0       10
125
 
1       11
126
 
2       12
127
 
select * from t11;
128
 
a       b
129
 
0       10
130
 
1       11
131
 
2       12
132
 
drop table t11, t12, t2;
133
 
create table t1 (a int, b int, unique key (a), key (b));
134
 
insert into t1 values (3, 3), (7, 7);
135
 
delete from t1 where a = 3;
136
 
check table t1;
137
 
Table   Op      Msg_type        Msg_text
138
 
test.t1 check   status  OK
139
 
select * from t1;
140
 
a       b
141
 
7       7
142
 
drop table t1;
143
 
CREATE TABLE t1 ( a int PRIMARY KEY );
144
 
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
145
 
INSERT INTO t1 VALUES (0),(1),(2);
146
 
DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
147
 
SELECT * FROM t1;
148
 
a
149
 
0
150
 
2
151
 
DROP TABLE t1;
152
 
create table t1(f1 int primary key);
153
 
insert into t1 values (4),(3),(1),(2);
154
 
delete from t1 where (@a:= f1) order by f1 limit 1;
155
 
select @a;
156
 
@a
157
 
2
158
 
drop table t1;
159
 
CREATE TABLE t1 (
160
 
`date` date ,
161
 
`seq` int NOT NULL auto_increment,
162
 
PRIMARY KEY  (`seq`),
163
 
KEY `seq` (`seq`),
164
 
KEY `date` (`date`)
165
 
);
166
 
DELETE FROM t1 ORDER BY date ASC LIMIT 1;
167
 
drop table t1;
168
 
End of 4.1 tests
169
 
CREATE TABLE t1 (a INT);
170
 
INSERT INTO t1 VALUES (1);
171
 
DELETE FROM t1 ORDER BY x;
172
 
ERROR 42S22: Unknown column 'x' in 'order clause'
173
 
DELETE FROM t1 ORDER BY t2.x;
174
 
ERROR 42S22: Unknown column 't2.x' in 'order clause'
175
 
DELETE FROM t1 ORDER BY (SELECT x);
176
 
ERROR 42S22: Unknown column 'x' in 'field list'
177
 
DROP TABLE t1;
178
 
CREATE TABLE t1 (
179
 
a INT
180
 
);
181
 
CREATE TABLE t2 (
182
 
a INT
183
 
);
184
 
CREATE DATABASE db1;
185
 
CREATE TABLE db1.t1 (
186
 
a INT
187
 
);
188
 
INSERT INTO db1.t1 (a) SELECT * FROM t1;
189
 
CREATE DATABASE db2;
190
 
CREATE TABLE db2.t1 (
191
 
a INT
192
 
);
193
 
INSERT INTO db2.t1 (a) SELECT * FROM t2;
194
 
SELECT * FROM t1;
195
 
a
196
 
DELETE FROM t1 alias USING t1 alias WHERE a = 2;
197
 
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'alias USING t1 alias WHERE a = 2' at line 1
198
 
SELECT * FROM t1;
199
 
a
200
 
DROP TABLE t1, t2;
201
 
DROP DATABASE db1;
202
 
DROP DATABASE db2;
203
 
End of 5.0 tests
204
 
DROP DATABASE IF EXISTS db1;
205
 
DROP DATABASE IF EXISTS db2;
206
 
DROP DATABASE IF EXISTS db3;
207
 
DROP DATABASE IF EXISTS db4;
208
 
DROP TABLE IF EXISTS t1, t2;
209
 
USE test;
210
 
CREATE DATABASE db1;
211
 
CREATE DATABASE db2;
212
 
CREATE TABLE db1.t1 (a INT, b INT);
213
 
INSERT INTO db1.t1 VALUES (1,1),(2,2),(3,3);
214
 
CREATE TABLE db1.t2 AS SELECT * FROM db1.t1;
215
 
CREATE TABLE db2.t1 AS SELECT * FROM db1.t2;
216
 
CREATE TABLE db2.t2 AS SELECT * FROM db2.t1;
217
 
CREATE TABLE t1 AS SELECT * FROM db2.t2;
218
 
CREATE TABLE t2 AS SELECT * FROM t1;
219
 
DROP DATABASE db1;
220
 
DROP DATABASE db2;
221
 
DROP TABLE t1, t2;