1
################# mysql-test\t\binlog_cache_size_basic.test ####################
3
# Variable Name: binlog_cache_size #
5
# Access Type: Dynamic #
7
# Default Value: 32768 #
8
# Range: 4096 - 4294967295 #
11
# Creation Date: 2008-04-28 #
12
# Author: Salman Rawala/Horst Hunger #
14
# Description: Test Cases of Dynamic System Variable "binlog_cache_size" #
15
# that checks behavior of this variable in the following ways #
17
# * Valid & Invalid values #
18
# * Scope & Access method #
19
# * Data Integrity . #
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22
# server-system-variables.html#option_mysqld_binlog_cache_size #
24
################################################################################
26
#################################################################
27
# START OF binlog_cache_size TESTS #
28
#################################################################
30
#########################################################################
31
# Saving initial value of binlog_cache_size in a temporary variable #
32
#########################################################################
34
SET @start_value = @@global.binlog_cache_size;
37
--echo '#--------------------FN_DYNVARS_006_01------------------------#'
38
#########################################################################
39
# Display the DEFAULT value of binlog_cache_size #
40
#########################################################################
42
SET @@global.binlog_cache_size = 100;
43
SET @@global.binlog_cache_size = DEFAULT;
44
SELECT @@global.binlog_cache_size;
47
--echo '#---------------------FN_DYNVARS_006_02-------------------------#'
48
###############################################
49
# Verify default value of variable #
50
###############################################
52
SET @@global.binlog_cache_size = @start_value;
53
SELECT @@global.binlog_cache_size = 32768;
56
--echo '#--------------------FN_DYNVARS_006_03------------------------#'
57
#########################################################################
58
# Change the value of binlog_cache_size to a valid value #
59
#########################################################################
61
SET @@global.binlog_cache_size = 4096;
62
SELECT @@global.binlog_cache_size;
63
SET @@global.binlog_cache_size = 4294967295;
64
SELECT @@global.binlog_cache_size;
65
SET @@global.binlog_cache_size = 10000;
66
SELECT @@global.binlog_cache_size;
67
SET @@global.binlog_cache_size = 21221204;
68
SELECT @@global.binlog_cache_size;
69
echo 'Bug: Invalid values are coming in variable on assigning valid values';
72
--echo '#--------------------FN_DYNVARS_006_04-------------------------#'
73
############################################################################
74
# Change the value of binlog_cache_size to invalid value #
75
############################################################################
77
SET @@global.binlog_cache_size = 1024;
78
SELECT @@global.binlog_cache_size;
79
--Error ER_WRONG_TYPE_FOR_VAR
80
SET @@global.binlog_cache_size = 10000.01;
81
SET @@global.binlog_cache_size = -1024;
82
SELECT @@global.binlog_cache_size;
83
SET @@global.binlog_cache_size = 42949672950;
84
SELECT @@global.binlog_cache_size;
85
echo 'Bug: Errors are not coming on assigning invalid values to variable';
87
--Error ER_WRONG_TYPE_FOR_VAR
88
SET @@global.binlog_cache_size = ON;
90
--Error ER_WRONG_TYPE_FOR_VAR
91
SET @@global.binlog_cache_size = 'test';
94
--echo '#-------------------FN_DYNVARS_006_05----------------------------#'
95
############################################################################
96
# Test if accessing session binlog_cache_size gives error #
97
############################################################################
99
--Error ER_GLOBAL_VARIABLE
100
SET @@session.binlog_cache_size = 0;
103
--echo '#----------------------FN_DYNVARS_006_06------------------------#'
104
##############################################################################
105
# Check if the value in GLOBAL Tables matches values in variable #
106
##############################################################################
108
SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
110
--echo '#---------------------FN_DYNVARS_006_07----------------------#'
111
###################################################################
112
# Check if TRUE and FALSE values can be used on variable #
113
###################################################################
115
SET @@global.binlog_cache_size = TRUE;
116
SELECT @@global.binlog_cache_size;
117
SET @@global.binlog_cache_size = FALSE;
118
SELECT @@global.binlog_cache_size;
119
echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
121
--echo '#---------------------FN_DYNVARS_006_08----------------------#'
122
###############################################################################
123
# Check if accessing variable without SCOPE points to same global variable #
124
###############################################################################
126
SET @@global.binlog_cache_size = 1;
127
SELECT @@binlog_cache_size = @@global.binlog_cache_size;
129
--echo '#---------------------FN_DYNVARS_006_09----------------------#'
130
###########################################################################
131
# Check if binlog_cache_size can be accessed with and without @@ sign #
132
###########################################################################
134
--Error ER_GLOBAL_VARIABLE
135
SET binlog_cache_size = 1;
136
--Error ER_PARSE_ERROR
137
SET global.binlog_cache_size = 1;
138
--Error ER_UNKNOWN_TABLE
139
SELECT global.binlog_cache_size;
140
--Error ER_BAD_FIELD_ERROR
141
SELECT binlog_cache_size = @@session.binlog_cache_size;
144
##############################
145
# Restore initial value #
146
##############################
148
SET @@global.binlog_cache_size = @start_value;
149
SELECT @@global.binlog_cache_size;
152
###########################################################
153
# END OF binlog_cache_size TESTS #
154
###########################################################