~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-03 00:14:39 UTC
  • Revision ID: brian@tangent.org-20080703001439-pit0mcl0wk8elxlq
Cleanup of sql-common and mysqldump

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);
289
321
#
290
322
 
291
323
CREATE TABLE t1 (
292
 
  request_id int NOT NULL auto_increment,
 
324
  request_id int unsigned NOT NULL auto_increment,
293
325
  user_id varchar(12) default NULL,
294
326
  time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
295
327
  ip_address varchar(15) default NULL,
325
357
#
326
358
CREATE TABLE t1 (
327
359
 
328
 
  a int,
 
360
  a INT(11),
329
361
  quux decimal( 31, 30 ),
330
362
 
331
363
  UNIQUE KEY bar (a),
356
388
 
357
389
# Create the test tables
358
390
create table t1 (id int, a int, key idx(a));
359
 
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);
360
392
insert into t2(a) values(1),(2),(3),(4),(5),(6),(7),(8);
361
393
insert into t2(a) select a from t2; 
362
394
insert into t2(a) select a from t2;