mariadb/mysql-test/t/event_scheduler_basic.test
unknown 5908a32eea Bug#35997 Event scheduler seems to let the server crash, if it is embedded.
Enable previously disabled test cases which were tested against
the embedded build. The test cases are modified so that they require
non-embedded build.


mysql-test/t/disabled.def:
  Re-enabled event_scheduler_basic and event_scheduler_func since
  these tests aren't suppose to work in embedded build anyway.
mysql-test/t/event_scheduler_basic.test:
  Require that this test isn't run on embedded build
mysql-test/t/event_scheduler_func.test:
  Require that this test isn't run on embedded build
2008-05-09 11:10:36 +02:00

175 lines
7.5 KiB
Text

#################### mysql-test\t\event_scheduler_basic.test ###################
# #
# Variable Name: event_scheduler #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Enumeration #
# Default Value: OFF #
# Valid Values: ON, OFF, DISABLED #
# #
# #
# Creation Date: 2008-03-14 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable "event_scheduler" #
# that checks behavior of this variable in the following ways #
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-options.html#option_mysqld_event-scheduler #
# #
################################################################################
--source include/not_embedded.inc
--source include/load_sysvars.inc
###############################################################
# START OF event_scheduler TESTS #
###############################################################
#######################################################################
# Saving initial value of event_scheduler in a temporary variable #
#######################################################################
SET @start_value = @@global.event_scheduler;
SELECT @start_value;
--echo '#---------------------FN_DYNVARS_004_01-------------------------#'
###############################################
# Verify default value of variable #
###############################################
--Error ER_NO_DEFAULT
SET @@global.event_scheduler = DEFAULT;
#SELECT @@global.event_scheduler = OFF;
--echo 'Bug# 34878: According to documentation the default value of variable is OFF';
--echo '#--------------------FN_DYNVARS_004_02------------------------#'
#######################################################################
# Change the value of event_scheduler to a valid value #
#######################################################################
SET @@global.event_scheduler = ON;
SELECT @@global.event_scheduler;
SET @@global.event_scheduler = OFF;
SELECT @@global.event_scheduler;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = DISABLED;
SELECT @@global.event_scheduler;
--echo '#--------------------FN_DYNVARS_004_03-------------------------#'
#######################################################################
# Change the value of event_scheduler to invalid value #
#######################################################################
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = 2;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = -1;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = TRUEF;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = TRUE_F;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = FALSE0;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = OON;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = OOFF;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = 0FF;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = ' ';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = " ";
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.event_scheduler = '';
--echo '#-------------------FN_DYNVARS_004_04----------------------------#'
###################################################################
# Test if accessing session event_scheduler gives error #
###################################################################
--Error ER_GLOBAL_VARIABLE
SET @@session.event_scheduler = OFF;
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.event_scheduler;
--echo '#----------------------FN_DYNVARS_004_05------------------------#'
##############################################################################
# Check if the value in GLOBAL Tables matches values in variable #
##############################################################################
SELECT @@global.event_scheduler = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='event_scheduler';
--echo '#---------------------FN_DYNVARS_004_06----------------------#'
###################################################################
# Check if 0 and 1 values can be used on variable #
###################################################################
SET @@global.event_scheduler = 0;
SELECT @@global.event_scheduler;
SET @@global.event_scheduler = 1;
SELECT @@global.event_scheduler;
--echo '#---------------------FN_DYNVARS_004_07----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
SET @@global.event_scheduler = TRUE;
SELECT @@global.event_scheduler;
SET @@global.event_scheduler = FALSE;
SELECT @@global.event_scheduler;
--echo '#---------------------FN_DYNVARS_004_08----------------------#'
##############################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
# to same session variable #
##############################################################################
SET @@global.event_scheduler = ON;
SELECT @@event_scheduler = @@global.event_scheduler;
--echo '#---------------------FN_DYNVARS_004_09----------------------#'
#######################################################################
# Check if event_scheduler can be accessed with and without @@ sign #
#######################################################################
--Error ER_GLOBAL_VARIABLE
SET event_scheduler = ON;
--Error ER_PARSE_ERROR
SET local.event_scheduler = OFF;
--Error ER_UNKNOWN_TABLE
SELECT local.event_scheduler;
--Error ER_PARSE_ERROR
SET global.event_scheduler = ON;
--Error ER_UNKNOWN_TABLE
SELECT global.event_scheduler;
--Error ER_BAD_FIELD_ERROR
SELECT event_scheduler = @@session.event_scheduler;
##############################
# Restore initial value #
##############################
SET @@global.event_scheduler = @start_value;
SELECT @@global.event_scheduler;
#####################################################
# END OF event_scheduler TESTS #
#####################################################