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
a716ca2c
Commit
a716ca2c
authored
Dec 13, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge patch for LOCK TABLES and SLAVE STOP
parents
af5ff701
7d94b23a
Changes
1
Show 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 @
a716ca2c
...
...
@@ -1630,6 +1630,24 @@ mysql_execute_command(void)
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
;
}
{
LOCK_ACTIVE_MI
;
stop_slave
(
thd
,
active_mi
,
1
/* net report*/
);
...
...
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