~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/r/update.result

  • Committer: Monty Taylor
  • Date: 2008-07-01 14:33:36 UTC
  • mto: (28.1.12 backport_patch)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: monty@inaugust.com-20080701143336-8uihm7dhpu92rt0q
Somehow missed moving password.c. Duh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
drop table t1;
52
52
CREATE TABLE t1
53
53
(
54
 
place_id int NOT NULL,
55
 
shows int DEFAULT '0' NOT NULL,
56
 
ishows int DEFAULT '0' NOT NULL,
57
 
ushows int DEFAULT '0' NOT NULL,
58
 
clicks int DEFAULT '0' NOT NULL,
59
 
iclicks int DEFAULT '0' NOT NULL,
60
 
uclicks int DEFAULT '0' NOT NULL,
 
54
place_id int (10) unsigned NOT NULL,
 
55
shows int(10) unsigned DEFAULT '0' NOT NULL,
 
56
ishows int(10) unsigned DEFAULT '0' NOT NULL,
 
57
ushows int(10) unsigned DEFAULT '0' NOT NULL,
 
58
clicks int(10) unsigned DEFAULT '0' NOT NULL,
 
59
iclicks int(10) unsigned DEFAULT '0' NOT NULL,
 
60
uclicks int(10) unsigned DEFAULT '0' NOT NULL,
61
61
ts timestamp,
62
62
PRIMARY KEY (place_id,ts)
63
63
);
69
69
1       1
70
70
drop table t1;
71
71
CREATE TABLE t1 (
72
 
lfdnr int NOT NULL default '0',
73
 
ticket int NOT NULL default '0',
 
72
lfdnr int(10) unsigned NOT NULL default '0',
 
73
ticket int(10) unsigned NOT NULL default '0',
74
74
client varchar(255) NOT NULL default '',
75
75
replyto varchar(255) NOT NULL default '',
76
76
subject varchar(100) NOT NULL default '',
77
 
timestamp int NOT NULL default '0',
 
77
timestamp int(10) unsigned NOT NULL default '0',
78
78
tstamp timestamp NOT NULL,
79
 
status int NOT NULL default '0',
 
79
status int(3) NOT NULL default '0',
80
80
type varchar(15) NOT NULL default '',
81
 
assignment int NOT NULL default '0',
82
 
fupcount int NOT NULL default '0',
83
 
parent int NOT NULL default '0',
84
 
activity int NOT NULL default '0',
85
 
priority int NOT NULL default '1',
 
81
assignment int(10) unsigned NOT NULL default '0',
 
82
fupcount int(4) unsigned NOT NULL default '0',
 
83
parent int(10) unsigned NOT NULL default '0',
 
84
activity int(10) unsigned NOT NULL default '0',
 
85
priority tinyint(1) unsigned NOT NULL default '1',
86
86
cc varchar(255) NOT NULL default '',
87
87
bcc varchar(255) NOT NULL default '',
88
88
body text NOT NULL,
96
96
KEY ticket (ticket)
97
97
) ENGINE=MyISAM;
98
98
INSERT INTO t1 VALUES (773,773,'','','',980257344,20010318180652,0,'Open',10,0,0,0,1,'','','','','');
99
 
alter table t1 change lfdnr lfdnr int not null auto_increment;
 
99
alter table t1 change lfdnr lfdnr int(10) unsigned not null auto_increment;
100
100
update t1 set status=1 where type='Open';
101
101
select status from t1;
102
102
status
142
142
update t1 set b=(select distinct 1 from (select * from t2) a);
143
143
drop table t1,t2;
144
144
CREATE TABLE t1 (
145
 
`id_param` int NOT NULL default '0',
 
145
`id_param` smallint(3) unsigned NOT NULL default '0',
146
146
`nom_option` char(40) NOT NULL default '',
147
 
`valid` int NOT NULL default '0',
 
147
`valid` tinyint(1) NOT NULL default '0',
148
148
KEY `id_param` (`id_param`,`nom_option`)
149
149
) ENGINE=MyISAM;
150
150
INSERT INTO t1 (id_param,nom_option,valid) VALUES (185,'600x1200',1);
169
169
2       0       1       2       4
170
170
2       2       0       1       7
171
171
drop table t1;
 
172
CREATE TABLE t1 ( 
 
173
`colA` int(10) unsigned NOT NULL auto_increment,
 
174
`colB` int(11) NOT NULL default '0',
 
175
PRIMARY KEY  (`colA`)
 
176
);
 
177
INSERT INTO t1 VALUES (4433,5424);
 
178
CREATE TABLE t2 (
 
179
`colC` int(10) unsigned NOT NULL default '0',
 
180
`colA` int(10) unsigned NOT NULL default '0',
 
181
`colD` int(10) unsigned NOT NULL default '0',
 
182
`colE` int(10) unsigned NOT NULL default '0',
 
183
`colF` int(10) unsigned NOT NULL default '0',
 
184
PRIMARY KEY  (`colC`,`colA`,`colD`,`colE`)
 
185
);
 
186
INSERT INTO t2 VALUES (3,4433,10005,495,500);
 
187
INSERT INTO t2 VALUES (3,4433,10005,496,500);
 
188
INSERT INTO t2 VALUES (3,4433,10009,494,500);
 
189
INSERT INTO t2 VALUES (3,4433,10011,494,500);
 
190
INSERT INTO t2 VALUES (3,4433,10005,497,500);
 
191
INSERT INTO t2 VALUES (3,4433,10013,489,500);
 
192
INSERT INTO t2 VALUES (3,4433,10005,494,500);
 
193
INSERT INTO t2 VALUES (3,4433,10005,493,500);
 
194
INSERT INTO t2 VALUES (3,4433,10005,492,500);
 
195
UPDATE IGNORE t2,t1 set t2.colE = t2.colE + 1,colF=0 WHERE t1.colA = t2.colA AND (t1.colB & 4096) > 0 AND (colE + 1) < colF;
 
196
SELECT * FROM t2;
 
197
colC    colA    colD    colE    colF
 
198
3       4433    10005   495     500
 
199
3       4433    10005   496     500
 
200
3       4433    10009   495     0
 
201
3       4433    10011   495     0
 
202
3       4433    10005   498     0
 
203
3       4433    10013   490     0
 
204
3       4433    10005   494     500
 
205
3       4433    10005   493     500
 
206
3       4433    10005   492     500
 
207
DROP TABLE t1;
 
208
DROP TABLE t2;
172
209
create table t1 (c1 int, c2 char(6), c3 int);
173
210
create table t2 (c1 int, c2 char(6));
174
211
insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
235
272
show status like 'handler_read%';
236
273
Variable_name   Value
237
274
Handler_read_first      1
238
 
Handler_read_key        2
 
275
Handler_read_key        0
239
276
Handler_read_next       0
240
277
Handler_read_prev       0
241
278
Handler_read_rnd        0
245
282
update t1 set b=9999 order by a limit 1;
246
283
show status like 'handler_read%';
247
284
Variable_name   Value
248
 
Handler_read_first      2
249
 
Handler_read_key        8
 
285
Handler_read_first      1
 
286
Handler_read_key        0
250
287
Handler_read_next       0
251
288
Handler_read_prev       0
252
289
Handler_read_rnd        2
253
 
Handler_read_rnd_next   18
 
290
Handler_read_rnd_next   9
254
291
flush status;
255
292
delete from t1 order by a limit 1;
256
293
show status like 'handler_read%';
257
294
Variable_name   Value
258
295
Handler_read_first      1
259
 
Handler_read_key        4
 
296
Handler_read_key        0
260
297
Handler_read_next       0
261
298
Handler_read_prev       0
262
 
Handler_read_rnd        1
263
 
Handler_read_rnd_next   9
 
299
Handler_read_rnd        0
 
300
Handler_read_rnd_next   0
264
301
flush status;
265
302
delete from t1 order by a desc limit 1;
266
303
show status like 'handler_read%';
267
304
Variable_name   Value
268
 
Handler_read_first      1
269
 
Handler_read_key        4
 
305
Handler_read_first      0
 
306
Handler_read_key        0
270
307
Handler_read_next       0
271
308
Handler_read_prev       0
272
309
Handler_read_rnd        1
273
 
Handler_read_rnd_next   8
 
310
Handler_read_rnd_next   9
274
311
alter table t1 disable keys;
275
 
Warnings:
276
 
Note    1031    Table storage engine for 't1' doesn't have this option
277
312
flush status;
278
313
delete from t1 order by a limit 1;
279
314
show status like 'handler_read%';
280
315
Variable_name   Value
281
 
Handler_read_first      1
282
 
Handler_read_key        4
 
316
Handler_read_first      0
 
317
Handler_read_key        0
283
318
Handler_read_next       0
284
319
Handler_read_prev       0
285
320
Handler_read_rnd        1
286
 
Handler_read_rnd_next   7
 
321
Handler_read_rnd_next   9
287
322
select * from t1;
288
323
a       b
289
324
0       0
332
367
show status like 'handler_read%';
333
368
Variable_name   Value
334
369
Handler_read_first      0
335
 
Handler_read_key        4
 
370
Handler_read_key        1
336
371
Handler_read_next       1
337
372
Handler_read_prev       0
338
373
Handler_read_rnd        1
347
382
ERROR 42S22: Unknown column 'f2' in 'order clause'
348
383
drop table t1;
349
384
CREATE TABLE t1 (
350
 
request_id int NOT NULL auto_increment,
 
385
request_id int unsigned NOT NULL auto_increment,
351
386
user_id varchar(12) default NULL,
352
387
time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
353
388
ip_address varchar(15) default NULL,
369
404
show status like '%Handler_read%';
370
405
Variable_name   Value
371
406
Handler_read_first      0
372
 
Handler_read_key        2
 
407
Handler_read_key        1
373
408
Handler_read_next       0
374
409
Handler_read_prev       0
375
410
Handler_read_rnd        0
379
414
show status like '%Handler_read%';
380
415
Variable_name   Value
381
416
Handler_read_first      0
382
 
Handler_read_key        4
 
417
Handler_read_key        2
383
418
Handler_read_next       0
384
419
Handler_read_prev       0
385
420
Handler_read_rnd        0
388
423
show status like '%Handler_read%';
389
424
Variable_name   Value
390
425
Handler_read_first      0
391
 
Handler_read_key        6
 
426
Handler_read_key        3
392
427
Handler_read_next       0
393
428
Handler_read_prev       0
394
429
Handler_read_rnd        0
397
432
show status like '%Handler_read%';
398
433
Variable_name   Value
399
434
Handler_read_first      0
400
 
Handler_read_key        6
 
435
Handler_read_key        3
401
436
Handler_read_next       0
402
437
Handler_read_prev       0
403
438
Handler_read_rnd        0
404
439
Handler_read_rnd_next   0
405
440
DROP TABLE t1;
406
441
CREATE TABLE t1 (
407
 
a int,
 
442
a INT(11),
408
443
quux decimal( 31, 30 ),
409
444
UNIQUE KEY bar (a),
410
445
KEY quux (quux)
424
459
DROP TABLE t1;
425
460
set tmp_table_size=1024;
426
461
create table t1 (id int, a int, key idx(a));
427
 
create table t2 (id int not null auto_increment primary key, a int);
 
462
create table t2 (id int unsigned not null auto_increment primary key, a int);
428
463
insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);
429
464
insert into t2(a) select a from t2;
430
465
insert into t2(a) select a from t2;
435
470
count(*)
436
471
64
437
472
update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
438
 
affected rows: 64
439
 
info: Rows matched: 64  Changed: 64  Warnings: 0
 
473
affected rows: 0
 
474
info: Rows matched: 64  Changed: 0  Warnings: 0
440
475
insert into t2(a) select a from t2;
441
476
update t2 set a=id;
442
477
truncate t1;
445
480
count(*)
446
481
128
447
482
update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
448
 
affected rows: 128
449
 
info: Rows matched: 128  Changed: 128  Warnings: 0
 
483
affected rows: 0
 
484
info: Rows matched: 128  Changed: 0  Warnings: 0
450
485
update t1 set a=1;
451
486
update t2 set a=1;
452
487
select count(*) from t1 join t2 on (t1.a=t2.a);
453
488
count(*)
454
489
16384
455
490
update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
456
 
affected rows: 128
457
 
info: Rows matched: 128  Changed: 128  Warnings: 0
 
491
affected rows: 127
 
492
info: Rows matched: 128  Changed: 127  Warnings: 0
458
493
drop table t1,t2;
459
494
End of 5.0 tests