Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
992f6754
Commit
992f6754
authored
Mar 10, 2010
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG51342 to 5.0-bugteam.
parents
91056475
405fd822
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
mysql-test/r/xa.result
mysql-test/r/xa.result
+17
-0
mysql-test/t/xa.test
mysql-test/t/xa.test
+16
-0
sql/set_var.cc
sql/set_var.cc
+7
-0
No files found.
mysql-test/r/xa.result
View file @
992f6754
...
...
@@ -74,4 +74,21 @@ ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was det
xa rollback 'a','c';
xa start 'a','c';
drop table t1;
#
# BUG#51342 - more xid crashing
#
CREATE TABLE t1(a INT) ENGINE=InnoDB;
XA START 'x';
SET SESSION autocommit=0;
INSERT INTO t1 VALUES(1);
SET SESSION autocommit=1;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
SELECT @@autocommit;
@@autocommit
0
INSERT INTO t1 VALUES(1);
XA END 'x';
XA COMMIT 'x' ONE PHASE;
DROP TABLE t1;
SET SESSION autocommit=DEFAULT;
End of 5.0 tests
mysql-test/t/xa.test
View file @
992f6754
...
...
@@ -122,6 +122,22 @@ xa start 'a','c';
--
connection
default
drop
table
t1
;
--
echo
#
--
echo
# BUG#51342 - more xid crashing
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
InnoDB
;
XA
START
'x'
;
SET
SESSION
autocommit
=
0
;
INSERT
INTO
t1
VALUES
(
1
);
--
error
ER_XAER_RMFAIL
SET
SESSION
autocommit
=
1
;
SELECT
@@
autocommit
;
INSERT
INTO
t1
VALUES
(
1
);
XA
END
'x'
;
XA
COMMIT
'x'
ONE
PHASE
;
DROP
TABLE
t1
;
SET
SESSION
autocommit
=
DEFAULT
;
--
echo
End
of
5.0
tests
# Wait till all disconnects are completed
...
...
sql/set_var.cc
View file @
992f6754
...
...
@@ -3065,6 +3065,13 @@ static bool set_option_autocommit(THD *thd, set_var *var)
if
((
org_options
&
OPTION_NOT_AUTOCOMMIT
))
{
/* We changed to auto_commit mode */
if
(
thd
->
transaction
.
xid_state
.
xa_state
!=
XA_NOTR
)
{
thd
->
options
=
org_options
;
my_error
(
ER_XAER_RMFAIL
,
MYF
(
0
),
xa_state_names
[
thd
->
transaction
.
xid_state
.
xa_state
]);
return
1
;
}
thd
->
options
&=
~
OPTION_BEGIN
;
thd
->
transaction
.
all
.
modified_non_trans_table
=
FALSE
;
thd
->
server_status
|=
SERVER_STATUS_AUTOCOMMIT
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment