| 1 |
################# mysql-test\t\binlog_stmt_cache_size_basic.test ################# |
| 2 |
# # |
| 3 |
# Variable Name: binlog_stmt_cache_size # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: Numeric # |
| 7 |
# Default Value: 32768 # |
| 8 |
# Range: 4096 - 4294967295/18446744073709551615 # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2010-10-12 # |
| 12 |
# Author: Alfranio Correia # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable "binlog_stmt_cache_size" # |
| 15 |
# that checks behavior of this variable in the following ways # |
| 16 |
# * Default Value # |
| 17 |
# * Valid & Invalid values # |
| 18 |
# * Scope & Access method # |
| 19 |
# * Data Integrity . # |
| 20 |
# # |
| 21 |
# Modified: Pavan Naik, 2015-11-24 # |
| 22 |
# Added boundary value test cases according to the type of the # |
| 23 |
# server binary. # |
| 24 |
# # |
| 25 |
# Reference: http://dev.mysql.com/doc/refman/5.5/en/ # |
| 26 |
# server-system-variables.html#option_mysqld_binlog_stmt_cache_size # |
| 27 |
# # |
| 28 |
################################################################################## |
| 29 |
|
| 30 |
################################################################# |
| 31 |
# START OF binlog_stmt_cache_size TESTS # |
| 32 |
################################################################# |
| 33 |
|
| 34 |
######################################################################### |
| 35 |
# Saving initial value of binlog_stmt_cache_size in a temporary variable # |
| 36 |
######################################################################### |
| 37 |
|
| 38 |
SET @start_value = @@global.binlog_stmt_cache_size; |
| 39 |
SELECT @start_value; |
| 40 |
|
| 41 |
--echo '#--------------------FN_DYNVARS_006_01------------------------#' |
| 42 |
######################################################################### |
| 43 |
# Display the DEFAULT value of binlog_stmt_cache_size # |
| 44 |
######################################################################### |
| 45 |
|
| 46 |
SET @@global.binlog_stmt_cache_size = 100; |
| 47 |
SET @@global.binlog_stmt_cache_size = DEFAULT; |
| 48 |
SELECT @@global.binlog_stmt_cache_size; |
| 49 |
|
| 50 |
|
| 51 |
--echo '#---------------------FN_DYNVARS_006_02-------------------------#' |
| 52 |
############################################### |
| 53 |
# Verify default value of variable # |
| 54 |
############################################### |
| 55 |
|
| 56 |
SET @@global.binlog_stmt_cache_size = @start_value; |
| 57 |
SELECT @@global.binlog_stmt_cache_size = 32768; |
| 58 |
|
| 59 |
|
| 60 |
--echo '#--------------------FN_DYNVARS_006_03------------------------#' |
| 61 |
######################################################################### |
| 62 |
# Change the value of binlog_stmt_cache_size to a valid value # |
| 63 |
######################################################################### |
| 64 |
|
| 65 |
SET @@global.binlog_stmt_cache_size = 4096; |
| 66 |
SELECT @@global.binlog_stmt_cache_size; |
| 67 |
SET @@global.binlog_stmt_cache_size = 4294967295; |
| 68 |
SELECT @@global.binlog_stmt_cache_size; |
| 69 |
SET @@global.binlog_stmt_cache_size = 10000; |
| 70 |
SELECT @@global.binlog_stmt_cache_size; |
| 71 |
SET @@global.binlog_stmt_cache_size = 21221204; |
| 72 |
SELECT @@global.binlog_stmt_cache_size; |
| 73 |
echo 'Bug: Invalid values are coming in variable on assigning valid values'; |
| 74 |
|
| 75 |
# Test cases for 64-bit machines |
| 76 |
if($mach64) |
| 77 |
{ |
| 78 |
--disable_warnings |
| 79 |
SET @@global.binlog_stmt_cache_size = 18446744073709547520; |
| 80 |
--enable_warnings |
| 81 |
|
| 82 |
# Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO |
| 83 |
let $machine_name = `SELECT CONVERT(@@version_compile_os using latin1) IN ("Win64", "Windows")`; |
| 84 |
|
| 85 |
if($machine_name) |
| 86 |
{ |
| 87 |
--replace_result 4294963200 18446744073709547520 |
| 88 |
} |
| 89 |
SELECT @@global.binlog_stmt_cache_size; |
| 90 |
} |
| 91 |
|
| 92 |
--echo '#--------------------FN_DYNVARS_006_04-------------------------#' |
| 93 |
############################################################################ |
| 94 |
# Change the value of binlog_stmt_cache_size to invalid value # |
| 95 |
############################################################################ |
| 96 |
|
| 97 |
SET @@global.binlog_stmt_cache_size = 4095; |
| 98 |
SELECT @@global.binlog_stmt_cache_size; |
| 99 |
SET @@global.binlog_stmt_cache_size = 1024; |
| 100 |
SELECT @@global.binlog_stmt_cache_size; |
| 101 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 102 |
SET @@global.binlog_stmt_cache_size = 10000.01; |
| 103 |
SET @@global.binlog_stmt_cache_size = 0; |
| 104 |
SELECT @@global.binlog_stmt_cache_size; |
| 105 |
SET @@global.binlog_stmt_cache_size = -1024; |
| 106 |
SELECT @@global.binlog_stmt_cache_size; |
| 107 |
echo 'Bug: Errors are not coming on assigning invalid values to variable'; |
| 108 |
|
| 109 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 110 |
SET @@global.binlog_stmt_cache_size = ON; |
| 111 |
|
| 112 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 113 |
SET @@global.binlog_stmt_cache_size = 'test'; |
| 114 |
|
| 115 |
if($mach32) |
| 116 |
{ |
| 117 |
SET @@global.binlog_stmt_cache_size = 4294967296; |
| 118 |
SELECT @@global.binlog_stmt_cache_size; |
| 119 |
|
| 120 |
SET @@global.binlog_stmt_cache_size = 42949672950; |
| 121 |
SELECT @@global.binlog_stmt_cache_size; |
| 122 |
} |
| 123 |
|
| 124 |
if($mach64) |
| 125 |
{ |
| 126 |
SET @@global.binlog_stmt_cache_size = 18446744073709547521; |
| 127 |
|
| 128 |
# Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO |
| 129 |
if($machine_name) |
| 130 |
{ |
| 131 |
--replace_result 4294963200 18446744073709547520 |
| 132 |
} |
| 133 |
SELECT @@global.binlog_stmt_cache_size; |
| 134 |
} |
| 135 |
|
| 136 |
--echo '#-------------------FN_DYNVARS_006_05----------------------------#' |
| 137 |
############################################################################ |
| 138 |
# Test if accessing session binlog_stmt_cache_size gives error # |
| 139 |
############################################################################ |
| 140 |
|
| 141 |
--Error ER_GLOBAL_VARIABLE |
| 142 |
SET @@session.binlog_stmt_cache_size = 0; |
| 143 |
|
| 144 |
|
| 145 |
--echo '#----------------------FN_DYNVARS_006_06------------------------#' |
| 146 |
############################################################################## |
| 147 |
# Check if the value in GLOBAL Tables matches values in variable # |
| 148 |
############################################################################## |
| 149 |
|
| 150 |
SET @@global.binlog_stmt_cache_size = 4294967295; |
| 151 |
|
| 152 |
--disable_warnings |
| 153 |
SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM performance_schema.global_variables WHERE VARIABLE_NAME='binlog_stmt_cache_size'; |
| 154 |
--enable_warnings |
| 155 |
|
| 156 |
--echo '#---------------------FN_DYNVARS_006_07----------------------#' |
| 157 |
################################################################### |
| 158 |
# Check if TRUE and FALSE values can be used on variable # |
| 159 |
################################################################### |
| 160 |
|
| 161 |
SET @@global.binlog_stmt_cache_size = TRUE; |
| 162 |
SELECT @@global.binlog_stmt_cache_size; |
| 163 |
SET @@global.binlog_stmt_cache_size = FALSE; |
| 164 |
SELECT @@global.binlog_stmt_cache_size; |
| 165 |
echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; |
| 166 |
|
| 167 |
--echo '#---------------------FN_DYNVARS_006_08----------------------#' |
| 168 |
############################################################################### |
| 169 |
# Check if accessing variable without SCOPE points to same global variable # |
| 170 |
############################################################################### |
| 171 |
|
| 172 |
SET @@global.binlog_stmt_cache_size = 1; |
| 173 |
SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size; |
| 174 |
|
| 175 |
--echo '#---------------------FN_DYNVARS_006_09----------------------#' |
| 176 |
########################################################################### |
| 177 |
# Check if binlog_stmt_cache_size can be accessed with and without @@ sign# |
| 178 |
########################################################################### |
| 179 |
|
| 180 |
--Error ER_GLOBAL_VARIABLE |
| 181 |
SET binlog_stmt_cache_size = 1; |
| 182 |
--Error ER_PARSE_ERROR |
| 183 |
SET global.binlog_stmt_cache_size = 1; |
| 184 |
--Error ER_UNKNOWN_TABLE |
| 185 |
SELECT global.binlog_stmt_cache_size; |
| 186 |
--Error ER_BAD_FIELD_ERROR |
| 187 |
SELECT binlog_stmt_cache_size; |
| 188 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 189 |
SELECT @@session.binlog_stmt_cache_size; |
| 190 |
|
| 191 |
|
| 192 |
############################## |
| 193 |
# Restore initial value # |
| 194 |
############################## |
| 195 |
|
| 196 |
SET @@global.binlog_stmt_cache_size = @start_value; |
| 197 |
SELECT @@global.binlog_stmt_cache_size; |
| 198 |
|
| 199 |
|
| 200 |
########################################################### |
| 201 |
# END OF binlog_stmt_cache_size TESTS # |
| 202 |
########################################################### |