Debian Codegraph @

mysql-test/suite/innodb/r/innodb_autoinc_lock_mode_zero.result

raw
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