~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/innodb_autoinc_lock_mode_zero.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 (
 
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;
 
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