1
by brian
clean slate |
1 |
# This test runs with old-style locking, as:
|
2 |
# --innodb-autoinc-lock-mode=0
|
|
3 |
||
4 |
-- source include/have_innodb.inc |
|
5 |
||
6 |
--disable_warnings |
|
7 |
drop table if exists t1; |
|
8 |
--enable_warnings |
|
9 |
||
10 |
||
11 |
#
|
|
12 |
# Search on unique key
|
|
13 |
#
|
|
14 |
||
15 |
CREATE TABLE t1 ( |
|
520.1.16
by Brian Aker
More test updates (one ulong fix) |
16 |
id int NOT NULL auto_increment, |
1
by brian
clean slate |
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; |
|
23 |
||
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); |
|
30 |
||
31 |
select * from t1 where ggid='test1'; |
|
32 |
select * from t1 where passwd='xxx'; |
|
33 |
select * from t1 where id=2; |
|
34 |
||
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; |
|
43 |
||
44 |
--echo End of tests |