~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
drop table if exists t1;
2
 
CREATE TABLE t1 (
3
 
id int(11) NOT NULL auto_increment,
4
 
ggid varchar(32) binary DEFAULT '' NOT NULL,
5
 
email varchar(64) DEFAULT '' NOT NULL,
6
 
passwd varchar(32) binary DEFAULT '' NOT NULL,
7
 
PRIMARY KEY (id),
8
 
UNIQUE ggid (ggid)
9
 
) ENGINE=innodb;
10
 
insert into t1 (ggid,passwd) values ('test1','xxx');
11
 
insert into t1 (ggid,passwd) values ('test2','yyy');
12
 
insert into t1 (ggid,passwd) values ('test2','this will fail');
13
 
ERROR 23000: Duplicate entry 'test2' for key 'ggid'
14
 
insert into t1 (ggid,id) values ('this will fail',1);
15
 
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
16
 
select * from t1 where ggid='test1';
17
 
id      ggid    email   passwd
18
 
1       test1           xxx
19
 
select * from t1 where passwd='xxx';
20
 
id      ggid    email   passwd
21
 
1       test1           xxx
22
 
select * from t1 where id=2;
23
 
id      ggid    email   passwd
24
 
2       test2           yyy
25
 
replace into t1 (ggid,id) values ('this will work',1);
26
 
replace into t1 (ggid,passwd) values ('test2','this will work');
27
 
update t1 set id=100,ggid='test2' where id=1;
28
 
ERROR 23000: Duplicate entry 'test2' for key 'ggid'
29
 
select * from t1;
30
 
id      ggid    email   passwd
31
 
1       this will work          
32
 
3       test2           this will work
33
 
select * from t1 where id=1;
34
 
id      ggid    email   passwd
35
 
1       this will work          
36
 
select * from t1 where id=999;
37
 
id      ggid    email   passwd
38
 
drop table t1;
39
 
End of tests