| 1 |
############## mysql-test\t\net_write_timeout_basic.test ############### |
| 2 |
# # |
| 3 |
# Variable Name: net_write_timeout # |
| 4 |
# Scope: GLOBAL | SESSION # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: numeric # |
| 7 |
# Default Value: 60 # |
| 8 |
# Min Value: 1 # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-07 # |
| 12 |
# Author: Salman # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable net_write_timeout # |
| 15 |
# that checks the behavior of this variable in the following ways# |
| 16 |
# * Default Value # |
| 17 |
# * Valid & Invalid values # |
| 18 |
# * Scope & Access method # |
| 19 |
# * Data Integrity # |
| 20 |
# # |
| 21 |
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # |
| 22 |
# server-system-variables.html # |
| 23 |
# # |
| 24 |
############################################################################### |
| 25 |
|
| 26 |
--source include/load_sysvars.inc |
| 27 |
|
| 28 |
|
| 29 |
################################################################# |
| 30 |
# START OF net_write_timeout TESTS # |
| 31 |
################################################################# |
| 32 |
|
| 33 |
|
| 34 |
############################################################# |
| 35 |
# Save initial value # |
| 36 |
############################################################# |
| 37 |
|
| 38 |
SET @start_global_value = @@global.net_write_timeout; |
| 39 |
SELECT @start_global_value; |
| 40 |
SET @start_session_value = @@session.net_write_timeout; |
| 41 |
SELECT @start_session_value; |
| 42 |
|
| 43 |
|
| 44 |
--echo '#--------------------FN_DYNVARS_112_01-------------------------#' |
| 45 |
################################################################# |
| 46 |
# Display the DEFAULT value of net_write_timeout # |
| 47 |
################################################################# |
| 48 |
|
| 49 |
SET @@global.net_write_timeout = 100; |
| 50 |
SET @@global.net_write_timeout = DEFAULT; |
| 51 |
SELECT @@global.net_write_timeout; |
| 52 |
|
| 53 |
SET @@session.net_write_timeout = 200; |
| 54 |
SET @@session.net_write_timeout = DEFAULT; |
| 55 |
SELECT @@session.net_write_timeout; |
| 56 |
|
| 57 |
|
| 58 |
--echo '#--------------------FN_DYNVARS_112_02-------------------------#' |
| 59 |
################################################################# |
| 60 |
# Check the DEFAULT value of net_write_timeout # |
| 61 |
################################################################# |
| 62 |
|
| 63 |
SET @@global.net_write_timeout = DEFAULT; |
| 64 |
SELECT @@global.net_write_timeout = 60; |
| 65 |
|
| 66 |
SET @@session.net_write_timeout = DEFAULT; |
| 67 |
SELECT @@session.net_write_timeout = 60; |
| 68 |
|
| 69 |
|
| 70 |
--echo '#--------------------FN_DYNVARS_112_03-------------------------#' |
| 71 |
########################################################################### |
| 72 |
# Change the value of net_write_timeout to a valid value for GLOBAL Scope # |
| 73 |
########################################################################### |
| 74 |
|
| 75 |
SET @@global.net_write_timeout = 1; |
| 76 |
SELECT @@global.net_write_timeout; |
| 77 |
SET @@global.net_write_timeout = 60020; |
| 78 |
SELECT @@global.net_write_timeout; |
| 79 |
SET @@global.net_write_timeout = 65535; |
| 80 |
SELECT @@global.net_write_timeout; |
| 81 |
|
| 82 |
|
| 83 |
--echo '#--------------------FN_DYNVARS_112_04-------------------------#' |
| 84 |
############################################################################ |
| 85 |
# Change the value of net_write_timeout to a valid value for SESSION Scope # |
| 86 |
############################################################################ |
| 87 |
|
| 88 |
SET @@session.net_write_timeout = 1; |
| 89 |
SELECT @@session.net_write_timeout; |
| 90 |
SET @@session.net_write_timeout = 50050; |
| 91 |
SELECT @@session.net_write_timeout; |
| 92 |
SET @@session.net_write_timeout = 65535; |
| 93 |
SELECT @@session.net_write_timeout; |
| 94 |
|
| 95 |
|
| 96 |
--echo '#------------------FN_DYNVARS_112_05-----------------------#' |
| 97 |
############################################################# |
| 98 |
# Change the value of net_write_timeout to an invalid value # |
| 99 |
############################################################# |
| 100 |
|
| 101 |
SET @@global.net_write_timeout = 0; |
| 102 |
SELECT @@global.net_write_timeout; |
| 103 |
SET @@global.net_write_timeout = -1024; |
| 104 |
SELECT @@global.net_write_timeout; |
| 105 |
SET @@global.net_write_timeout = 655360354; |
| 106 |
SELECT @@global.net_write_timeout; |
| 107 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 108 |
SET @@global.net_write_timeout = 65530.34; |
| 109 |
SELECT @@global.net_write_timeout; |
| 110 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 111 |
SET @@global.net_write_timeout = test; |
| 112 |
SELECT @@global.net_write_timeout; |
| 113 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 114 |
SET @@global.net_write_timeout = ' '; |
| 115 |
SELECT @@global.net_write_timeout; |
| 116 |
|
| 117 |
SET @@session.net_write_timeout = 0; |
| 118 |
SELECT @@session.net_write_timeout; |
| 119 |
SET @@session.net_write_timeout = -2; |
| 120 |
SELECT @@session.net_write_timeout; |
| 121 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 122 |
SET @@session.net_write_timeout = 65530.34; |
| 123 |
SET @@session.net_write_timeout = 6555015425; |
| 124 |
SELECT @@session.net_write_timeout; |
| 125 |
|
| 126 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 127 |
SET @@session.net_write_timeout = test; |
| 128 |
SELECT @@session.net_write_timeout; |
| 129 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 130 |
SET @@session.net_write_timeout = ' '; |
| 131 |
SELECT @@session.net_write_timeout; |
| 132 |
|
| 133 |
--echo '#------------------FN_DYNVARS_112_06-----------------------#' |
| 134 |
#################################################################### |
| 135 |
# Check if the value in GLOBAL Table matches value in variable # |
| 136 |
#################################################################### |
| 137 |
|
| 138 |
--disable_warnings |
| 139 |
SELECT @@global.net_write_timeout = VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME='net_write_timeout'; |
| 140 |
--enable_warnings |
| 141 |
|
| 142 |
--echo '#------------------FN_DYNVARS_112_07-----------------------#' |
| 143 |
#################################################################### |
| 144 |
# Check if the value in SESSION Table matches value in variable # |
| 145 |
#################################################################### |
| 146 |
|
| 147 |
--disable_warnings |
| 148 |
SELECT @@session.net_write_timeout = VARIABLE_VALUE FROM performance_schema.session_variables WHERE VARIABLE_NAME='net_write_timeout'; |
| 149 |
--enable_warnings |
| 150 |
|
| 151 |
|
| 152 |
--echo '#------------------FN_DYNVARS_112_08-----------------------#' |
| 153 |
#################################################################### |
| 154 |
# Check if TRUE and FALSE values can be used on variable # |
| 155 |
#################################################################### |
| 156 |
|
| 157 |
SET @@global.net_write_timeout = TRUE; |
| 158 |
SELECT @@global.net_write_timeout; |
| 159 |
SET @@global.net_write_timeout = FALSE; |
| 160 |
SELECT @@global.net_write_timeout; |
| 161 |
|
| 162 |
|
| 163 |
--echo '#---------------------FN_DYNVARS_112_09----------------------#' |
| 164 |
################################################################################# |
| 165 |
# Check if accessing variable with and without GLOBAL point to same variable # |
| 166 |
################################################################################# |
| 167 |
|
| 168 |
SET @@global.net_write_timeout = 10; |
| 169 |
SELECT @@net_write_timeout = @@global.net_write_timeout; |
| 170 |
|
| 171 |
|
| 172 |
--echo '#---------------------FN_DYNVARS_112_10----------------------#' |
| 173 |
######################################################################################################## |
| 174 |
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # |
| 175 |
######################################################################################################## |
| 176 |
|
| 177 |
SET @@net_write_timeout = 100; |
| 178 |
SELECT @@net_write_timeout = @@local.net_write_timeout; |
| 179 |
SELECT @@local.net_write_timeout = @@session.net_write_timeout; |
| 180 |
|
| 181 |
|
| 182 |
--echo '#---------------------FN_DYNVARS_112_11----------------------#' |
| 183 |
############################################################################ |
| 184 |
# Check if net_write_timeout can be accessed with and without @@ sign # |
| 185 |
############################################################################ |
| 186 |
|
| 187 |
SET net_write_timeout = 1; |
| 188 |
SELECT @@net_write_timeout; |
| 189 |
--Error ER_UNKNOWN_TABLE |
| 190 |
SELECT local.net_write_timeout; |
| 191 |
--Error ER_UNKNOWN_TABLE |
| 192 |
SELECT session.net_write_timeout; |
| 193 |
--Error ER_BAD_FIELD_ERROR |
| 194 |
SELECT net_write_timeout = @@session.net_write_timeout; |
| 195 |
|
| 196 |
|
| 197 |
#################################### |
| 198 |
# Restore initial value # |
| 199 |
#################################### |
| 200 |
|
| 201 |
SET @@global.net_write_timeout = @start_global_value; |
| 202 |
SELECT @@global.net_write_timeout; |
| 203 |
SET @@session.net_write_timeout = @start_session_value; |
| 204 |
SELECT @@session.net_write_timeout; |
| 205 |
|
| 206 |
|
| 207 |
###################################################### |
| 208 |
# END OF net_write_timeout TESTS # |
| 209 |
###################################################### |
| 210 |
|