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
c894ebd6
Commit
c894ebd6
authored
Jan 17, 2005
by
jan@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Required changes to support recovery of X/Open XA in InnoDB.
parent
2c0d5bb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
53 deletions
+23
-53
innobase/lock/lock0lock.c
innobase/lock/lock0lock.c
+13
-9
innobase/trx/trx0trx.c
innobase/trx/trx0trx.c
+1
-3
sql/ha_innodb.cc
sql/ha_innodb.cc
+9
-41
No files found.
innobase/lock/lock0lock.c
View file @
c894ebd6
...
...
@@ -4417,8 +4417,9 @@ lock_table_queue_validate(
lock
=
UT_LIST_GET_FIRST
(
table
->
locks
);
while
(
lock
)
{
ut_a
(((
lock
->
trx
)
->
conc_state
==
TRX_ACTIVE
)
||
((
lock
->
trx
)
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
));
ut_a
((
lock
->
trx
)
->
conc_state
==
TRX_ACTIVE
||
(
lock
->
trx
)
->
conc_state
==
TRX_PREPARED
||
(
lock
->
trx
)
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
if
(
!
lock_get_wait
(
lock
))
{
...
...
@@ -4464,9 +4465,9 @@ lock_rec_queue_validate(
lock
=
lock_rec_get_first
(
rec
);
while
(
lock
)
{
ut_a
(
lock
->
trx
->
conc_state
==
TRX_ACTIVE
||
lock
->
trx
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
ut_a
(
lock
->
trx
->
conc_state
==
TRX_ACTIVE
||
lock
->
trx
->
conc_state
==
TRX_PREPARED
||
lock
->
trx
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
ut_a
(
trx_in_trx_list
(
lock
->
trx
));
...
...
@@ -4518,8 +4519,10 @@ lock_rec_queue_validate(
lock
=
lock_rec_get_first
(
rec
);
while
(
lock
)
{
ut_a
(
lock
->
trx
->
conc_state
==
TRX_ACTIVE
||
lock
->
trx
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
ut_a
(
lock
->
trx
->
conc_state
==
TRX_ACTIVE
||
lock
->
trx
->
conc_state
==
TRX_PREPARED
||
lock
->
trx
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
ut_a
(
trx_in_trx_list
(
lock
->
trx
));
if
(
index
)
{
...
...
@@ -4600,8 +4603,9 @@ loop:
}
ut_a
(
trx_in_trx_list
(
lock
->
trx
));
ut_a
(
lock
->
trx
->
conc_state
==
TRX_ACTIVE
||
lock
->
trx
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
ut_a
(
lock
->
trx
->
conc_state
==
TRX_ACTIVE
||
lock
->
trx
->
conc_state
==
TRX_PREPARED
||
lock
->
trx
->
conc_state
==
TRX_COMMITTED_IN_MEMORY
);
for
(
i
=
nth_bit
;
i
<
lock_rec_get_n_bits
(
lock
);
i
++
)
{
...
...
innobase/trx/trx0trx.c
View file @
c894ebd6
...
...
@@ -1612,12 +1612,10 @@ trx_print(
fputs
(
", not started"
,
f
);
break
;
case
TRX_ACTIVE
:
case
TRX_PREPARED
:
fprintf
(
f
,
", ACTIVE %lu sec"
,
(
ulong
)
difftime
(
time
(
NULL
),
trx
->
start_time
));
break
;
case
TRX_PREPARED
:
fputs
(
", PREPARED"
,
f
);
break
;
case
TRX_COMMITTED_IN_MEMORY
:
fputs
(
", COMMITTED IN MEMORY"
,
f
);
break
;
...
...
sql/ha_innodb.cc
View file @
c894ebd6
...
...
@@ -156,18 +156,18 @@ static int innobase_rollback_to_savepoint(THD* thd, void *savepoint);
static
int
innobase_savepoint
(
THD
*
thd
,
void
*
savepoint
);
static
handlerton
innobase_hton
=
{
0
,
/* slot */
sizeof
(
trx_named_savept_t
),
/* savepoint size. TODO: use it */
0
,
/* slot */
sizeof
(
trx_named_savept_t
),
/* savepoint size. TODO: use it */
innobase_close_connection
,
innobase_savepoint
,
innobase_rollback_to_savepoint
,
NULL
,
/* savepoint_release */
innobase_commit
,
innobase_rollback
,
innobase_xa_prepare
,
//makes flush_block_commit test to fail
NULL
,
/* recover */
NULL
,
/* commit_by_xid */
NULL
,
/* rollback_by_xid */
NULL
,
/* savepoint_release */
innobase_commit
,
/* commit */
innobase_rollback
,
/* rollback */
innobase_xa_prepare
,
/* prepare */
innobase_xa_recover
,
/* recover */
innobase_commit_by_xid
,
/* commit_by_xid */
innobase_rollback_by_xid
,
/* rollback_by_xid */
};
/*********************************************************************
...
...
@@ -6019,36 +6019,4 @@ int innobase_rollback_by_xid(
}
}
/***********************************************************************
This function is used to test commit/rollback of XA transactions */
int
innobase_xa_end
(
/*================*/
THD
*
thd
)
/* in: MySQL thread handle of the user for whom
transactions should be recovered */
{
DBUG_ENTER
(
"innobase_xa_end"
);
XID
trx_list
[
100
];
int
trx_num
,
trx_num_max
=
100
;
int
i
;
XID
xid
;
while
((
trx_num
=
innobase_xa_recover
(
trx_list
,
trx_num_max
)))
{
for
(
i
=
0
;
i
<
trx_num
;
i
++
)
{
xid
=
trx_list
[
i
];
if
(
i
%
2
)
{
innobase_commit_by_xid
(
&
xid
);
}
else
{
innobase_rollback_by_xid
(
&
xid
);
}
}
}
free
(
trx_list
);
DBUG_RETURN
(
0
);
}
#endif
/* HAVE_INNOBASE_DB */
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