summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <svoj@april.(none)>2006-05-24 10:47:09 +0500
committerunknown <svoj@april.(none)>2006-05-24 10:47:09 +0500
commit89fdbbeb36a3dbc48fd56d8880fd8e910931c680 (patch)
tree9407c8d363c3f3ee8df98615784c8953b07bfa4c
parent42bfdef07d2fa2e0389a6f9c7e2a1914841b10e2 (diff)
parentf04b9f247314dfca21cb8bb058537535d5b8c9b0 (diff)
downloadmariadb-git-89fdbbeb36a3dbc48fd56d8880fd8e910931c680.tar.gz
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into april.(none):/home/svoj/devel/mysql/BUG18233/mysql-5.0
-rw-r--r--mysql-test/t/information_schema.test3
-rw-r--r--mysql-test/t/information_schema_chmod.test3
-rw-r--r--mysql-test/t/wait_timeout.test68
-rw-r--r--sql/mysqld.cc15
-rw-r--r--sql/slave.cc11
-rw-r--r--sql/sp_head.cc1
6 files changed, 92 insertions, 9 deletions
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 2cf7a810cdb..48dd28bf6da 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1,9 +1,6 @@
# This test uses grants, which can't get tested for embedded server
-- source include/not_embedded.inc
-# This test uses chmod, can't be run with root permissions
--- source include/not_as_root.inc
-
# Test for information_schema.schemata &
# show databases
diff --git a/mysql-test/t/information_schema_chmod.test b/mysql-test/t/information_schema_chmod.test
index fb850b8e38d..c7ea2b03890 100644
--- a/mysql-test/t/information_schema_chmod.test
+++ b/mysql-test/t/information_schema_chmod.test
@@ -8,6 +8,9 @@
#
--source include/not_windows.inc
+# This test uses chmod, can't be run with root permissions
+-- source include/not_as_root.inc
+
#
# Bug #15851 Unlistable directories yield no info from information_schema
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
index 1fef3deea3c..9310c3502b9 100644
--- a/mysql-test/t/wait_timeout.test
+++ b/mysql-test/t/wait_timeout.test
@@ -4,10 +4,41 @@
#
# Bug #8731: wait_timeout does not work on Mac OS X
#
+
+
+# Connect with another connection and reset counters
+--disable_query_log
+connect (wait_con,localhost,root,,test,,);
+flush status; # Reset counters
+connection wait_con;
+let $retries=300;
+let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`;
+set @aborted_clients= 0;
+--enable_query_log
+
+# Disable reconnect and do the query
+connection default;
--disable_reconnect
select 1;
-# wait_timeout is 1, so we should get disconnected now
---sleep 2
+
+# Switch to wait_con and wait until server has aborted the connection
+--disable_query_log
+connection wait_con;
+while (!`select @aborted_clients`)
+{
+ sleep 0.1;
+ let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`;
+ eval set @aborted_clients= SUBSTRING('$aborted_clients', 16)+0;
+
+ dec $retries;
+ if (!$retries)
+ {
+ Failed to detect that client has been aborted;
+ }
+}
+--enable_query_log
+
+connection default;
# When the connection is closed in this way, the error code should
# be consistent see bug#2845 for an explanation
--error 2006
@@ -15,12 +46,41 @@ select 2;
--enable_reconnect
select 3;
+#
# Do the same test as above on a TCP connection
+# (which we get by specifying a ip adress)
+
+# Connect with another connection and reset counters
+--disable_query_log
+connection wait_con;
+flush status; # Reset counters
+let $retries=300;
+let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`;
+set @aborted_clients= 0;
+--enable_query_log
+
connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
--disable_reconnect
select 1;
-# wait_timeout is 1, so we should get disconnected now
---sleep 2
+
+# Switch to wait_con and wait until server has aborted the connection
+--disable_query_log
+connection wait_con;
+while (!`select @aborted_clients`)
+{
+ sleep 0.1;
+ let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`;
+ eval set @aborted_clients= SUBSTRING('$aborted_clients', 16)+0;
+
+ dec $retries;
+ if (!$retries)
+ {
+ Failed to detect that client has been aborted;
+ }
+}
+--enable_query_log
+
+connection con1;
# When the connection is closed in this way, the error code should
# be consistent see bug#2845 for an explanation
--error 2006
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 50f19c15fc4..a306ec392ed 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -934,7 +934,20 @@ void kill_mysql(void)
DBUG_VOID_RETURN;
}
- /* Force server down. kill all connections and threads and exit */
+/*
+ Force server down. Kill all connections and threads and exit
+
+ SYNOPSIS
+ kill_server
+
+ sig_ptr Signal number that caused kill_server to be called.
+
+ NOTE!
+ A signal number of 0 mean that the function was not called
+ from a signal handler and there is thus no signal to block
+ or stop, we just want to kill the server.
+
+*/
#if defined(OS2) || defined(__NETWARE__)
extern "C" void kill_server(int sig_ptr)
diff --git a/sql/slave.cc b/sql/slave.cc
index fa7ccc4427d..caeefc1ad3c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3949,10 +3949,19 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
delete thd;
pthread_mutex_unlock(&LOCK_thread_count);
pthread_cond_broadcast(&rli->stop_cond);
+
+#ifndef DBUG_OFF
+ /*
+ Bug #19938 Valgrind error (race) in handle_slave_sql()
+ Read the value of rli->event_till_abort before releasing the mutex
+ */
+ const int eta= rli->events_till_abort;
+#endif
+
// tell the world we are done
pthread_mutex_unlock(&rli->run_lock);
#ifndef DBUG_OFF // TODO: reconsider the code below
- if (abort_slave_event_count && !rli->events_till_abort)
+ if (abort_slave_event_count && !eta)
goto slave_begin;
#endif
my_thread_end();
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 174f62c9497..3b29a841966 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -247,6 +247,7 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_TRUNCATE:
case SQLCOM_COMMIT:
case SQLCOM_ROLLBACK:
+ case SQLCOM_LOAD:
case SQLCOM_LOAD_MASTER_DATA:
case SQLCOM_LOCK_TABLES:
case SQLCOM_CREATE_PROCEDURE: