mariadb/mysql-test/t/events_restart_phase1.test
kostja@vajra.(none) 98db230086 A set of changes aiming to make the Event Scheduler more user-friendly
when there are no up-to-date system tables to support it:
 - initialize the scheduler before reporting "Ready for connections".
   This ensures that warnings, if any, are printed before "Ready for
   connections", and this message is not mangled.
 - do not abort the scheduler if there are no system tables
 - check the tables once at start up, remember the status and disable
   the scheduler if the tables are not up to date.
   If one attempts to use the scheduler with bad tables,
   issue an error message.
 - clean up the behaviour of the module under LOCK TABLES and pre-locking
   mode
 - make sure implicit commit of Events DDL works as expected.
 - add more tests


Collateral clean ups in the events code.

This patch fixes Bug#23631 Events: SHOW VARIABLES doesn't work 
when mysql.event is damaged
2007-04-05 15:24:34 +04:00

43 lines
1.7 KiB
Text

# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
#
# Test that when the server is restarted, it checks mysql.event table,
# and disables the scheduler if it's not up to date.
#
# Switch off the scheduler for now.
set global event_scheduler=off;
--disable_warnings
drop database if exists events_test;
--enable_warnings
create database events_test;
use events_test;
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');
#
# There are various conditions when a server would regard mysql.event
# table as damaged:
# - the table has more column than specified in the compiled in value, but
# the version of the server which created the table is the same
# - the column count in the table is less than the compiled in value
# - some column has an incompatible type specification (for what is an
# incompatible type specification please refer to the comments in the source
#
# Unfortunately, in order to test a condition, we need to restart the
# server. Therefore, here we test only one simple case: changing the data
# type of the 'body' field to blob.
#
# First, let's do a backup to not depend on actual definition of mysql.event
create table event_like like mysql.event;
insert into event_like select * from mysql.event;
# Now let's alter the table and restart the server
alter table mysql.event
change column body body longtext character set utf8 collate utf8_bin;
--echo "Now we restart the server"