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
05927abf
Commit
05927abf
authored
Dec 09, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#141 fix table open and close race
parent
d9edc3fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+11
-8
No files found.
storage/tokudb/ha_tokudb.cc
View file @
05927abf
...
...
@@ -216,8 +216,11 @@ static void free_key_and_col_info (KEY_AND_COL_INFO* kc_info) {
}
tokudb_my_free
(
kc_info
->
field_lengths
);
kc_info
->
field_lengths
=
NULL
;
tokudb_my_free
(
kc_info
->
length_bytes
);
kc_info
->
length_bytes
=
NULL
;
tokudb_my_free
(
kc_info
->
blob_fields
);
kc_info
->
blob_fields
=
NULL
;
}
void
TOKUDB_SHARE
::
init
(
void
)
{
...
...
@@ -265,11 +268,6 @@ static TOKUDB_SHARE *get_share(const char *table_name, TABLE_SHARE* table_share)
share
->
table_name
=
tmp_name
;
strmov
(
share
->
table_name
,
table_name
);
error
=
allocate_key_and_col_info
(
table_share
,
&
share
->
kc_info
);
if
(
error
)
{
goto
exit
;
}
error
=
my_hash_insert
(
&
tokudb_open_tables
,
(
uchar
*
)
share
);
if
(
error
)
{
free_key_and_col_info
(
&
share
->
kc_info
);
...
...
@@ -314,19 +312,21 @@ static int free_share(TOKUDB_SHARE * share) {
}
}
free_key_and_col_info
(
&
share
->
kc_info
);
error
=
tokudb
::
close_status
(
&
share
->
status_block
);
assert
(
error
==
0
);
free_key_and_col_info
(
&
share
->
kc_info
);
tokudb_pthread_mutex_lock
(
&
tokudb_mutex
);
tokudb_pthread_mutex_lock
(
&
share
->
mutex
);
share
->
m_state
=
TOKUDB_SHARE
::
CLOSED
;
if
(
share
->
use_count
>
0
)
{
fprintf
(
stderr
,
"%ld %s:%u free_share %p %d
\n
"
,
syscall
(
186
),
__FILE__
,
__LINE__
,
share
,
share
->
use_count
);
tokudb_pthread_cond_broadcast
(
&
share
->
m_openclose_cond
);
tokudb_pthread_mutex_unlock
(
&
share
->
mutex
);
tokudb_pthread_mutex_unlock
(
&
tokudb_mutex
);
}
else
{
my_hash_delete
(
&
tokudb_open_tables
,
(
uchar
*
)
share
);
tokudb_pthread_mutex_unlock
(
&
share
->
mutex
);
...
...
@@ -1818,7 +1818,10 @@ int ha_tokudb::open(const char *name, int mode, uint test_if_locked) {
share
->
m_state
=
TOKUDB_SHARE
::
OPENING
;
tokudb_pthread_mutex_unlock
(
&
share
->
mutex
);
ret_val
=
allocate_key_and_col_info
(
table_share
,
&
share
->
kc_info
);
if
(
ret_val
==
0
)
{
ret_val
=
initialize_share
(
name
,
mode
);
}
tokudb_pthread_mutex_lock
(
&
share
->
mutex
);
if
(
ret_val
==
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