~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/delete.test

Moved the last of the libdrizzleclient calls into Protocol.

Show diffs side-by-side

added added

removed removed

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