| 1 |
############## mysql-test\t\flush_basic.test ################################## |
| 2 |
# # |
| 3 |
# Variable Name: flush # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: boolean # |
| 7 |
# Default Value: OFF # |
| 8 |
# Range: # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-09 # |
| 12 |
# Author: Salman # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable flush # |
| 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-options.html#option_mysqld_flush # |
| 23 |
# # |
| 24 |
############################################################################### |
| 25 |
|
| 26 |
--source include/load_sysvars.inc |
| 27 |
######################################################################## |
| 28 |
# START OF flush TESTS # |
| 29 |
######################################################################## |
| 30 |
|
| 31 |
|
| 32 |
############################################################# |
| 33 |
# Saving initial value of flush in a temporary variable # |
| 34 |
############################################################# |
| 35 |
|
| 36 |
SET @start_value = @@global.flush; |
| 37 |
SELECT @start_value; |
| 38 |
|
| 39 |
|
| 40 |
--echo '#--------------------FN_DYNVARS_030_01------------------------#' |
| 41 |
############################################################# |
| 42 |
# Display the DEFAULT value of flush # |
| 43 |
############################################################# |
| 44 |
|
| 45 |
SET @@global.flush = ON; |
| 46 |
SET @@global.flush = DEFAULT; |
| 47 |
SELECT @@global.flush; |
| 48 |
|
| 49 |
|
| 50 |
--echo '#---------------------FN_DYNVARS_030_02-------------------------#' |
| 51 |
############################################### |
| 52 |
# Verify default value of variable # |
| 53 |
############################################### |
| 54 |
|
| 55 |
SET @@global.flush = @start_value; |
| 56 |
SELECT @@global.flush; |
| 57 |
|
| 58 |
|
| 59 |
--echo '#--------------------FN_DYNVARS_030_03------------------------#' |
| 60 |
############################################################# |
| 61 |
# Change the value of flush to a valid value # |
| 62 |
############################################################# |
| 63 |
|
| 64 |
SET @@global.flush = ON; |
| 65 |
SELECT @@global.flush; |
| 66 |
SET @@global.flush = OFF; |
| 67 |
SELECT @@global.flush; |
| 68 |
SET @@global.flush = 0; |
| 69 |
SELECT @@global.flush; |
| 70 |
SET @@global.flush = 1; |
| 71 |
SELECT @@global.flush; |
| 72 |
|
| 73 |
|
| 74 |
--echo '#--------------------FN_DYNVARS_030_04-------------------------#' |
| 75 |
########################################################################### |
| 76 |
# Change the value of flush to invalid value # |
| 77 |
########################################################################### |
| 78 |
|
| 79 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 80 |
SET @@global.flush = 2; |
| 81 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 82 |
SET @@global.flush = -1; |
| 83 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 84 |
SET @@global.flush = TRUEF; |
| 85 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 86 |
SET @@global.flush = TRUE_F; |
| 87 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 88 |
SET @@global.flush = FALSE0; |
| 89 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 90 |
SET @@global.flush = OON; |
| 91 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 92 |
SET @@global.flush = ONN; |
| 93 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 94 |
SET @@global.flush = OOFF; |
| 95 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 96 |
SET @@global.flush = 0FF; |
| 97 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 98 |
SET @@global.flush = ' '; |
| 99 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 100 |
SET @@global.flush = " "; |
| 101 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 102 |
SET @@global.flush = ''; |
| 103 |
|
| 104 |
|
| 105 |
--echo '#-------------------FN_DYNVARS_030_05----------------------------#' |
| 106 |
########################################################################### |
| 107 |
# Test if accessing session flush gives error # |
| 108 |
########################################################################### |
| 109 |
|
| 110 |
--Error ER_GLOBAL_VARIABLE |
| 111 |
SET @@session.flush = 1; |
| 112 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 113 |
SELECT @@session.flush; |
| 114 |
|
| 115 |
|
| 116 |
--echo '#----------------------FN_DYNVARS_030_06------------------------#' |
| 117 |
#################################################################### |
| 118 |
# Check if the value in GLOBAL Tables matches values in variable # |
| 119 |
#################################################################### |
| 120 |
|
| 121 |
--disable_warnings |
| 122 |
SELECT IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE |
| 123 |
FROM performance_schema.global_variables |
| 124 |
WHERE VARIABLE_NAME='flush'; |
| 125 |
--enable_warnings |
| 126 |
|
| 127 |
|
| 128 |
--echo '#---------------------FN_DYNVARS_030_07----------------------#' |
| 129 |
################################################################### |
| 130 |
# Check if TRUE and FALSE values can be used on variable # |
| 131 |
################################################################### |
| 132 |
|
| 133 |
SET @@global.flush = TRUE; |
| 134 |
SELECT @@global.flush; |
| 135 |
SET @@global.flush = FALSE; |
| 136 |
SELECT @@global.flush; |
| 137 |
|
| 138 |
|
| 139 |
--echo '#---------------------FN_DYNVARS_030_08----------------------#' |
| 140 |
############################################################################### |
| 141 |
# Check if accessing variable without SCOPE points to same global variable # |
| 142 |
############################################################################### |
| 143 |
|
| 144 |
SET @@global.flush = 1; |
| 145 |
SELECT @@flush = @@global.flush; |
| 146 |
|
| 147 |
--echo '#---------------------FN_DYNVARS_030_09----------------------#' |
| 148 |
########################################################################## |
| 149 |
# Check if flush can be accessed with and without @@ sign # |
| 150 |
########################################################################## |
| 151 |
|
| 152 |
--Error ER_GLOBAL_VARIABLE |
| 153 |
SET flush = 1; |
| 154 |
--Error ER_PARSE_ERROR |
| 155 |
SET global.flush = 1; |
| 156 |
--Error ER_UNKNOWN_TABLE |
| 157 |
SELECT global.flush; |
| 158 |
--Error ER_BAD_FIELD_ERROR |
| 159 |
SELECT flush; |
| 160 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 161 |
SELECT @@session.flush; |
| 162 |
|
| 163 |
|
| 164 |
############################## |
| 165 |
# Restore initial value # |
| 166 |
############################## |
| 167 |
|
| 168 |
SET @@global.flush = @start_value; |
| 169 |
SELECT @@global.flush; |
| 170 |
|
| 171 |
|
| 172 |
############################################################# |
| 173 |
# END OF flush TESTS # |
| 174 |
############################################################# |