mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Merge siva.hindu.god:/usr/home/tim/m/bk/50-24200
into siva.hindu.god:/usr/home/tim/m/bk/50-release
This commit is contained in:
37
mysql-test/include/innodb_rollback_on_timeout.inc
Normal file
37
mysql-test/include/innodb_rollback_on_timeout.inc
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# Bug #24200: Provide backwards compatibility mode for 4.x "rollback on
|
||||
# transaction timeout"
|
||||
#
|
||||
show variables like 'innodb_rollback_on_timeout';
|
||||
create table t1 (a int unsigned not null primary key) engine = innodb;
|
||||
insert into t1 values (1);
|
||||
commit;
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
connection con2;
|
||||
begin work;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
|
||||
connection con1;
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
# Lock wait timeout set to 2 seconds in <THIS TEST>-master.opt; this
|
||||
# statement will time out; in 5.0.13+, it will not roll back transaction.
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into t1 values (2);
|
||||
# On 5.0.13+, this should give ==> 1, 5
|
||||
select * from t1;
|
||||
commit;
|
||||
|
||||
connection con2;
|
||||
select * from t1;
|
||||
commit;
|
||||
|
||||
connection default;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
@@ -383,4 +383,40 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
|
||||
DROP TABLE t1;
|
||||
show variables like 'innodb_rollback_on_timeout';
|
||||
Variable_name Value
|
||||
innodb_rollback_on_timeout OFF
|
||||
create table t1 (a int unsigned not null primary key) engine = innodb;
|
||||
insert into t1 values (1);
|
||||
commit;
|
||||
begin work;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
5
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
35
mysql-test/r/innodb_timeout_rollback.result
Normal file
35
mysql-test/r/innodb_timeout_rollback.result
Normal file
@@ -0,0 +1,35 @@
|
||||
show variables like 'innodb_rollback_on_timeout';
|
||||
Variable_name Value
|
||||
innodb_rollback_on_timeout ON
|
||||
create table t1 (a int unsigned not null primary key) engine = innodb;
|
||||
insert into t1 values (1);
|
||||
commit;
|
||||
begin work;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
1
mysql-test/t/innodb_mysql-master.opt
Normal file
1
mysql-test/t/innodb_mysql-master.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb-lock-wait-timeout=2
|
@@ -384,4 +384,6 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--source include/innodb_rollback_on_timeout.inc
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
1
mysql-test/t/innodb_timeout_rollback-master.opt
Normal file
1
mysql-test/t/innodb_timeout_rollback-master.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb_lock_wait_timeout=2 --innodb_rollback_on_timeout
|
5
mysql-test/t/innodb_timeout_rollback.test
Normal file
5
mysql-test/t/innodb_timeout_rollback.test
Normal file
@@ -0,0 +1,5 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--source include/innodb_rollback_on_timeout.inc
|
||||
|
||||
--echo End of 5.0 tests
|
Reference in New Issue
Block a user