mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
b429d73d62
- Scheduler is either initialized at server start or never. Starting & stopping is now suspending & resuming. - The scheduler has clear OO interface - Now all calls to the scheduler are synchronous - GLOBAL event_scheduler uses thd::sys_var_tmp (see set_var.cc) - External API is encapsulated into class Events - Includes fixes for all comments of Kostja's review of 19.05.2005 Starting to merge into 5.1-release (5.1.10) and push
61 lines
2.2 KiB
Text
61 lines
2.2 KiB
Text
CREATE DATABASE IF NOT EXISTS events_test;
|
|
CREATE DATABASE events_conn1_test2;
|
|
CREATE TABLE events_test.fill_it(test_name varchar(20), occur datetime);
|
|
CREATE USER event_user2@localhost;
|
|
CREATE DATABASE events_conn2_db;
|
|
GRANT ALL ON *.* TO event_user2@localhost;
|
|
CREATE USER event_user3@localhost;
|
|
CREATE DATABASE events_conn3_db;
|
|
GRANT ALL ON *.* TO event_user3@localhost;
|
|
"In the second connection we create some events which won't be dropped till the end"
|
|
"In the second connection we create some events which won't be dropped till the end"
|
|
USE events_conn1_test2;
|
|
CREATE EVENT ev_drop1 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1;
|
|
CREATE EVENT ev_drop2 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1;
|
|
CREATE EVENT ev_drop3 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1;
|
|
USE events_test;
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS;
|
|
COUNT(*)
|
|
203
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
|
|
COUNT(*)
|
|
3
|
|
DROP DATABASE events_conn1_test2;
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
|
|
COUNT(*)
|
|
0
|
|
"Now testing stability - dropping db -> events while they are running"
|
|
CREATE DATABASE events_conn1_test2;
|
|
USE events_conn1_test2;
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
|
|
COUNT(*)
|
|
100
|
|
SET GLOBAL event_scheduler=1;
|
|
DROP DATABASE events_conn1_test2;
|
|
SET GLOBAL event_scheduler=2;
|
|
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;
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test3';
|
|
COUNT(*)
|
|
100
|
|
CREATE DATABASE events_conn1_test4;
|
|
USE events_conn1_test4;
|
|
CREATE DATABASE events_conn1_test2;
|
|
USE events_conn1_test2;
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
|
|
COUNT(*)
|
|
100
|
|
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;
|
|
DROP DATABASE events_conn1_test4;
|
|
SET GLOBAL event_scheduler=1;
|
|
USE events_test;
|
|
DROP TABLE fill_it;
|
|
DROP DATABASE events_test;
|