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,
62
62
PRIMARY KEY (place_id,ts)
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)
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;
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`)
150
150
INSERT INTO t1 (id_param,nom_option,valid) VALUES (185,'600x1200',1);
173
`colA` int(10) unsigned NOT NULL auto_increment,
174
`colB` int(11) NOT NULL default '0',
177
INSERT INTO t1 VALUES (4433,5424);
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`)
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;
197
colC colA colD colE colF
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);
245
282
update t1 set b=9999 order by a limit 1;
246
283
show status like 'handler_read%';
247
284
Variable_name Value
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
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
260
297
Handler_read_next 0
261
298
Handler_read_prev 0
263
Handler_read_rnd_next 9
300
Handler_read_rnd_next 0
265
302
delete from t1 order by a desc limit 1;
266
303
show status like 'handler_read%';
267
304
Variable_name Value
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;
276
Note 1031 Table storage engine for 't1' doesn't have this option
278
313
delete from t1 order by a limit 1;
279
314
show status like 'handler_read%';
280
315
Variable_name Value
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;
347
382
ERROR 42S22: Unknown column 'f2' in 'order clause'
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,
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;
447
482
update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
449
info: Rows matched: 128 Changed: 128 Warnings: 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);
455
490
update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
457
info: Rows matched: 128 Changed: 128 Warnings: 0
492
info: Rows matched: 128 Changed: 127 Warnings: 0
458
493
drop table t1,t2;