Debian Codegraph @

mysql-test/suite/sys_vars/t/sync_binlog_basic.test

raw
1 #################### mysql-test\t\sync_binlog_basic.test ######################
2 # #
3 # Variable Name: sync_binlog #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 0 #
8 # Range: 0 - 4294967295 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman Rawala #
13 # #
14 # Description: Test Cases of Dynamic System Variable sync_binlog #
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 # START OF sync_binlog TESTS #
30 ##################################################################
31
32
33 ##################################################################
34 # Saving initial value of sync_binlog in a temporary variable #
35 ##################################################################
36
37 SET @start_value = @@global.sync_binlog;
38 SELECT @start_value;
39
40
41 --echo '#--------------------FN_DYNVARS_168_01------------------------#'
42 ##################################################################
43 # Display the DEFAULT value of sync_binlog #
44 ##################################################################
45
46 SET @@global.sync_binlog = 99;
47 SET @@global.sync_binlog = DEFAULT;
48 SELECT @@global.sync_binlog;
49
50
51 --echo '#---------------------FN_DYNVARS_168_02-------------------------#'
52 ###############################################
53 # Verify default value of variable #
54 ###############################################
55
56 SET @@global.sync_binlog = @start_value;
57 SELECT @@global.sync_binlog = 1;
58
59
60 --echo '#--------------------FN_DYNVARS_168_03------------------------#'
61 ###################################################################
62 # Change the value of sync_binlog to a valid value #
63 ###################################################################
64
65 SET @@global.sync_binlog = 0;
66 SELECT @@global.sync_binlog;
67 SET @@global.sync_binlog = 1;
68 SELECT @@global.sync_binlog;
69 SET @@global.sync_binlog = 4294967295;
70 SELECT @@global.sync_binlog;
71 SET @@global.sync_binlog = 4294967294;
72 SELECT @@global.sync_binlog;
73 SET @@global.sync_binlog = 65536;
74 SELECT @@global.sync_binlog;
75
76
77 --echo '#--------------------FN_DYNVARS_168_04-------------------------#'
78 ######################################################################
79 # Change the value of sync_binlog to invalid value #
80 ######################################################################
81
82 SET @@global.sync_binlog = -1;
83 SELECT @@global.sync_binlog;
84 SET @@global.sync_binlog = 4294967296;
85 SELECT @@global.sync_binlog;
86 SET @@global.sync_binlog = 10240022115;
87 SELECT @@global.sync_binlog;
88 --Error ER_WRONG_TYPE_FOR_VAR
89 SET @@global.sync_binlog = 10000.01;
90 SELECT @@global.sync_binlog;
91 SET @@global.sync_binlog = -1024;
92 SELECT @@global.sync_binlog;
93 SET @@global.sync_binlog = 42949672950;
94 SELECT @@global.sync_binlog;
95
96 --Error ER_WRONG_TYPE_FOR_VAR
97 SET @@global.sync_binlog = ON;
98 SELECT @@global.sync_binlog;
99 --Error ER_WRONG_TYPE_FOR_VAR
100 SET @@global.sync_binlog = 'test';
101 SELECT @@global.sync_binlog;
102
103
104 --echo '#-------------------FN_DYNVARS_168_05----------------------------#'
105 ###########################################################################
106 # Test if accessing session sync_binlog gives error #
107 ###########################################################################
108
109 --Error ER_GLOBAL_VARIABLE
110 SET @@session.sync_binlog = 0;
111 SELECT @@sync_binlog;
112
113
114 --echo '#----------------------FN_DYNVARS_168_06------------------------#'
115 ##############################################################################
116 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
117 ##############################################################################
118
119 --disable_warnings
120 SELECT @@global.sync_binlog = VARIABLE_VALUE
121 FROM performance_schema.global_variables
122 WHERE VARIABLE_NAME='sync_binlog';
123 --enable_warnings
124
125 --echo '#---------------------FN_DYNVARS_168_07----------------------#'
126 ##########################################################################
127 # Check if sync_binlog can be accessed with and without @@ sign #
128 ##########################################################################
129
130 --Error ER_GLOBAL_VARIABLE
131 SET sync_binlog = 1;
132 SELECT @@sync_binlog;
133 --Error ER_PARSE_ERROR
134 SET local.sync_binlog = 1;
135 --Error ER_UNKNOWN_TABLE
136 SELECT local.sync_binlog;
137 --Error ER_PARSE_ERROR
138 SET global.sync_binlog = 1;
139 --Error ER_UNKNOWN_TABLE
140 SELECT global.sync_binlog;
141 --Error ER_BAD_FIELD_ERROR
142 SELECT sync_binlog;
143 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
144 SELECT @@session.sync_binlog;
145
146
147 ##############################
148 # Restore initial value #
149 ##############################
150
151 SET @@global.sync_binlog = @start_value;
152 SELECT @@global.sync_binlog;
153
154
155 ########################################################################
156 # END OF sync_binlog TESTS #
157 ########################################################################