mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 01:04:19 +01:00
branches/5.1: Merge r2154 from trunk:
innodb.result, innodb.test: Revert the changes in r2145. The tests that were removed by MySQL ChangeSet@1.2598.2.6 2007-11-06 15:42:58-07:00 tsmith@hindu.god were moved to a new test, innodb_autoinc_lock_mode_zero, which is kept in the MySQL BitKeeper tree.
This commit is contained in:
parent
e30795e668
commit
88cdf19670
2 changed files with 3 additions and 77 deletions
|
@ -472,44 +472,6 @@ a b
|
|||
3 3
|
||||
drop table t1,t2;
|
||||
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;
|
||||
set global innodb_autoinc_lock_mode = 0;
|
||||
insert into t1 (ggid,passwd) values ('test1','xxx');
|
||||
insert into t1 (ggid,passwd) values ('test2','yyy');
|
||||
insert into t1 (ggid,passwd) values ('test2','this will fail');
|
||||
ERROR 23000: Duplicate entry 'test2' for key 'ggid'
|
||||
insert into t1 (ggid,id) values ('this will fail',1);
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
select * from t1 where ggid='test1';
|
||||
id ggid email passwd
|
||||
1 test1 xxx
|
||||
select * from t1 where passwd='xxx';
|
||||
id ggid email passwd
|
||||
1 test1 xxx
|
||||
select * from t1 where id=2;
|
||||
id ggid email passwd
|
||||
2 test2 yyy
|
||||
replace into t1 (ggid,id) values ('this will work',1);
|
||||
replace into t1 (ggid,passwd) values ('test2','this will work');
|
||||
update t1 set id=100,ggid='test2' where id=1;
|
||||
ERROR 23000: Duplicate entry 'test2' for key 'ggid'
|
||||
select * from t1;
|
||||
id ggid email passwd
|
||||
1 this will work
|
||||
3 test2 this will work
|
||||
select * from t1 where id=1;
|
||||
id ggid email passwd
|
||||
1 this will work
|
||||
select * from t1 where id=999;
|
||||
id ggid email passwd
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
user_name varchar(12),
|
||||
password text,
|
||||
subscribed char(1),
|
||||
|
@ -1752,13 +1714,13 @@ Variable_name Value
|
|||
Innodb_page_size 16384
|
||||
show status like "Innodb_rows_deleted";
|
||||
Variable_name Value
|
||||
Innodb_rows_deleted 70
|
||||
Innodb_rows_deleted 69
|
||||
show status like "Innodb_rows_inserted";
|
||||
Variable_name Value
|
||||
Innodb_rows_inserted 1083
|
||||
Innodb_rows_inserted 1080
|
||||
show status like "Innodb_rows_updated";
|
||||
Variable_name Value
|
||||
Innodb_rows_updated 886
|
||||
Innodb_rows_updated 885
|
||||
show status like "Innodb_row_lock_waits";
|
||||
Variable_name Value
|
||||
Innodb_row_lock_waits 0
|
||||
|
|
|
@ -326,42 +326,6 @@ select * from t1;
|
|||
select * from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# 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;
|
||||
|
||||
# Set to old style locking
|
||||
set global innodb_autoinc_lock_mode = 0;
|
||||
|
||||
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;
|
||||
|
||||
#
|
||||
# ORDER BY on not primary key
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue