diff options
Diffstat (limited to 'mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test')
-rw-r--r-- | mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test new file mode 100644 index 00000000000..5662eec3957 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_net_timeout_basic.test @@ -0,0 +1,187 @@ +################## mysql-test\t\slave_net_timeout_basic.test ################## +# # +# Variable Name: slave_net_timeout # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 3600 # +# Range: # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +# Description: Test Cases of Dynamic System Variable slave_net_timeout # +# that checks the 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-system-variables.html # +# # +############################################################################### + +--source include/not_embedded.inc +--source include/load_sysvars.inc +########################################################### +# START OF slave_net_timeout TESTS # +########################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.slave_net_timeout; +SELECT @start_global_value; + +--echo '#--------------------FN_DYNVARS_146_01-------------------------#' +########################################################### +# Display the DEFAULT value of slave_net_timeout # +########################################################### + +SET @@global.slave_net_timeout = 500000; +SET @@global.slave_net_timeout = DEFAULT; +SELECT @@global.slave_net_timeout; + +--echo '#--------------------FN_DYNVARS_146_02-------------------------#' +############################################################ +# Check the DEFAULT value of slave_net_timeout # +############################################################ + +SET @@global.slave_net_timeout = DEFAULT; +SELECT @@global.slave_net_timeout = 3600; + +--echo '#--------------------FN_DYNVARS_146_03-------------------------#' +########################################################################### +# Change the value of slave_net_timeout to a valid value for GLOBAL Scope # +########################################################################### + +SET @@global.slave_net_timeout = 0; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = 1; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = 15; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = 1024; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = 3600+1; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = 2147483648; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = 2147483648*2-1; +SELECT @@global.slave_net_timeout; + + +--echo '#--------------------FN_DYNVARS_146_04-------------------------#' +############################################################################### +# Check if variable can be access with session scope # +############################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@slave_net_timeout = 2; + +--Error ER_GLOBAL_VARIABLE +SET @@session.slave_net_timeout = 3; + +--Error ER_GLOBAL_VARIABLE +SET @@local.slave_net_timeout = 4; + + + +--echo '#------------------FN_DYNVARS_146_05-----------------------#' +############################################################# +# Change the value of slave_net_timeout to an invalid value # +############################################################# + +SET @@global.slave_net_timeout = -1; +SELECT @@global.slave_net_timeout; + +SET @@global.slave_net_timeout = -2147483648; +SELECT @@global.slave_net_timeout; + +SET @@global.slave_net_timeout = 2147483649*2; +SELECT @@global.slave_net_timeout; + +--Error ER_PARSE_ERROR +SET @@global.slave_net_timeout = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_net_timeout = 100s; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_net_timeout = 7483649.56; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_net_timeout = 0.6; + +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#------------------FN_DYNVARS_146_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SET @@global.slave_net_timeout = 3000; +SELECT @@global.slave_net_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_net_timeout'; + + +--echo '#------------------FN_DYNVARS_146_07-----------------------#' +########################################################################### +# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # +########################################################################### + +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_net_timeout'; + + +--echo '#------------------FN_DYNVARS_146_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.slave_net_timeout = TRUE; +SELECT @@global.slave_net_timeout; +SET @@global.slave_net_timeout = FALSE; +SELECT @@global.slave_net_timeout; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +############################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +############################################################################### + + +SET @@global.slave_net_timeout = 60*60; +SELECT @@slave_net_timeout = @@global.slave_net_timeout; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +########################################################################## +# Check if slave_net_timeout can be accessed without @@ sign and scope # +########################################################################## + +--Error ER_GLOBAL_VARIABLE +SET slave_net_timeout = 2048; +--Error ER_BAD_FIELD_ERROR +SELECT slave_net_timeout; + +SELECT @@slave_net_timeout; + +#verifying another another syntax for setting value +SET global slave_net_timeout = 99; + +#################################### +# Restore initial value # +#################################### + +SET @@global.slave_net_timeout = @start_global_value; +SELECT @@global.slave_net_timeout; + +################################################ +# END OF slave_net_timeout TESTS # +################################################ + |