summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <andrey@example.com>2006-09-01 13:08:44 +0200
committerunknown <andrey@example.com>2006-09-01 13:08:44 +0200
commitda4734c3bcaacdab12832cad0419453bed2b805b (patch)
treec07ff5deb45ddb410295350324832ffabae0b2f9 /mysql-test
parentf18ec676a0b0be35068e2c464b39d92ac143ec5c (diff)
downloadmariadb-git-da4734c3bcaacdab12832cad0419453bed2b805b.tar.gz
WL#3337 (Event scheduler new architecture)
This is a post-review patch. Fixes the typelib implementation, available only in 5.1.11. --event-scheduler cmdline : DISABLED | ON | OFF | 0 | 1 DISABLED - makes the scheduler unavailable during the server run (ON|1)- When the server is started the scheduler will be started. It can be stopped and restarted by setting appropriate values to GLOBAL event_scheduler (OFF|0)- When the server is started, the scheduler won't be started. It can be started and again stopped by setting appropriate values to GLOBAL event_scheduler. _DEFAULT_ value The GLOBAL variable event_scheduler can have the following values: OFF | ON | 0 | 1 DISABLED is not possible and every attempt will end with an error that it's not a valid value for the variable. OFF | 0 - This is the pre-5.1.11 behavior - The scheduler stops, if not already stopped, and can be started again by setting the value of the variable to ON|1. ON | 1 - This is the pre-5.1.11 behavior - The scheduler starts, if not already started, and can be stopped again by setting the value of the variable to OFF|0. mysql-test/r/events.result: update result mysql-test/r/events_bugs.result: update result mysql-test/r/events_logs_tests.result: update result mysql-test/r/events_restart_phase1.result: update result mysql-test/r/events_restart_phase3.result: update result mysql-test/r/events_scheduling.result: update result mysql-test/r/events_stress.result: update result mysql-test/t/events.test: update test: 2 -> off 1 -> on mysql-test/t/events_bugs.test: update test: 2 -> off 1 -> on mysql-test/t/events_logs_tests.test: update test: 2 -> off 1 -> on mysql-test/t/events_restart_phase1.test: update test: 2 -> off 1 -> on mysql-test/t/events_restart_phase2-master.opt: update master file : 1 => on mysql-test/t/events_scheduling.test: update test: 2 -> off 1 -> on add tests for event_scheduler global variable representation from SHOW VARIABLES. mysql-test/t/events_stress.test: update test: 2 -> off 1 -> on sql/events.cc: Implement two different TYPELIBs for --event-scheduler cmd line option and for GLOBAL variable event_scheduler --event-scheduler cmdline : DISABLED | ON | OFF | 0 | 1 DISABLED - makes the scheduler unavailable during the server run (ON|1)- When the server is started the scheduler will be started. It can be stopped and restarted by setting appropriate values to GLOBAL event_scheduler (OFF|0)- When the server is started, the scheduler won't be started. It can be started and again stopped by setting appropriate values to GLOBAL event_scheduler. _DEFAULT_ value The GLOBAL variable event_scheduler can have the following values: OFF | ON | 0 | 1 DISABLED is not possible and every attempt will end with an error that it's not a valid value for the variable. OFF | 0 - This is the pre-5.1.11 behavior - The scheduler stops, if not already stopped, and can be started again by setting the value of the variable to ON|1. ON | 1 - This is the pre-5.1.11 behavior - The scheduler starts, if not already started, and can be stopped again by setting the value of the variable to OFF|0. sql/events.h: additional TYPELIB for GLOBAL event_scheduler sql/mysqld.cc: --event-scheduler should be checked against a TYPELIB and therefore should be GET_STR, as well as we make the parameter optional. When not provided OFF|0 is used. sql/set_var.cc: Implement typelib for event_scheduler variable. If allows both INT_RESULT -> 0 | 1 and STRING_RESULT -> OFF | ON The variable is shown as DISABLED | ON | OFF sql/set_var.h: Implement typelib, which expects both STRING and INT, for event_scheduler.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/events.result18
-rw-r--r--mysql-test/r/events_bugs.result14
-rw-r--r--mysql-test/r/events_logs_tests.result8
-rw-r--r--mysql-test/r/events_restart_phase1.result4
-rw-r--r--mysql-test/r/events_restart_phase3.result3
-rw-r--r--mysql-test/r/events_scheduling.result38
-rw-r--r--mysql-test/r/events_stress.result10
-rw-r--r--mysql-test/t/events.test20
-rw-r--r--mysql-test/t/events_bugs.test14
-rw-r--r--mysql-test/t/events_logs_tests.test6
-rw-r--r--mysql-test/t/events_restart_phase1.test4
-rw-r--r--mysql-test/t/events_restart_phase2-master.opt2
-rw-r--r--mysql-test/t/events_scheduling.test24
-rw-r--r--mysql-test/t/events_stress.test10
14 files changed, 122 insertions, 53 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index 05b6ff03786..f19c44462c3 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -17,13 +17,13 @@ db_x
SHOW TABLES FROM db_x;
Tables_in_db_x
x_table
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
DROP EVENT e_x1;
DROP EVENT e_x2;
DROP DATABASE db_x;
DROP USER pauline@localhost;
USE events_test;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
drop event if exists event1;
Warnings:
Note 1305 Event event1 does not exist
@@ -94,7 +94,7 @@ begin
alter event e_43 on schedule every 5 minute;
insert into test_nested values(1);
end|
-set global event_scheduler = 1;
+set global event_scheduler = on;
select db, name, body, status, interval_field, interval_value from mysql.event;
db name body status interval_field interval_value
events_test e_43 begin
@@ -113,7 +113,7 @@ drop event non_qualif_ev;
drop table non_qualif;
alter event non_existant rename to non_existant_too;
ERROR HY000: Unknown event 'non_existant'
-set global event_scheduler = 2;
+set global event_scheduler = off;
create event existant on schedule at now() + interval 1 year do select 12;
alter event non_existant rename to existant;
ERROR HY000: Event 'existant' already exists
@@ -315,12 +315,14 @@ ERROR HY000: Incorrect AT value: 'definitely not a datetime'
set names utf8;
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
drop event задачка;
-set event_scheduler=2;
+set event_scheduler=off;
ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
set global event_scheduler=3;
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '3'
+set global event_scheduler=disabled;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled'
"DISABLE the scheduler. Testing that it does not work when the variable is 0"
-set global event_scheduler=2;
+set global event_scheduler=off;
select definer, name, db from mysql.event;
definer name db
select get_lock("test_lock1", 20);
@@ -343,7 +345,7 @@ select count(*) from mysql.event;
count(*)
0
"ENABLE the scheduler and get a lock"
-set global event_scheduler=1;
+set global event_scheduler=on;
select get_lock("test_lock2", 20);
get_lock("test_lock2", 20)
1
@@ -371,7 +373,7 @@ select /*3*/ user, host, db, command, state, info from information_schema.proces
user host db command state info
event_scheduler localhost NULL Daemon Waiting for next activation NULL
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
-set global event_scheduler=2;
+set global event_scheduler=off;
"Should have only our process now:"
select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
user host db command state info
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 38f3eb37902..4ac1cfc413b 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -36,9 +36,9 @@ create event e_55 on schedule at 20200101000000 starts 10000101000000 ends 10000
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starts 10000101000000 ends 10000101000000 do drop table t' at line 1
create event e_55 on schedule every 10 hour starts 10000101000000 do drop table t;
ERROR HY000: Incorrect STARTS value: '10000101000000'
-set global event_scheduler=2;
+set global event_scheduler=off;
delete from mysql.event;
-set global event_scheduler= 1;
+set global event_scheduler= on;
set @old_sql_mode:=@@sql_mode;
set sql_mode=ansi;
select get_lock('test_bug16407', 60);
@@ -57,7 +57,7 @@ root localhost events_test select get_lock('test_bug16407', 60)
select release_lock('test_bug16407');
release_lock('test_bug16407')
1
-set global event_scheduler= 2;
+set global event_scheduler= off;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
events_test e_16407 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
@@ -118,7 +118,7 @@ release_lock('ee_16407_2')
select /*3*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
user host db info
event_scheduler localhost NULL NULL
-set global event_scheduler= 2;
+set global event_scheduler= off;
select * from events_smode_test order by ev_name, a;
ev_name a
ee_16407_3 1980-02-19
@@ -139,7 +139,7 @@ set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
get_lock('ee_16407_5', 60)
1
-set global event_scheduler= 1;
+set global event_scheduler= on;
set sql_mode='traditional';
create procedure ee_16407_5_pendant() begin insert into events_test.events_smode_test values('ee_16407_5','2001-02-29'); end|
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
@@ -180,10 +180,10 @@ drop event ee_16407_5;
drop event ee_16407_6;
drop procedure ee_16407_5_pendant;
drop procedure ee_16407_6_pendant;
-set global event_scheduler= 2;
+set global event_scheduler= off;
drop table events_smode_test;
set sql_mode=@old_sql_mode;
-set global event_scheduler=2;
+set global event_scheduler=off;
delete from mysql.user where User like 'mysqltest_%';
delete from mysql.db where User like 'mysqltest_%';
flush privileges;
diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result
index 5971dead3c8..335ca848387 100644
--- a/mysql-test/r/events_logs_tests.result
+++ b/mysql-test/r/events_logs_tests.result
@@ -14,7 +14,7 @@ USER_HOST CREATE procedure select_general_log()
BEGIN
SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
END
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
TRUNCATE mysql.general_log;
CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL;
"Wait the scheduler to start"
@@ -25,7 +25,7 @@ USER_HOST CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala
USER_HOST SELECT 'alabala', SLEEP(1) FROM DUAL
DROP PROCEDURE select_general_log;
DROP EVENT log_general;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
"Check slow query log"
"Save the values"
SET @old_global_long_query_time:=(select get_value());
@@ -58,12 +58,12 @@ SET SESSION long_query_time=1;
SELECT * FROM slow_event_test;
slo_val val
SET SESSION long_query_time=1;
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5);
"Sleep some more time than the actual event run will take"
SHOW VARIABLES LIKE 'event_scheduler';
Variable_name Value
-event_scheduler 1
+event_scheduler ON
"Check our table. Should see 1 row"
SELECT * FROM slow_event_test;
slo_val val
diff --git a/mysql-test/r/events_restart_phase1.result b/mysql-test/r/events_restart_phase1.result
index cf0a24c267d..a7a46fa0ab1 100644
--- a/mysql-test/r/events_restart_phase1.result
+++ b/mysql-test/r/events_restart_phase1.result
@@ -1,10 +1,12 @@
create database if not exists mysqltest_events_test;
use mysqltest_events_test;
-set global event_scheduler=2;
+set global event_scheduler=off;
create table execution_log(name char(10));
create event abc1 on schedule every 1 second do insert into execution_log value('abc1');
create event abc2 on schedule every 1 second do insert into execution_log value('abc2');
create event abc3 on schedule every 1 second do insert into execution_log value('abc3');
+select name from execution_log;
+name
insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1');
insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2');
"Now we restart the server"
diff --git a/mysql-test/r/events_restart_phase3.result b/mysql-test/r/events_restart_phase3.result
index 398a9d06546..e653d6a7c23 100644
--- a/mysql-test/r/events_restart_phase3.result
+++ b/mysql-test/r/events_restart_phase3.result
@@ -2,6 +2,9 @@ use mysqltest_events_test;
"Should get 3 rows : abc1, abc2, abc3
select distinct name from execution_log order by name;
name
+abc1
+abc2
+abc3
drop event abc1;
drop event abc2;
drop event abc3;
diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result
index a068f7f19bc..180c2e4883d 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -1,11 +1,47 @@
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
+SET GLOBAL event_scheduler=OFF;
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler OFF
+SET GLOBAL event_scheduler=1;
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler ON
+SET GLOBAL event_scheduler=0;
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler OFF
+SET GLOBAL event_scheduler=ON;
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler ON
+SET GLOBAL event_scheduler=DISABLED;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'DISABLED'
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler ON
+SET GLOBAL event_scheduler=-1;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of '-1'
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler ON
+SET GLOBAL event_scheduler=2;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler ON
+SET GLOBAL event_scheduler=5;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of '5'
+SHOW VARIABLES LIKE 'event_scheduler';
+Variable_name Value
+event_scheduler ON
CREATE TABLE table_1(a int);
CREATE TABLE table_2(a int);
CREATE TABLE table_3(a int);
CREATE TABLE table_4(a int);
CREATE TABLE T19170(s1 TIMESTAMP);
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=ON;
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
CREATE EVENT start_n_end
ON SCHEDULE EVERY 1 SECOND
diff --git a/mysql-test/r/events_stress.result b/mysql-test/r/events_stress.result
index 050fe324426..17eb32b36b7 100644
--- a/mysql-test/r/events_stress.result
+++ b/mysql-test/r/events_stress.result
@@ -32,15 +32,15 @@ USE events_conn1_test2;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
COUNT(*)
50
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
DROP DATABASE events_conn1_test2;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
COUNT(*)
0
CREATE DATABASE events_conn1_test3;
USE events_conn1_test3;
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test3';
COUNT(*)
50
@@ -55,9 +55,9 @@ DROP DATABASE events_conn2_db;
DROP DATABASE events_conn3_db;
DROP DATABASE events_conn1_test2;
DROP DATABASE events_conn1_test3;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
DROP DATABASE events_conn1_test4;
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
USE events_test;
DROP TABLE fill_it1;
DROP TABLE fill_it2;
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index 161f4c1aefe..75b80c2c452 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -21,7 +21,7 @@ SET GLOBAL event_scheduler=1;
--sleep 1.2
SHOW DATABASES LIKE 'db_x';
SHOW TABLES FROM db_x;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
connection priv_conn;
DROP EVENT e_x1;
DROP EVENT e_x2;
@@ -33,7 +33,7 @@ USE events_test;
#
# END: BUG #17289 Events: missing privilege check for drop database
#
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
drop event if exists event1;
create event event1 on schedule every 15 minute starts now() ends date_add(now(), interval 5 hour) DO begin end;
alter event event1 rename to event2 enable;
@@ -92,7 +92,7 @@ begin
insert into test_nested values(1);
end|
delimiter ;|
-set global event_scheduler = 1;
+set global event_scheduler = on;
--sleep 3
select db, name, body, status, interval_field, interval_value from mysql.event;
drop event e_43;
@@ -109,7 +109,7 @@ drop table non_qualif;
--error ER_EVENT_DOES_NOT_EXIST
alter event non_existant rename to non_existant_too;
-set global event_scheduler = 2;
+set global event_scheduler = off;
create event existant on schedule at now() + interval 1 year do select 12;
--error ER_EVENT_ALREADY_EXISTS
alter event non_existant rename to existant;
@@ -279,13 +279,15 @@ drop event задачка;
# event_scheduler is a global var
--error ER_GLOBAL_VARIABLE
-set event_scheduler=2;
+set event_scheduler=off;
# event_scheduler could be only either 1 or 2
--error ER_WRONG_VALUE_FOR_VAR
set global event_scheduler=3;
+--error ER_WRONG_VALUE_FOR_VAR
+set global event_scheduler=disabled;
--echo "DISABLE the scheduler. Testing that it does not work when the variable is 0"
-set global event_scheduler=2;
+set global event_scheduler=off;
select definer, name, db from mysql.event;
select get_lock("test_lock1", 20);
create event закачка on schedule every 10 hour do select get_lock("test_lock1", 20);
@@ -303,7 +305,7 @@ select count(*) from mysql.event;
#
#
--echo "ENABLE the scheduler and get a lock"
-set global event_scheduler=1;
+set global event_scheduler=on;
select get_lock("test_lock2", 20);
--echo "Create an event which tries to acquire a mutex. The event locks on the mutex"
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
@@ -329,7 +331,7 @@ create event закачка21 on schedule every 10 hour do select get_lock("test
--sleep 1
--echo "Should have only 3 processes: the scheduler, our conn and the locked event"
select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
-set global event_scheduler=2;
+set global event_scheduler=off;
--sleep 0.8
--echo "Should have only our process now:"
select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
@@ -396,7 +398,7 @@ drop event e1;
##drop event закачка4;
##select release_lock("test_lock4");
-##set global event_scheduler=2;
+##set global event_scheduler=off;
##select sleep(2);
##--replace_column 1 # 6 #
##show processlist;
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 1fcf527c2fc..04c6d8e91f5 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -65,9 +65,9 @@ create event e_55 on schedule every 10 hour starts 10000101000000 do drop table
#
# Start - 16407: Events: Changes in sql_mode won't be taken into account
#
-set global event_scheduler=2;
+set global event_scheduler=off;
delete from mysql.event;
-set global event_scheduler= 1;
+set global event_scheduler= on;
set @old_sql_mode:=@@sql_mode;
set sql_mode=ansi;
select get_lock('test_bug16407', 60);
@@ -83,7 +83,7 @@ delimiter ;|
select /*1*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
select release_lock('test_bug16407');
-set global event_scheduler= 2;
+set global event_scheduler= off;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
--echo "Let's check whether we change the sql_mode on ALTER EVENT"
@@ -132,7 +132,7 @@ select /*2*/ user, host, db, info from information_schema.processlist where info
select release_lock('ee_16407_2');
--sleep 1.2
select /*3*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info;
-set global event_scheduler= 2;
+set global event_scheduler= off;
select * from events_smode_test order by ev_name, a;
--echo "OK, last check before we drop them"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
@@ -146,7 +146,7 @@ delete from events_smode_test;
set sql_mode='ansi';
select get_lock('ee_16407_5', 60);
-set global event_scheduler= 1;
+set global event_scheduler= on;
set sql_mode='traditional';
delimiter |;
@@ -179,7 +179,7 @@ drop event ee_16407_5;
drop event ee_16407_6;
drop procedure ee_16407_5_pendant;
drop procedure ee_16407_6_pendant;
-set global event_scheduler= 2;
+set global event_scheduler= off;
drop table events_smode_test;
set sql_mode=@old_sql_mode;
#
@@ -189,7 +189,7 @@ set sql_mode=@old_sql_mode;
#
# START - 18897: Events: unauthorized action possible with alter event rename
#
-set global event_scheduler=2;
+set global event_scheduler=off;
--disable_warnings
delete from mysql.user where User like 'mysqltest_%';
delete from mysql.db where User like 'mysqltest_%';
diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test
index 62c2aedf6cc..aee16595ef9 100644
--- a/mysql-test/t/events_logs_tests.test
+++ b/mysql-test/t/events_logs_tests.test
@@ -15,7 +15,7 @@ delimiter ;|
--echo "Check General Query Log"
--replace_column 1 USER_HOST
CALL select_general_log();
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
TRUNCATE mysql.general_log;
CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL;
--echo "Wait the scheduler to start"
@@ -25,7 +25,7 @@ CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1
CALL select_general_log();
DROP PROCEDURE select_general_log;
DROP EVENT log_general;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
--echo "Check slow query log"
--disable_query_log
@@ -71,7 +71,7 @@ SET SESSION long_query_time=1;
--echo "This won't go to the slow log"
SELECT * FROM slow_event_test;
SET SESSION long_query_time=1;
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5);
--echo "Sleep some more time than the actual event run will take"
--sleep 2
diff --git a/mysql-test/t/events_restart_phase1.test b/mysql-test/t/events_restart_phase1.test
index 879591e6141..92783ddaef7 100644
--- a/mysql-test/t/events_restart_phase1.test
+++ b/mysql-test/t/events_restart_phase1.test
@@ -6,11 +6,13 @@ create database if not exists mysqltest_events_test;
--enable_warnings
use mysqltest_events_test;
-set global event_scheduler=2;
+set global event_scheduler=off;
create table execution_log(name char(10));
create event abc1 on schedule every 1 second do insert into execution_log value('abc1');
create event abc2 on schedule every 1 second do insert into execution_log value('abc2');
create event abc3 on schedule every 1 second do insert into execution_log value('abc3');
+--sleep 1.5
+select name from execution_log;
insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1');
insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2');
diff --git a/mysql-test/t/events_restart_phase2-master.opt b/mysql-test/t/events_restart_phase2-master.opt
index 656b9e1b017..673e87f4357 100644
--- a/mysql-test/t/events_restart_phase2-master.opt
+++ b/mysql-test/t/events_restart_phase2-master.opt
@@ -1 +1 @@
---event-scheduler=1
+--event-scheduler=on
diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test
index 7a7502fab7e..0002cf9f29f 100644
--- a/mysql-test/t/events_scheduling.test
+++ b/mysql-test/t/events_scheduling.test
@@ -4,12 +4,34 @@
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
+
+SET GLOBAL event_scheduler=OFF;
+SHOW VARIABLES LIKE 'event_scheduler';
+SET GLOBAL event_scheduler=1;
+SHOW VARIABLES LIKE 'event_scheduler';
+SET GLOBAL event_scheduler=0;
+SHOW VARIABLES LIKE 'event_scheduler';
+SET GLOBAL event_scheduler=ON;
+SHOW VARIABLES LIKE 'event_scheduler';
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL event_scheduler=DISABLED;
+SHOW VARIABLES LIKE 'event_scheduler';
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL event_scheduler=-1;
+SHOW VARIABLES LIKE 'event_scheduler';
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL event_scheduler=2;
+SHOW VARIABLES LIKE 'event_scheduler';
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL event_scheduler=5;
+SHOW VARIABLES LIKE 'event_scheduler';
+
CREATE TABLE table_1(a int);
CREATE TABLE table_2(a int);
CREATE TABLE table_3(a int);
CREATE TABLE table_4(a int);
CREATE TABLE T19170(s1 TIMESTAMP);
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=ON;
# We need to have 2 to make it safe with valgrind. This is probably because
# of when we calculate the timestamp value
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
diff --git a/mysql-test/t/events_stress.test b/mysql-test/t/events_stress.test
index a0101861282..fd1ae34ac3c 100644
--- a/mysql-test/t/events_stress.test
+++ b/mysql-test/t/events_stress.test
@@ -61,11 +61,11 @@ while ($1)
}
--enable_query_log
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
--sleep 2.5
DROP DATABASE events_conn1_test2;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
CREATE DATABASE events_conn1_test3;
USE events_conn1_test3;
@@ -77,7 +77,7 @@ while ($1)
dec $1;
}
--enable_query_log
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test3';
CREATE DATABASE events_conn1_test4;
USE events_conn1_test4;
@@ -112,9 +112,9 @@ connection default;
--send
DROP DATABASE events_conn1_test2;
DROP DATABASE events_conn1_test3;
-SET GLOBAL event_scheduler=2;
+SET GLOBAL event_scheduler=off;
DROP DATABASE events_conn1_test4;
-SET GLOBAL event_scheduler=1;
+SET GLOBAL event_scheduler=on;
connection conn2;
reap;
disconnect conn2;