mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
ffbb2bbc09
This is covered in mysql-test/t/variables.test. There is no sense to test this for every individual variables. This is to reduce the coming soon patch for ROW-type routine variables, which will change the error from ER_PARSE_ERROR to a new error "unknown structured variable".
169 lines
7.3 KiB
Text
169 lines
7.3 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 #
|
|
###############################################
|
|
|
|
SET @@global.event_scheduler = DEFAULT;
|
|
SELECT @@global.event_scheduler;
|
|
|
|
--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_UNKNOWN_TABLE
|
|
SELECT local.event_scheduler;
|
|
--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 #
|
|
#####################################################
|