From: Date: May 7 2008 12:15pm Subject: bk commit into 5.1 tree (thek:1.2605) BUG#35997 List-Archive: http://lists.mysql.com/commits/46446 X-Bug: 35997 Message-Id: <20080507101536.53165530435@Adventure> Below is the list of changes that have just been committed into a local 5.1 repository of thek. When thek does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2008-05-07 12:15:31+02:00, thek@adventure.(none) +5 -0 Bug#35997 Event scheduler seems to let the server crash, if it is embedded. The event scheduler was not designed to work in embedded mode. This patch disables the system variable 'event_scheduler' used to activate the event scheduler when the server is compiled in embedded mode. mysql-test/r/events_embedded.result@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +2 -0 Add test case to make sure the 'event_scheduler' can't be activated in embedded mode. mysql-test/r/events_embedded.result@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +0 -0 mysql-test/r/is_embedded.require@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +2 -0 Add test case to make sure the 'event_scheduler' can't be activated in embedded mode. mysql-test/r/is_embedded.require@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +0 -0 mysql-test/t/events_embedded.test@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +5 -0 Add test case to make sure the 'event_scheduler' can't be activated in embedded mode. mysql-test/t/events_embedded.test@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +0 -0 sql/set_var.cc@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +5 -3 Disable the event_scheduler system variable if the server is compiled in embedded mode. sql/set_var.h@stripped, 2008-05-07 12:15:28+02:00, thek@adventure.(none) +2 -1 Disable the event_scheduler system variable if the server is compiled in embedded mode. diff -Nrup a/mysql-test/r/events_embedded.result b/mysql-test/r/events_embedded.result --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/mysql-test/r/events_embedded.result 2008-05-07 12:15:28 +02:00 @@ -0,0 +1,2 @@ +set global event_scheduler=ON; +ERROR HY000: Unknown system variable 'event_scheduler' diff -Nrup a/mysql-test/r/is_embedded.require b/mysql-test/r/is_embedded.require --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/mysql-test/r/is_embedded.require 2008-05-07 12:15:28 +02:00 @@ -0,0 +1,2 @@ +have_embedded +1 diff -Nrup a/mysql-test/t/events_embedded.test b/mysql-test/t/events_embedded.test --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/mysql-test/t/events_embedded.test 2008-05-07 12:15:28 +02:00 @@ -0,0 +1,5 @@ +--source include/is_embedded.inc + +--error 1193 +set global event_scheduler=ON; + diff -Nrup a/sql/set_var.cc b/sql/set_var.cc --- a/sql/set_var.cc 2008-04-01 11:03:06 +02:00 +++ b/sql/set_var.cc 2008-05-07 12:15:28 +02:00 @@ -241,7 +241,10 @@ static sys_var_long_ptr sys_delayed_inse static sys_var_long_ptr sys_delayed_queue_size(&vars, "delayed_queue_size", &delayed_queue_size); +#ifndef EMBEDDED_LIBRARY static sys_var_event_scheduler sys_event_scheduler(&vars, "event_scheduler"); +#endif + static sys_var_long_ptr sys_expire_logs_days(&vars, "expire_logs_days", &expire_logs_days); static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush); @@ -4026,13 +4029,12 @@ uchar *sys_var_thd_dbug::value_ptr(THD * return (uchar*) thd->strdup(buf); } - +#ifndef EMBEDDED_LIBRARY bool sys_var_event_scheduler::check(THD *thd, set_var *var) { return check_enum(thd, var, &Events::var_typelib); } - /* The update method of the global variable event_scheduler. If event_scheduler is switched from 0 to 1 then the scheduler main @@ -4071,7 +4073,7 @@ uchar *sys_var_event_scheduler::value_pt { return (uchar *) Events::get_opt_event_scheduler_str(); } - +#endif /**************************************************************************** Used templates diff -Nrup a/sql/set_var.h b/sql/set_var.h --- a/sql/set_var.h 2008-03-25 15:20:36 +01:00 +++ b/sql/set_var.h 2008-05-07 12:15:28 +02:00 @@ -1085,7 +1085,7 @@ public: virtual void set_default(THD *thd, enum_var_type type); }; - +#ifndef EMBEDDED_LIBRARY class sys_var_event_scheduler :public sys_var_long_ptr { /* We need a derived class only to have a warn_deprecated() */ @@ -1101,6 +1101,7 @@ public: return type != STRING_RESULT && type != INT_RESULT; } }; +#endif extern void fix_binlog_format_after_update(THD *thd, enum_var_type type);