~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/t/update.test

  • Committer: Brian Aker
  • Date: 2008-07-06 15:03:34 UTC
  • Revision ID: brian@tangent.org-20080706150334-xv3xa202trvs0712
USE_RAID cleanup, along with ftbench tools.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
CREATE TABLE t1
26
26
 (
27
 
 place_id int NOT NULL,
28
 
 shows int DEFAULT '0' NOT NULL,
29
 
 ishows int DEFAULT '0' NOT NULL,
30
 
 ushows int DEFAULT '0' NOT NULL,
31
 
 clicks int DEFAULT '0' NOT NULL,
32
 
 iclicks int DEFAULT '0' NOT NULL,
33
 
 uclicks int DEFAULT '0' NOT NULL,
 
27
 place_id int (10) unsigned NOT NULL,
 
28
 shows int(10) unsigned DEFAULT '0' NOT NULL,
 
29
 ishows int(10) unsigned DEFAULT '0' NOT NULL,
 
30
 ushows int(10) unsigned DEFAULT '0' NOT NULL,
 
31
 clicks int(10) unsigned DEFAULT '0' NOT NULL,
 
32
 iclicks int(10) unsigned DEFAULT '0' NOT NULL,
 
33
 uclicks int(10) unsigned DEFAULT '0' NOT NULL,
34
34
 ts timestamp,
35
35
 PRIMARY KEY (place_id,ts)
36
36
 );
46
46
#
47
47
 
48
48
CREATE TABLE t1 (
49
 
  lfdnr int NOT NULL default '0',
50
 
  ticket int NOT NULL default '0',
 
49
  lfdnr int(10) unsigned NOT NULL default '0',
 
50
  ticket int(10) unsigned NOT NULL default '0',
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 int NOT NULL default '0',
 
54
  timestamp int(10) unsigned NOT NULL default '0',
55
55
  tstamp timestamp NOT NULL,
56
 
  status int NOT NULL default '0',
 
56
  status int(3) NOT NULL default '0',
57
57
  type varchar(15) NOT NULL default '',
58
 
  assignment int NOT NULL default '0',
59
 
  fupcount int NOT NULL default '0',
60
 
  parent int NOT NULL default '0',
61
 
  activity int NOT NULL default '0',
62
 
  priority int NOT NULL default '1',
 
58
  assignment int(10) unsigned NOT NULL default '0',
 
59
  fupcount int(4) unsigned NOT NULL default '0',
 
60
  parent int(10) unsigned NOT NULL default '0',
 
61
  activity int(10) unsigned NOT NULL default '0',
 
62
  priority tinyint(1) unsigned NOT NULL default '1',
63
63
  cc varchar(255) NOT NULL default '',
64
64
  bcc varchar(255) NOT NULL default '',
65
65
  body text NOT NULL,
75
75
 
76
76
INSERT INTO t1 VALUES (773,773,'','','',980257344,20010318180652,0,'Open',10,0,0,0,1,'','','','','');
77
77
 
78
 
alter table t1 change lfdnr lfdnr int not null auto_increment;
 
78
alter table t1 change lfdnr lfdnr int(10) unsigned not null auto_increment;
79
79
update t1 set status=1 where type='Open';
80
80
select status from t1;
81
81
drop table t1;
103
103
#
104
104
 
105
105
CREATE TABLE t1 (
106
 
   `id_param` int NOT NULL default '0',
 
106
   `id_param` smallint(3) unsigned NOT NULL default '0',
107
107
   `nom_option` char(40) NOT NULL default '',
108
 
   `valid` int NOT NULL default '0',
 
108
   `valid` tinyint(1) NOT NULL default '0',
109
109
   KEY `id_param` (`id_param`,`nom_option`)
110
110
 ) ENGINE=MyISAM;
111
111
 
130
130
drop table t1;
131
131
 
132
132
#
 
133
# Bug#5553 - Multi table UPDATE IGNORE fails on duplicate keys 
 
134
#
 
135
 
 
136
CREATE TABLE t1 ( 
 
137
   `colA` int(10) unsigned NOT NULL auto_increment,
 
138
   `colB` int(11) NOT NULL default '0',
 
139
   PRIMARY KEY  (`colA`)
 
140
);
 
141
INSERT INTO t1 VALUES (4433,5424);
 
142
CREATE TABLE t2 (
 
143
  `colC` int(10) unsigned NOT NULL default '0',
 
144
  `colA` int(10) unsigned NOT NULL default '0',
 
145
  `colD` int(10) unsigned NOT NULL default '0',
 
146
  `colE` int(10) unsigned NOT NULL default '0',
 
147
  `colF` int(10) unsigned NOT NULL default '0',
 
148
  PRIMARY KEY  (`colC`,`colA`,`colD`,`colE`)
 
149
);
 
150
INSERT INTO t2 VALUES (3,4433,10005,495,500);
 
151
INSERT INTO t2 VALUES (3,4433,10005,496,500);
 
152
INSERT INTO t2 VALUES (3,4433,10009,494,500);
 
153
INSERT INTO t2 VALUES (3,4433,10011,494,500);
 
154
INSERT INTO t2 VALUES (3,4433,10005,497,500);
 
155
INSERT INTO t2 VALUES (3,4433,10013,489,500);
 
156
INSERT INTO t2 VALUES (3,4433,10005,494,500);
 
157
INSERT INTO t2 VALUES (3,4433,10005,493,500);
 
158
INSERT INTO t2 VALUES (3,4433,10005,492,500);
 
159
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;
 
160
SELECT * FROM t2;
 
161
DROP TABLE t1;
 
162
DROP TABLE t2;
 
163
 
 
164
#
133
165
# Bug #6054 
134
166
#
135
167
create table t1 (c1 int, c2 char(6), c3 int);
222
254
delete from t1 order by a limit 1;
223
255
show status like 'handler_read%';
224
256
 
225
 
# PBXT: this select returns a different result to
226
 
# innodb because the 2 updates above change different rows
227
257
select * from t1;
228
258
update t1 set a=a+10,b=1 order by a limit 3;
229
259
update t1 set a=a+11,b=2 order by a limit 3;
291
321
#
292
322
 
293
323
CREATE TABLE t1 (
294
 
  request_id int NOT NULL auto_increment,
 
324
  request_id int unsigned NOT NULL auto_increment,
295
325
  user_id varchar(12) default NULL,
296
326
  time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
297
327
  ip_address varchar(15) default NULL,
327
357
#
328
358
CREATE TABLE t1 (
329
359
 
330
 
  a int,
 
360
  a INT(11),
331
361
  quux decimal( 31, 30 ),
332
362
 
333
363
  UNIQUE KEY bar (a),
358
388
 
359
389
# Create the test tables
360
390
create table t1 (id int, a int, key idx(a));
361
 
create table t2 (id int not null auto_increment primary key, a int);
 
391
create table t2 (id int unsigned not null auto_increment primary key, a int);
362
392
insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);
363
393
insert into t2(a) select a from t2; 
364
394
insert into t2(a) select a from t2;
366
396
update t2 set a=id;
367
397
insert into t1 select * from t2;
368
398
 
369
 
# PBXT: Rows changed are different here between InnoDB and PBXT
370
 
# because PBXT does not update the rows that are not modified!
371
 
# InnoDB seems to do this....
372
399
# Check that the number of matched rows is correct when the temporary
373
400
# table is small enough to not be converted to MyISAM
374
401
select count(*) from t1 join t2 on (t1.a=t2.a);