~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/update.test

  • Committer: Mark Atwood
  • Date: 2008-10-16 11:33:16 UTC
  • mto: (520.1.13 drizzle)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: mark@fallenpegasus.com-20081016113316-ff6jdt31ck90sjdh
an implemention of the errmsg plugin

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 unsigned NOT NULL,
28
 
 shows int unsigned DEFAULT '0' NOT NULL,
29
 
 ishows int unsigned DEFAULT '0' NOT NULL,
30
 
 ushows int unsigned DEFAULT '0' NOT NULL,
31
 
 clicks int unsigned DEFAULT '0' NOT NULL,
32
 
 iclicks int unsigned DEFAULT '0' NOT NULL,
33
 
 uclicks int unsigned DEFAULT '0' NOT NULL,
 
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,
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 unsigned NOT NULL default '0',
50
 
  ticket int unsigned NOT NULL default '0',
 
49
  lfdnr int NOT NULL default '0',
 
50
  ticket int 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 unsigned 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 '',
58
 
  assignment int unsigned NOT NULL default '0',
59
 
  fupcount int unsigned NOT NULL default '0',
60
 
  parent int unsigned NOT NULL default '0',
61
 
  activity int unsigned NOT NULL default '0',
62
 
  priority tinyint unsigned NOT NULL default '1',
 
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',
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 unsigned not null auto_increment;
 
78
alter table t1 change lfdnr lfdnr int 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` smallint unsigned NOT NULL default '0',
 
106
   `id_param` int NOT NULL default '0',
107
107
   `nom_option` char(40) NOT NULL default '',
108
 
   `valid` tinyint NOT NULL default '0',
 
108
   `valid` int NOT NULL default '0',
109
109
   KEY `id_param` (`id_param`,`nom_option`)
110
110
 ) ENGINE=MyISAM;
111
111
 
222
222
delete from t1 order by a limit 1;
223
223
show status like 'handler_read%';
224
224
 
 
225
# PBXT: this select returns a different result to
 
226
# innodb because the 2 updates above change different rows
225
227
select * from t1;
226
228
update t1 set a=a+10,b=1 order by a limit 3;
227
229
update t1 set a=a+11,b=2 order by a limit 3;
289
291
#
290
292
 
291
293
CREATE TABLE t1 (
292
 
  request_id int unsigned NOT NULL auto_increment,
 
294
  request_id int NOT NULL auto_increment,
293
295
  user_id varchar(12) default NULL,
294
296
  time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
295
297
  ip_address varchar(15) default NULL,
356
358
 
357
359
# Create the test tables
358
360
create table t1 (id int, a int, key idx(a));
359
 
create table t2 (id int unsigned not null auto_increment primary key, a int);
 
361
create table t2 (id int not null auto_increment primary key, a int);
360
362
insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);
361
363
insert into t2(a) select a from t2; 
362
364
insert into t2(a) select a from t2;
364
366
update t2 set a=id;
365
367
insert into t1 select * from t2;
366
368
 
 
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....
367
372
# Check that the number of matched rows is correct when the temporary
368
373
# table is small enough to not be converted to MyISAM
369
374
select count(*) from t1 join t2 on (t1.a=t2.a);