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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
356a665b
Commit
356a665b
authored
Mar 25, 2014
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal xa
parent
01d12948
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
33 deletions
+34
-33
storage/spider/spd_trx.cc
storage/spider/spd_trx.cc
+34
-33
No files found.
storage/spider/spd_trx.cc
View file @
356a665b
...
...
@@ -1635,46 +1635,47 @@ int spider_internal_start_trx(
thd_get_xid
(
trx
->
thd
,
(
MYSQL_XID
*
)
&
trx
->
xid
);
}
if
(
!
trx
->
trx_xa
&&
trx
->
internal_xa
)
{
if
(
!
trx
->
trx_consistent_snapshot
||
trx
->
internal_xa_snapshot
==
3
)
{
trx
->
trx_xa
=
TRUE
;
trx
->
xid
.
formatID
=
1
;
trx
->
xid
.
gtrid_length
=
my_sprintf
(
trx
->
xid
.
data
,
(
trx
->
xid
.
data
,
"%lx"
,
thd_get_thread_id
(
trx
->
thd
)));
if
(
!
trx
->
trx_xa
&&
trx
->
internal_xa
&&
!
trx
->
trx_consistent_snapshot
||
trx
->
internal_xa_snapshot
==
3
)
{
trx
->
trx_xa
=
TRUE
;
trx
->
xid
.
formatID
=
1
;
trx
->
xid
.
gtrid_length
=
my_sprintf
(
trx
->
xid
.
data
,
(
trx
->
xid
.
data
,
"%lx"
,
thd_get_thread_id
(
trx
->
thd
)));
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100002
trx
->
xid
.
bqual_length
=
my_sprintf
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
"%lx"
,
trx
->
thd
->
variables
.
server_id
));
trx
->
xid
.
bqual_length
=
my_sprintf
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
"%lx"
,
trx
->
thd
->
variables
.
server_id
));
#else
trx
->
xid
.
bqual_length
=
my_sprintf
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
"%x"
,
trx
->
thd
->
server_id
));
trx
->
xid
.
bqual_length
=
my_sprintf
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
(
trx
->
xid
.
data
+
trx
->
xid
.
gtrid_length
,
"%x"
,
trx
->
thd
->
server_id
));
#endif
trx
->
internal_xid_state
.
xa_state
=
XA_ACTIVE
;
trx
->
internal_xid_state
.
xid
.
set
(
&
trx
->
xid
);
trx
->
internal_xid_state
.
in_thd
=
1
;
while
((
error_num
=
spider_xa_lock
(
&
trx
->
internal_xid_state
)))
trx
->
internal_xid_state
.
xa_state
=
XA_ACTIVE
;
trx
->
internal_xid_state
.
xid
.
set
(
&
trx
->
xid
);
trx
->
internal_xid_state
.
in_thd
=
1
;
while
((
error_num
=
spider_xa_lock
(
&
trx
->
internal_xid_state
)))
{
if
(
error_num
!=
ER_SPIDER_XA_LOCKED_NUM
)
goto
error
;
else
if
(
trx
->
xid
.
formatID
==
0
)
{
if
(
error_num
!=
ER_SPIDER_XA_LOCKED_NUM
)
goto
error
;
else
if
(
trx
->
xid
.
formatID
==
0
)
{
my_message
(
error_num
,
ER_SPIDER_XA_LOCKED_STR
,
MYF
(
0
));
goto
error
;
}
/* retry */
trx
->
xid
.
formatID
++
;
trx
->
internal_xid_state
.
xid
.
set
(
&
trx
->
xid
);
my_message
(
error_num
,
ER_SPIDER_XA_LOCKED_STR
,
MYF
(
0
));
goto
error
;
}
xa_lock
=
TRUE
;
/* retry */
trx
->
xid
.
formatID
++
;
trx
->
internal_xid_state
.
xid
.
set
(
&
trx
->
xid
);
}
}
xa_lock
=
TRUE
;
}
else
trx
->
internal_xa
=
FALSE
;
DBUG_PRINT
(
"info"
,(
"spider trx->trx_consistent_snapshot= %s"
,
trx
->
trx_consistent_snapshot
?
"TRUE"
:
"FALSE"
));
...
...
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