~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/delete.test

  • Committer: Monty Taylor
  • Date: 2008-09-15 17:24:04 UTC
  • Revision ID: monty@inaugust.com-20080915172404-ygh6hiyu0q7qpa9x
Removed strndup calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
--disable_warnings
6
6
drop table if exists t1,t2,t3,t11,t12;
7
7
--enable_warnings
8
 
CREATE TABLE t1 (a int, b int);
 
8
CREATE TABLE t1 (a tinyint, b tinyint);
9
9
INSERT INTO t1 VALUES (1,1);
10
10
INSERT LOW_PRIORITY INTO t1 VALUES (1,2);
11
11
INSERT INTO t1 VALUES (1,3);
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
118
117
select * from t12;
119
118
select * from t2;
120
119
-- error 1242
121
120
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
122
121
select * from t11;
123
 
--sorted_result
124
122
select * from t12;
125
 
# PBXT: for some reason this returns 2 warnings instead of 1
126
123
delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
127
124
select * from t11;
128
 
--sorted_result
129
125
select * from t12;
130
126
insert into t11 values (2, 12);
131
127
-- error 1242
171
167
# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
172
168
#            non-restricting WHERE is present.
173
169
#
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
179
170
create table t1(f1 int primary key);
180
171
insert into t1 values (4),(3),(1),(2);
181
172
delete from t1 where (@a:= f1) order by f1 limit 1;
186
177
CREATE TABLE t1 (
187
178
  `date` date ,
188
179
  `time` time ,
189
 
  `seq` int NOT NULL auto_increment,
 
180
  `seq` int unsigned NOT NULL auto_increment,
190
181
  PRIMARY KEY  (`seq`),
191
182
  KEY `seq` (`seq`),
192
183
  KEY `time` (`time`),