From cb2220f1dcb4ade212f76a7244f8f48ff08d0a51 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Wed, 11 Dec 2002 18:27:46 +0100 Subject: [PATCH 1/4] - tagged ChangeSet 1.1276.3.1 as MySQL 3.23.54 - bumped up version number in configure.in to 3.23.55 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3a5c1a56408..7a4498bff97 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 3.23.54) +AM_INIT_AUTOMAKE(mysql, 3.23.55) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From bfd15dd6cabfb720ad71627fd2b2d0978cb7aa3e Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 13 Dec 2002 09:56:02 +0100 Subject: [PATCH 2/4] - added missing "test" to $NOHUP_NICENESS test (thanks to Nick Gaugler for spotting and reporting this) --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index 96568bd5d19..c2b6b8cd8b7 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -159,7 +159,7 @@ then NOHUP_NICENESS=`nohup nice 2>&1` if test $? -eq 0 && test x"$NOHUP_NICENESS" != x0 && nice --1 echo foo > /dev/null 2>&1 then - if $NOHUP_NICENESS -gt 0 + if test $NOHUP_NICENESS -gt 0 then $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" else From a7ac8973a1ec4cf0480b5d2b2b896331e499618d Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Fri, 13 Dec 2002 13:47:25 +0100 Subject: [PATCH 3/4] - fixed another typo in NOHUP_NICENESS testing --- scripts/safe_mysqld.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh index c2b6b8cd8b7..67a38e49e01 100644 --- a/scripts/safe_mysqld.sh +++ b/scripts/safe_mysqld.sh @@ -161,7 +161,7 @@ then then if test $NOHUP_NICENESS -gt 0 then - $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" + NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" else NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup" fi From 3e655c8d1b609795acfe199b6d810efbbe1ffbb7 Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Fri, 13 Dec 2002 16:01:51 +0200 Subject: [PATCH 4/4] Forbid SLAVE STOP if the thread executing the query has locked tables. This removes a possible deadlock situation. --- sql/sql_parse.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ddbc34b2c7e..f26be7f47e0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -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;