~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/update.test

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-26 04:24:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: osullivan.padraig@gmail.com-20090826042402-ryh95r58b7godtbj
Made all data members of the KeyField class private and provided accessors
when necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
# Some strange updates to test some otherwise unused code
15
15
update t1 set a=a+100 where a=1 and a=2;
16
 
--error ER_BAD_FIELD_ERROR
 
16
--error 1054
17
17
update t1 set a=b+100 where a=1 and a=2; 
18
 
--error ER_BAD_FIELD_ERROR
 
18
--error 1054
19
19
update t1 set a=b+100 where c=1 and a=2; 
20
 
--error ER_BAD_FIELD_ERROR
 
20
--error 1054
21
21
update t1 set d=a+100 where a=1;
22
22
select * from t1;
23
23
drop table t1;
51
51
  client varchar(255) NOT NULL default '',
52
52
  replyto varchar(255) NOT NULL default '',
53
53
  subject varchar(100) NOT NULL default '',
54
 
  timestamp_arg int NOT NULL default '0',
 
54
  timestamp int NOT NULL default '0',
55
55
  tstamp timestamp NOT NULL,
56
56
  status int NOT NULL default '0',
57
57
  type varchar(15) NOT NULL default '',
66
66
  comment text,
67
67
  header text,
68
68
  PRIMARY KEY  (lfdnr),
69
 
  KEY k1 (timestamp_arg),
 
69
  KEY k1 (timestamp),
70
70
  KEY k2 (type),
71
71
  KEY k3 (parent),
72
72
  KEY k4 (assignment),
152
152
#
153
153
create table t1(f1 int);
154
154
select DATABASE();
155
 
--error ER_INVALID_GROUP_FUNC_USE
 
155
--error 1111
156
156
update t1 set f1=1 where count(*)=1;
157
157
select DATABASE();
158
 
--error ER_INVALID_GROUP_FUNC_USE
 
158
--error 1111
159
159
delete from t1 where count(*)=1;
160
160
drop table t1;
161
161
 
165
165
 
166
166
flush status;
167
167
select a from t1 order by a limit 1;
168
 
--replace_column 2 #
169
168
show status like 'handler_read%';
170
169
 
171
170
flush status;
172
171
update t1 set a=9999 order by a limit 1;
173
172
update t1 set b=9999 order by a limit 1;
174
 
--replace_column 2 #
175
173
show status like 'handler_read%';
176
174
 
177
175
flush status;
178
176
delete from t1 order by a limit 1;
179
 
--replace_column 2 #
180
177
show status like 'handler_read%';
181
178
 
182
179
flush status;
183
180
delete from t1 order by a desc limit 1;
184
 
--replace_column 2 #
185
181
show status like 'handler_read%';
186
182
 
187
183
alter table t1 disable keys;
188
184
 
189
185
flush status;
190
186
delete from t1 order by a limit 1;
191
 
--replace_column 2 #
192
187
show status like 'handler_read%';
193
188
 
194
189
# PBXT: this select returns a different result to
214
209
create table t1 (a int);
215
210
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
216
211
create table t2 (a int, filler1 char(200), filler2 char(200), key(a));
217
 
insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A CROSS JOIN t1 B;
 
212
insert into t2 select A.a + 10*B.a, 'filler','filler' from t1 A, t1 B;
218
213
flush status;
219
214
update t2 set a=3 where a=2;
220
 
--replace_column 2 #
221
215
show status like 'handler_read%';
222
216
drop table t1, t2;
223
217
 
233
227
# Bug#25126: Wrongly resolved field leads to a crash
234
228
#
235
229
create table t1(f1 int);
236
 
--error ER_BAD_FIELD_ERROR
 
230
--error 1054
237
231
update t1 set f2=1 order by f2;
238
232
drop table t1;
239
233
# End of 4.1 tests
263
257
 
264
258
flush status;
265
259
SELECT user_id FROM t1 WHERE request_id=9999999999999; 
266
 
--replace_column 2 #
267
260
show status like '%Handler_read%';
268
261
SELECT user_id FROM t1 WHERE request_id=999999999999999999999999999999; 
269
 
--replace_column 2 #
270
262
show status like '%Handler_read%';
271
263
UPDATE t1 SET user_id=null WHERE request_id=9999999999999;
272
 
--replace_column 2 #
273
264
show status like '%Handler_read%';
274
265
UPDATE t1 SET user_id=null WHERE request_id=999999999999999999999999999999;
275
 
--replace_column 2 #
276
266
show status like '%Handler_read%';
277
267
 
278
268
DROP TABLE t1;
347
337
 
348
338
drop table t1,t2;
349
339
 
350
 
#
351
 
# Bug #439719: Drizzle crash when running random query generator
352
 
#
353
 
CREATE TABLE t1(col1 enum('a','b') NOT NULL, col2 enum('a','b') DEFAULT NULL, KEY col2 (col2));
354
 
UPDATE t1 SET col1 = "crash" WHERE col2 = now() ;
355
 
 
356
340
connection default;
357
341
disconnect con1;
358
342
 
359
 
drop table t1;
360
343
--echo End of 5.0 tests