1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-32810 events.events_1 fails in 11.1 and above

fix test cases like

... prepare the test, create a table or a user
create event ... on schedule every 1 second ... do something ...
... verify that something was done
... cleanup drop event, table or user

here the event scheduler can manage to start the worker for the
second execution of the event, then cleanup happens
and the worker realizes that it cannot change the security context
(as the user is dropped) or cannot insert (as the table is dropped).

followup for 279b0db8c6 (that removed suppression of /Event Schedule/)
This commit is contained in:
Sergei Golubchik
2023-11-15 14:17:26 +01:00
parent b545f72ddc
commit 187cbfca7c
4 changed files with 6 additions and 10 deletions

View File

@@ -2,10 +2,6 @@ set sql_mode="";
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted"); call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
call mtr.add_suppression("Incorrect definition of table mysql.event:.*"); call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
call mtr.add_suppression("Event Scheduler: .* DROP command denied to user"); call mtr.add_suppression("Event Scheduler: .* DROP command denied to user");
drop database if exists events_test;
drop database if exists db_x;
drop database if exists mysqltest_db2;
drop database if exists mysqltest_no_such_database;
create database events_test; create database events_test;
use events_test; use events_test;
CREATE USER pauline@localhost; CREATE USER pauline@localhost;

View File

@@ -11,12 +11,6 @@ call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, fou
call mtr.add_suppression("Incorrect definition of table mysql.event:.*"); call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
call mtr.add_suppression("Event Scheduler: .* DROP command denied to user"); call mtr.add_suppression("Event Scheduler: .* DROP command denied to user");
--disable_warnings
drop database if exists events_test;
drop database if exists db_x;
drop database if exists mysqltest_db2;
drop database if exists mysqltest_no_such_database;
--enable_warnings
create database events_test; create database events_test;
use events_test; use events_test;
@@ -44,6 +38,8 @@ DROP EVENT e_x1;
DROP EVENT e_x2; DROP EVENT e_x2;
disconnect priv_conn; disconnect priv_conn;
connection default; connection default;
let $wait_condition= SELECT count(*)=1 from information_schema.processlist;
--source include/wait_condition.inc
DROP DATABASE db_x; DROP DATABASE db_x;
DROP USER pauline@localhost; DROP USER pauline@localhost;
USE events_test; USE events_test;
@@ -103,6 +99,8 @@ delimiter ;|
set global event_scheduler = on; set global event_scheduler = on;
let $wait_condition= SELECT count(*)>0 from mysql.event where name='e_43' and interval_value= 5; let $wait_condition= SELECT count(*)>0 from mysql.event where name='e_43' and interval_value= 5;
--source include/wait_condition.inc --source include/wait_condition.inc
let $wait_condition= SELECT count(*)=2 from information_schema.processlist;
--source include/wait_condition.inc
select db, name, body, status, interval_field, interval_value from mysql.event; select db, name, body, status, interval_field, interval_value from mysql.event;
drop event e_43; drop event e_43;
drop table test_nested; drop table test_nested;

View File

@@ -1,6 +1,7 @@
include/master-slave.inc include/master-slave.inc
[connection master] [connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Event Scheduler: .* Duplicate entry '10' for key 'a'");
# Create tables # Create tables
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=myisam; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=myisam;
INSERT INTO t1 VALUES (1,1,'1'); INSERT INTO t1 VALUES (1,1,'1');

View File

@@ -9,6 +9,7 @@
--source include/master-slave.inc --source include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Event Scheduler: .* Duplicate entry '10' for key 'a'");
# --disable_warnings/--enable_warnings added before/after query # --disable_warnings/--enable_warnings added before/after query
# if one uses UUID() function because we need to avoid warnings # if one uses UUID() function because we need to avoid warnings