mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / innodb / t / innodb_autoinc_lock_mode_zero.test
blob96f748673c0dcdc6fcbb8508b7edfcb01aea41f0
1 # This test runs with old-style locking, as:
2 # --innodb-autoinc-lock-mode=0
4 -- source include/have_innodb.inc
6 --disable_warnings
7 drop table if exists t1;
8 --enable_warnings
12 # Search on unique key
15 CREATE TABLE t1 (
16   id int(11) NOT NULL auto_increment,
17   ggid varchar(32) binary DEFAULT '' NOT NULL,
18   email varchar(64) DEFAULT '' NOT NULL,
19   passwd varchar(32) binary DEFAULT '' NOT NULL,
20   PRIMARY KEY (id),
21   UNIQUE ggid (ggid)
22 ) ENGINE=innodb;
24 insert into t1 (ggid,passwd) values ('test1','xxx');
25 insert into t1 (ggid,passwd) values ('test2','yyy');
26 -- error ER_DUP_ENTRY
27 insert into t1 (ggid,passwd) values ('test2','this will fail');
28 -- error ER_DUP_ENTRY
29 insert into t1 (ggid,id) values ('this will fail',1);
31 select * from t1 where ggid='test1';
32 select * from t1 where passwd='xxx';
33 select * from t1 where id=2;
35 replace into t1 (ggid,id) values ('this will work',1);
36 replace into t1 (ggid,passwd) values ('test2','this will work');
37 -- error ER_DUP_ENTRY
38 update t1 set id=100,ggid='test2' where id=1;
39 select * from t1;
40 select * from t1 where id=1;
41 select * from t1 where id=999;
42 drop table t1;
44 --echo End of tests