summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthek@kpdesk.mysql.com <>2007-03-16 15:03:43 +0100
committerthek@kpdesk.mysql.com <>2007-03-16 15:03:43 +0100
commit3b2b641d98a7cb150ad1253062998d9cd9f7f8bd (patch)
tree6e70a88442eca32622f7495e3b0840679b1ad0da
parent7d84ef0e11de39c869ec387e30f495b70b2bbffb (diff)
parent218179269fab7227de9f1a603a4786f1120261e1 (diff)
downloadmariadb-git-3b2b641d98a7cb150ad1253062998d9cd9f7f8bd.tar.gz
Merge kpdesk.mysql.com:/home/thek/dev/bug26807/my51-bug26807
into kpdesk.mysql.com:/home/thek/dev/mysql-5.1-runtime
-rw-r--r--mysql-test/r/skip_grants.result2
-rw-r--r--mysql-test/t/skip_grants.test7
-rw-r--r--sql/mysqld.cc5
-rw-r--r--sql/set_var.cc2
4 files changed, 15 insertions, 1 deletions
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index 58ced16acac..9efeb56a837 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -58,3 +58,5 @@ DROP PROCEDURE p3;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
+set global event_scheduler=1;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED or --skip-grant-tables option so it cannot execute this statement
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 6dda97fcf8a..c8ee3490552 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -108,3 +108,10 @@ DROP PROCEDURE p3;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
+
+#
+# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server
+#
+--error ER_OPTION_PREVENTS_STATEMENT
+set global event_scheduler=1;
+
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 83b16d9af0a..1be6f24df45 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3758,6 +3758,7 @@ we force server id to 2, but this MySQL server will not act as a slave.");
udf_init();
#endif
}
+
init_status_vars();
if (opt_bootstrap) /* If running with bootstrap, do not start replication. */
opt_skip_slave_start= 1;
@@ -3804,6 +3805,10 @@ we force server id to 2, but this MySQL server will not act as a slave.");
if (Events::get_instance()->init())
unireg_abort(1);
}
+ else
+ {
+ Events::opt_event_scheduler = Events::EVENTS_DISABLED;
+ }
/* Signal threads waiting for server to be started */
pthread_mutex_lock(&LOCK_server_started);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 91d97b71c1b..a9d2b6541be 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -4000,7 +4000,7 @@ sys_var_event_scheduler::update(THD *thd, set_var *var)
DBUG_ENTER("sys_var_event_scheduler::update");
if (Events::opt_event_scheduler == Events::EVENTS_DISABLED)
{
- my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED");
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--event-scheduler=DISABLED or --skip-grant-tables");
DBUG_RETURN(TRUE);
}