mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge a change from mysql-5.1-innodb:
------------------------------------------------------------ revno: 3500 revision-id: marko.makela@oracle.com-20100603095032-v5ptkkzt1bhz0m1d parent: marko.makela@oracle.com-20100603094859-8cibt7xns239jjvc committer: Marko Mäkelä <marko.makela@oracle.com> branch nick: 5.1-innodb timestamp: Thu 2010-06-03 12:50:32 +0300 message: Move some InnoDB tests to mysql-test/suite/innodb.
This commit is contained in:
44
mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test
Normal file
44
mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test
Normal file
@ -0,0 +1,44 @@
|
||||
# This test runs with old-style locking, as:
|
||||
# --innodb-autoinc-lock-mode=0
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
|
||||
#
|
||||
# Search on unique key
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
ggid varchar(32) binary DEFAULT '' NOT NULL,
|
||||
email varchar(64) DEFAULT '' NOT NULL,
|
||||
passwd varchar(32) binary DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE ggid (ggid)
|
||||
) ENGINE=innodb;
|
||||
|
||||
insert into t1 (ggid,passwd) values ('test1','xxx');
|
||||
insert into t1 (ggid,passwd) values ('test2','yyy');
|
||||
-- error ER_DUP_ENTRY
|
||||
insert into t1 (ggid,passwd) values ('test2','this will fail');
|
||||
-- error ER_DUP_ENTRY
|
||||
insert into t1 (ggid,id) values ('this will fail',1);
|
||||
|
||||
select * from t1 where ggid='test1';
|
||||
select * from t1 where passwd='xxx';
|
||||
select * from t1 where id=2;
|
||||
|
||||
replace into t1 (ggid,id) values ('this will work',1);
|
||||
replace into t1 (ggid,passwd) values ('test2','this will work');
|
||||
-- error ER_DUP_ENTRY
|
||||
update t1 set id=100,ggid='test2' where id=1;
|
||||
select * from t1;
|
||||
select * from t1 where id=1;
|
||||
select * from t1 where id=999;
|
||||
drop table t1;
|
||||
|
||||
--echo End of tests
|
Reference in New Issue
Block a user