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
f84ce681
Commit
f84ce681
authored
Dec 13, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forbid SLAVE STOP if the thread executing the query has locked
tables. This removes a possible deadlock situation.
parent
49162e0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
sql/sql_parse.cc
sql/sql_parse.cc
+18
-0
No files found.
sql/sql_parse.cc
View file @
f84ce681
...
...
@@ -1376,6 +1376,24 @@ mysql_execute_command(void)
start_slave
(
thd
);
break
;
case
SQLCOM_SLAVE_STOP
:
/*
if the client thread has locked tables, a deadlock is possible.
Assume that
- the client thread does LOCK TABLE t READ.
- then the master updates t.
- then the SQL slave thread wants to update t,
so it waits for the client thread because t is locked by it.
- then the client thread does SLAVE STOP.
SLAVE STOP waits for the SQL slave thread to terminate its
update t, which waits for the client thread because t is locked by it.
To prevent that, refuse SLAVE STOP if the
client thread has locked tables
*/
if
(
thd
->
locked_tables
||
thd
->
active_transaction
())
{
send_error
(
&
thd
->
net
,
ER_LOCK_OR_ACTIVE_TRANSACTION
);
break
;
}
stop_slave
(
thd
);
break
;
...
...
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