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
410b8485
Commit
410b8485
authored
Nov 21, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#87 grab exclusive MDL in the tokudb alter table commit function
parent
1284081b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
storage/tokudb/ha_tokudb_alter_56.cc
storage/tokudb/ha_tokudb_alter_56.cc
+23
-1
No files found.
storage/tokudb/ha_tokudb_alter_56.cc
View file @
410b8485
...
...
@@ -106,6 +106,7 @@ PATENT RIGHTS GRANT:
#include "ha_tokudb_alter_common.cc"
#include <sql_array.h>
#include <sql_base.h>
// The tokudb alter context contains the alter state that is set in the check if supported method and used
// later when the alter operation is executed.
...
...
@@ -677,6 +678,28 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i
tokudb_alter_ctx
*
ctx
=
static_cast
<
tokudb_alter_ctx
*>
(
ha_alter_info
->
handler_ctx
);
bool
result
=
false
;
// success
THD
*
thd
=
ha_thd
();
MDL_ticket
*
ticket
=
table
->
mdl_ticket
;
if
(
ticket
->
get_type
()
!=
MDL_EXCLUSIVE
)
{
// get exclusive lock no matter what
#if defined(MARIADB_BASE_VERSION)
killed_state
saved_killed_state
=
thd
->
killed
;
thd
->
killed
=
NOT_KILLED
;
while
(
wait_while_table_is_used
(
thd
,
table
,
HA_EXTRA_NOT_USED
)
&&
thd
->
killed
)
thd
->
killed
=
NOT_KILLED
;
assert
(
ticket
->
get_type
()
==
MDL_EXCLUSIVE
);
if
(
thd
->
killed
==
NOT_KILLED
)
thd
->
killed
=
saved_killed_state
;
#else
THD
::
killed_state
saved_killed_state
=
thd
->
killed
;
thd
->
killed
=
THD
::
NOT_KILLED
;
while
(
wait_while_table_is_used
(
thd
,
table
,
HA_EXTRA_NOT_USED
)
&&
thd
->
killed
)
thd
->
killed
=
THD
::
NOT_KILLED
;
assert
(
ticket
->
get_type
()
==
MDL_EXCLUSIVE
);
if
(
thd
->
killed
==
THD
::
NOT_KILLED
)
thd
->
killed
=
saved_killed_state
;
#endif
}
if
(
commit
)
{
#if (50613 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \
...
...
@@ -699,7 +722,6 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i
if
(
!
commit
)
{
// abort the alter transaction NOW so that any alters are rolled back. this allows the following restores to work.
THD
*
thd
=
ha_thd
();
tokudb_trx_data
*
trx
=
(
tokudb_trx_data
*
)
thd_data_get
(
thd
,
tokudb_hton
->
slot
);
assert
(
ctx
->
alter_txn
==
trx
->
stmt
);
assert
(
trx
->
tokudb_lock_count
>
0
);
...
...
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