add savepoint start trx and check session stat free route case

This commit is contained in:
felix-w15
2024-07-11 06:16:40 +00:00
committed by ob-robot
parent 5d9e4624bf
commit d85c98a175
2 changed files with 56 additions and 0 deletions

View File

@ -152,6 +152,13 @@ id
select * from t where id = 1000010; select * from t where id = 1000010;
id id
commit; commit;
"CASE 4.9"
savepoint sp6;
select * from t where id = 110;
id
select * from t where id = 1000010;
id
commit;
"------------- 5 - change session auto_commit ----------------------" "------------- 5 - change session auto_commit ----------------------"
"CASE 5.1" "CASE 5.1"
delete from t; delete from t;

View File

@ -318,6 +318,11 @@ set session transaction isolation level read committed;
# select 110; # select 110;
# select 1000010 // replace old tx desc # select 1000010 // replace old tx desc
# commit; # commit;
#Case 9: savepoint start trx
# savepoint sp6;
# insert 1000011
# sleep 10s
# commit;
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
set autocommit=0; set autocommit=0;
--echo "CASE 4.1" --echo "CASE 4.1"
@ -397,6 +402,50 @@ let $session_2=`select connection_id()`;
commit; commit;
if ($session_1 == $session_2) { --echo "txn is not freely routed !! session: 1=$session_1, 2=$session_2"; if ($session_1 == $session_2) { --echo "txn is not freely routed !! session: 1=$session_1, 2=$session_2";
} }
--echo "CASE 4.9"
savepoint sp6;
let $session_0=`select connection_id()`;
select * from t where id = 110;
let $session_1=`select connection_id()`;
select * from t where id = 1000010;
let $session_2=`select connection_id()`;
if ($session_0 != $session_1) {
if ($session_0 != $session_2) {
--echo "unexpected error happen!!!";
}
}
--disable_query_log
--disable_result_log
if ($session_0 == $session_1) {
insert into t values(1000011);
let $session_3=`select connection_id()`;
}
if ($session_0 == $session_2) {
insert into t values(888);
let $session_3=`select connection_id()`;
}
sleep 10;
if ($session_0 == $session_1) {
select * from t where id = 1000011;
let $session_4=`select connection_id()`;
let $txid =`select ob_transaction_id()`;
}
if ($session_0 == $session_2) {
select * from t where id = 888;
let $session_4=`select connection_id()`;
let $txid =`select ob_transaction_id()`;
}
--enable_result_log
--enable_query_log
if ($txid == 0) {
--echo "unexpected error happen!!!";
}
if ($session_4 != $session_3) {
--echo "unexpected error happen!!! session: 0:$session_0, 1:$session_1, 2:$session_2, 3:$session_3, 4:$session_4";
}
commit;
if ($sp_sess == $session_3) { --echo "txn is not freely routed !! session: 1=$session_1, 2=$session_2, 3=$session_3";
}
--echo "------------- 5 - change session auto_commit ----------------------" --echo "------------- 5 - change session auto_commit ----------------------"
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------