mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#12935 Local and XA transactions not mutually exclusive
This commit is contained in:
@ -9,10 +9,10 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
xa start 'test2';
|
xa start 'test2';
|
||||||
xa start 'test-bad';
|
xa start 'test-bad';
|
||||||
ERROR XAE07: XAER_RMFAIL: The command cannot be executed in the ACTIVE state
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
||||||
insert t1 values (20);
|
insert t1 values (20);
|
||||||
xa prepare 'test2';
|
xa prepare 'test2';
|
||||||
ERROR XAE07: XAER_RMFAIL: The command cannot be executed in the ACTIVE state
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
||||||
xa end 'test2';
|
xa end 'test2';
|
||||||
xa prepare 'test2';
|
xa prepare 'test2';
|
||||||
xa commit 'test2';
|
xa commit 'test2';
|
||||||
@ -21,7 +21,13 @@ a
|
|||||||
20
|
20
|
||||||
xa start 'testa','testb';
|
xa start 'testa','testb';
|
||||||
insert t1 values (30);
|
insert t1 values (30);
|
||||||
|
commit;
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
||||||
xa end 'testa','testb';
|
xa end 'testa','testb';
|
||||||
|
begin;
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
||||||
|
create table t2 (a int);
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
||||||
xa start 'testa','testb';
|
xa start 'testa','testb';
|
||||||
ERROR XAE08: XAER_DUPID: The XID already exists
|
ERROR XAE08: XAER_DUPID: The XID already exists
|
||||||
xa start 'testa','testb', 123;
|
xa start 'testa','testb', 123;
|
||||||
@ -30,6 +36,8 @@ xa start 0x7465737462, 0x2030405060, 0xb;
|
|||||||
insert t1 values (40);
|
insert t1 values (40);
|
||||||
xa end 'testb',' 0@P`',11;
|
xa end 'testb',' 0@P`',11;
|
||||||
xa prepare 'testb',0x2030405060,11;
|
xa prepare 'testb',0x2030405060,11;
|
||||||
|
start transaction;
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
|
||||||
xa recover;
|
xa recover;
|
||||||
formatID gtrid_length bqual_length data
|
formatID gtrid_length bqual_length data
|
||||||
11 5 5 testb 0@P`
|
11 5 5 testb 0@P`
|
||||||
|
@ -26,8 +26,17 @@ select * from t1;
|
|||||||
|
|
||||||
xa start 'testa','testb';
|
xa start 'testa','testb';
|
||||||
insert t1 values (30);
|
insert t1 values (30);
|
||||||
|
|
||||||
|
--error 1399
|
||||||
|
commit;
|
||||||
|
|
||||||
xa end 'testa','testb';
|
xa end 'testa','testb';
|
||||||
|
|
||||||
|
--error 1399
|
||||||
|
begin;
|
||||||
|
--error 1399
|
||||||
|
create table t2 (a int);
|
||||||
|
|
||||||
connect (con1,localhost,,,);
|
connect (con1,localhost,,,);
|
||||||
connection con1;
|
connection con1;
|
||||||
|
|
||||||
@ -42,6 +51,9 @@ insert t1 values (40);
|
|||||||
xa end 'testb',' 0@P`',11;
|
xa end 'testb',' 0@P`',11;
|
||||||
xa prepare 'testb',0x2030405060,11;
|
xa prepare 'testb',0x2030405060,11;
|
||||||
|
|
||||||
|
--error 1399
|
||||||
|
start transaction;
|
||||||
|
|
||||||
xa recover;
|
xa recover;
|
||||||
|
|
||||||
# uncomment the line below when binlog will be able to prepare
|
# uncomment the line below when binlog will be able to prepare
|
||||||
|
@ -5311,7 +5311,8 @@ ER_XAER_NOTA XAE04
|
|||||||
ER_XAER_INVAL XAE05
|
ER_XAER_INVAL XAE05
|
||||||
eng "XAER_INVAL: Invalid arguments (or unsupported command)"
|
eng "XAER_INVAL: Invalid arguments (or unsupported command)"
|
||||||
ER_XAER_RMFAIL XAE07
|
ER_XAER_RMFAIL XAE07
|
||||||
eng "XAER_RMFAIL: The command cannot be executed in the %.64s state"
|
eng "XAER_RMFAIL: The command cannot be executed when global transaction is in the %.64s state"
|
||||||
|
rus "XAER_RMFAIL: <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '%.64s'"
|
||||||
ER_XAER_OUTSIDE XAE09
|
ER_XAER_OUTSIDE XAE09
|
||||||
eng "XAER_OUTSIDE: Some work is done outside global transaction"
|
eng "XAER_OUTSIDE: Some work is done outside global transaction"
|
||||||
ER_XAER_RMERR XAE03
|
ER_XAER_RMERR XAE03
|
||||||
|
@ -134,6 +134,12 @@ static bool end_active_trans(THD *thd)
|
|||||||
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
if (thd->transaction.xid_state.xa_state != XA_NOTR)
|
||||||
|
{
|
||||||
|
my_error(ER_XAER_RMFAIL, MYF(0),
|
||||||
|
xa_state_names[thd->transaction.xid_state.xa_state]);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
|
if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
|
||||||
OPTION_TABLE_LOCK))
|
OPTION_TABLE_LOCK))
|
||||||
{
|
{
|
||||||
@ -1368,6 +1374,12 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion)
|
|||||||
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0));
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
if (thd->transaction.xid_state.xa_state != XA_NOTR)
|
||||||
|
{
|
||||||
|
my_error(ER_XAER_RMFAIL, MYF(0),
|
||||||
|
xa_state_names[thd->transaction.xid_state.xa_state]);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
switch (completion) {
|
switch (completion) {
|
||||||
case COMMIT:
|
case COMMIT:
|
||||||
/*
|
/*
|
||||||
@ -3926,6 +3938,12 @@ end_with_restore_list:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SQLCOM_BEGIN:
|
case SQLCOM_BEGIN:
|
||||||
|
if (thd->transaction.xid_state.xa_state != XA_NOTR)
|
||||||
|
{
|
||||||
|
my_error(ER_XAER_RMFAIL, MYF(0),
|
||||||
|
xa_state_names[thd->transaction.xid_state.xa_state]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (begin_trans(thd))
|
if (begin_trans(thd))
|
||||||
goto error;
|
goto error;
|
||||||
send_ok(thd);
|
send_ok(thd);
|
||||||
|
Reference in New Issue
Block a user