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
235d2295
Commit
235d2295
authored
Apr 27, 2005
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 4.0 needs fixes
parents
4f1a696f
0998abc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
3 deletions
+53
-3
sql/lock.cc
sql/lock.cc
+49
-2
sql/mysql_priv.h
sql/mysql_priv.h
+4
-1
No files found.
sql/lock.cc
View file @
235d2295
...
...
@@ -82,7 +82,8 @@ static int unlock_external(THD *thd, TABLE **table,uint count);
static
void
print_lock_error
(
int
error
);
MYSQL_LOCK
*
mysql_lock_tables
(
THD
*
thd
,
TABLE
**
tables
,
uint
count
)
MYSQL_LOCK
*
mysql_lock_tables
(
THD
*
thd
,
TABLE
**
tables
,
uint
count
,
bool
ignore_global_read_lock
)
{
MYSQL_LOCK
*
sql_lock
;
TABLE
*
write_lock_used
;
...
...
@@ -93,7 +94,7 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd,TABLE **tables,uint count)
if
(
!
(
sql_lock
=
get_lock_data
(
thd
,
tables
,
count
,
0
,
&
write_lock_used
)))
break
;
if
(
global_read_lock
&&
write_lock_used
)
if
(
global_read_lock
&&
write_lock_used
&&
!
ignore_global_read_lock
)
{
/*
Someone has issued LOCK ALL TABLES FOR READ and we want a write lock
...
...
@@ -911,3 +912,49 @@ void make_global_read_lock_block_commit(THD *thd)
pthread_mutex_unlock
(
&
LOCK_open
);
thd
->
global_read_lock
=
MADE_GLOBAL_READ_LOCK_BLOCK_COMMIT
;
}
/*
Set protection against global read lock.
SYNOPSIS
set_protect_against_global_read_lock()
void
RETURN
FALSE OK, no global read lock exists.
TRUE Error, global read lock exists already.
*/
my_bool
set_protect_against_global_read_lock
(
void
)
{
my_bool
global_read_lock_exists
;
pthread_mutex_lock
(
&
LOCK_open
);
if
(
!
(
global_read_lock_exists
=
test
(
global_read_lock
)))
protect_against_global_read_lock
++
;
pthread_mutex_unlock
(
&
LOCK_open
);
return
global_read_lock_exists
;
}
/*
Unset protection against global read lock.
SYNOPSIS
unset_protect_against_global_read_lock()
void
RETURN
void
*/
void
unset_protect_against_global_read_lock
(
void
)
{
pthread_mutex_lock
(
&
LOCK_open
);
protect_against_global_read_lock
--
;
pthread_mutex_unlock
(
&
LOCK_open
);
pthread_cond_broadcast
(
&
COND_refresh
);
}
sql/mysql_priv.h
View file @
235d2295
...
...
@@ -975,7 +975,8 @@ extern pthread_t signal_thread;
extern
struct
st_VioSSLAcceptorFd
*
ssl_acceptor_fd
;
#endif
/* HAVE_OPENSSL */
MYSQL_LOCK
*
mysql_lock_tables
(
THD
*
thd
,
TABLE
**
table
,
uint
count
);
MYSQL_LOCK
*
mysql_lock_tables
(
THD
*
thd
,
TABLE
**
table
,
uint
count
,
bool
ignore_global_read_lock
=
FALSE
);
void
mysql_unlock_tables
(
THD
*
thd
,
MYSQL_LOCK
*
sql_lock
);
void
mysql_unlock_read_tables
(
THD
*
thd
,
MYSQL_LOCK
*
sql_lock
);
void
mysql_unlock_some_tables
(
THD
*
thd
,
TABLE
**
table
,
uint
count
);
...
...
@@ -988,6 +989,8 @@ void unlock_global_read_lock(THD *thd);
bool
wait_if_global_read_lock
(
THD
*
thd
,
bool
abort_on_refresh
,
bool
is_not_commit
);
void
start_waiting_global_read_lock
(
THD
*
thd
);
void
make_global_read_lock_block_commit
(
THD
*
thd
);
my_bool
set_protect_against_global_read_lock
(
void
);
void
unset_protect_against_global_read_lock
(
void
);
/* Lock based on name */
int
lock_and_wait_for_table_name
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
...
...
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