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
1a58d90e
Commit
1a58d90e
authored
Apr 29, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#218 fix incorrect use of num_DBs_lock
parent
0c2889b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+25
-7
No files found.
storage/tokudb/ha_tokudb.cc
View file @
1a58d90e
...
@@ -3928,6 +3928,7 @@ int ha_tokudb::write_row(uchar * record) {
...
@@ -3928,6 +3928,7 @@ int ha_tokudb::write_row(uchar * record) {
tokudb_trx_data
*
trx
=
NULL
;
tokudb_trx_data
*
trx
=
NULL
;
uint
curr_num_DBs
;
uint
curr_num_DBs
;
bool
create_sub_trans
=
false
;
bool
create_sub_trans
=
false
;
bool
num_DBs_locked
=
false
;
//
//
// some crap that needs to be done because MySQL does not properly abstract
// some crap that needs to be done because MySQL does not properly abstract
...
@@ -3975,6 +3976,7 @@ int ha_tokudb::write_row(uchar * record) {
...
@@ -3975,6 +3976,7 @@ int ha_tokudb::write_row(uchar * record) {
//
//
if
(
!
num_DBs_locked_in_bulk
)
{
if
(
!
num_DBs_locked_in_bulk
)
{
rw_rdlock
(
&
share
->
num_DBs_lock
);
rw_rdlock
(
&
share
->
num_DBs_lock
);
num_DBs_locked
=
true
;
}
}
else
{
else
{
lock_count
++
;
lock_count
++
;
...
@@ -4065,7 +4067,7 @@ int ha_tokudb::write_row(uchar * record) {
...
@@ -4065,7 +4067,7 @@ int ha_tokudb::write_row(uchar * record) {
track_progress
(
thd
);
track_progress
(
thd
);
}
}
cleanup:
cleanup:
if
(
!
num_DBs_locked_in_bulk
)
{
if
(
num_DBs_locked
)
{
rw_unlock
(
&
share
->
num_DBs_lock
);
rw_unlock
(
&
share
->
num_DBs_lock
);
}
}
if
(
error
==
DB_KEYEXIST
)
{
if
(
error
==
DB_KEYEXIST
)
{
...
@@ -4156,7 +4158,11 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
...
@@ -4156,7 +4158,11 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
//
//
// grab reader lock on numDBs_lock
// grab reader lock on numDBs_lock
//
//
rw_rdlock
(
&
share
->
num_DBs_lock
);
bool
num_DBs_locked
=
false
;
if
(
!
num_DBs_locked_in_bulk
)
{
rw_rdlock
(
&
share
->
num_DBs_lock
);
num_DBs_locked
=
true
;
}
curr_num_DBs
=
share
->
num_DBs
;
curr_num_DBs
=
share
->
num_DBs
;
if
(
using_ignore
)
{
if
(
using_ignore
)
{
...
@@ -4250,7 +4256,9 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
...
@@ -4250,7 +4256,9 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
cleanup:
cleanup:
rw_unlock
(
&
share
->
num_DBs_lock
);
if
(
num_DBs_locked
)
{
rw_unlock
(
&
share
->
num_DBs_lock
);
}
if
(
error
==
DB_KEYEXIST
)
{
if
(
error
==
DB_KEYEXIST
)
{
error
=
HA_ERR_FOUND_DUPP_KEY
;
error
=
HA_ERR_FOUND_DUPP_KEY
;
}
}
...
@@ -4290,7 +4298,11 @@ int ha_tokudb::delete_row(const uchar * record) {
...
@@ -4290,7 +4298,11 @@ int ha_tokudb::delete_row(const uchar * record) {
//
//
// grab reader lock on numDBs_lock
// grab reader lock on numDBs_lock
//
//
rw_rdlock
(
&
share
->
num_DBs_lock
);
bool
num_DBs_locked
=
false
;
if
(
!
num_DBs_locked_in_bulk
)
{
rw_rdlock
(
&
share
->
num_DBs_lock
);
num_DBs_locked
=
true
;
}
curr_num_DBs
=
share
->
num_DBs
;
curr_num_DBs
=
share
->
num_DBs
;
create_dbt_key_from_table
(
&
prim_key
,
primary_key
,
key_buff
,
record
,
&
has_null
);
create_dbt_key_from_table
(
&
prim_key
,
primary_key
,
key_buff
,
record
,
&
has_null
);
...
@@ -4325,7 +4337,9 @@ int ha_tokudb::delete_row(const uchar * record) {
...
@@ -4325,7 +4337,9 @@ int ha_tokudb::delete_row(const uchar * record) {
track_progress
(
thd
);
track_progress
(
thd
);
}
}
cleanup:
cleanup:
rw_unlock
(
&
share
->
num_DBs_lock
);
if
(
num_DBs_locked
)
{
rw_unlock
(
&
share
->
num_DBs_lock
);
}
TOKUDB_HANDLER_DBUG_RETURN
(
error
);
TOKUDB_HANDLER_DBUG_RETURN
(
error
);
}
}
...
@@ -6052,7 +6066,9 @@ int ha_tokudb::reset(void) {
...
@@ -6052,7 +6066,9 @@ int ha_tokudb::reset(void) {
//
//
int
ha_tokudb
::
acquire_table_lock
(
DB_TXN
*
trans
,
TABLE_LOCK_TYPE
lt
)
{
int
ha_tokudb
::
acquire_table_lock
(
DB_TXN
*
trans
,
TABLE_LOCK_TYPE
lt
)
{
int
error
=
ENOSYS
;
int
error
=
ENOSYS
;
rw_rdlock
(
&
share
->
num_DBs_lock
);
if
(
!
num_DBs_locked_in_bulk
)
{
rw_rdlock
(
&
share
->
num_DBs_lock
);
}
uint
curr_num_DBs
=
share
->
num_DBs
;
uint
curr_num_DBs
=
share
->
num_DBs
;
if
(
lt
==
lock_read
)
{
if
(
lt
==
lock_read
)
{
error
=
0
;
error
=
0
;
...
@@ -6077,7 +6093,9 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) {
...
@@ -6077,7 +6093,9 @@ int ha_tokudb::acquire_table_lock (DB_TXN* trans, TABLE_LOCK_TYPE lt) {
error
=
0
;
error
=
0
;
cleanup:
cleanup:
rw_unlock
(
&
share
->
num_DBs_lock
);
if
(
!
num_DBs_locked_in_bulk
)
{
rw_unlock
(
&
share
->
num_DBs_lock
);
}
return
error
;
return
error
;
}
}
...
...
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