~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/tests/t/innodb_autoinc_lock_mode_zero.test

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

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_plugin.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 NOT NULL auto_increment,
 
17
  ggid varbinary(32)  DEFAULT '' NOT NULL,
 
18
  email varchar(64) DEFAULT '' NOT NULL,
 
19
  passwd varbinary(32) 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