~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/delete.test

  • Committer: Nathan Williams
  • Date: 2009-06-25 00:01:26 UTC
  • mto: This revision was merged to the branch mainline in revision 1082.
  • Revision ID: nathanlws@gmail.com-20090625000126-fv99nqpec4edrchc
Converted last usage of cmin to std::min.

Removed cmin and cmax defines from global.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
--enable_warnings
8
8
CREATE TABLE t1 (a int, b int);
9
9
INSERT INTO t1 VALUES (1,1);
10
 
INSERT LOW_PRIORITY INTO t1 VALUES (1,2);
 
10
INSERT INTO t1 VALUES (1,2);
11
11
INSERT INTO t1 VALUES (1,3);
12
12
DELETE from t1 where a=1 limit 1;
13
 
DELETE LOW_PRIORITY from t1 where a=1;
 
13
DELETE from t1 where a=1;
14
14
 
15
15
INSERT INTO t1 VALUES (1,1);
16
16
DELETE from t1;
17
 
LOCK TABLE t1 write;
18
17
INSERT INTO t1 VALUES (1,2);
19
18
DELETE from t1;
20
 
UNLOCK TABLES;
21
19
INSERT INTO t1 VALUES (1,2);
22
20
SET AUTOCOMMIT=0;
23
21
DELETE from t1;
114
112
insert into t12 values (33, 10),(0, 11),(2, 12);
115
113
insert into t2 values (1, 21),(2, 12),(3, 23);
116
114
select * from t11;
 
115
--sorted_result
117
116
select * from t12;
118
117
select * from t2;
119
118
-- error 1242
120
119
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
121
120
select * from t11;
 
121
--sorted_result
122
122
select * from t12;
 
123
# PBXT: for some reason this returns 2 warnings instead of 1
123
124
delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
124
125
select * from t11;
 
126
--sorted_result
125
127
select * from t12;
126
128
insert into t11 values (2, 12);
127
129
-- error 1242
167
169
# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
168
170
#            non-restricting WHERE is present.
169
171
#
 
172
# PBXT is different here. @a = 2 instead of 1. I think the
 
173
# reason is because an index is not used, as done with
 
174
# InnoDB. This may be due to lack of cluster index. If the
 
175
# delete below is based on a secondary index then the
 
176
# index is not used
170
177
create table t1(f1 int primary key);
171
178
insert into t1 values (4),(3),(1),(2);
172
179
delete from t1 where (@a:= f1) order by f1 limit 1;
176
183
# BUG#30385 "Server crash when deleting with order by and limit"
177
184
CREATE TABLE t1 (
178
185
  `date` date ,
179
 
  `time` time ,
180
186
  `seq` int NOT NULL auto_increment,
181
187
  PRIMARY KEY  (`seq`),
182
188
  KEY `seq` (`seq`),
183
 
  KEY `time` (`time`),
184
189
  KEY `date` (`date`)
185
190
);
186
 
DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1;
 
191
DELETE FROM t1 ORDER BY date ASC LIMIT 1;
187
192
drop table t1;
188
193
 
189
194
--echo End of 4.1 tests
206
211
drop table t1,t2,t3;
207
212
 
208
213
#
209
 
# Bug #8143: deleting '0000-00-00' values using IS NULL
210
 
#
211
 
 
212
 
create table t1(a date not null);
213
 
insert into t1 values (0);
214
 
select * from t1 where a is null;
215
 
delete from t1 where a is null;
216
 
select count(*) from t1;
217
 
drop table t1;
218
 
 
219
 
#
220
214
# Bug #26186: delete order by, sometimes accept unknown column
221
215
#
222
216
CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1);