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/not_embedded.inc
27 --source include/load_sysvars.inc
28
29 ##################################################################
30 # START OF sync_binlog TESTS #
31 ##################################################################
32
33
34 ##################################################################
35 # Saving initial value of sync_binlog in a temporary variable #
36 ##################################################################
37
38 SET @start_value = @@global.sync_binlog;
39
40 --echo '#--------------------FN_DYNVARS_168_03------------------------#'
41 ###################################################################
42 # Change the value of sync_binlog to a valid value #
43 ###################################################################
44
45 SET @@global.sync_binlog = 0;
46 SELECT @@global.sync_binlog;
47 SET @@global.sync_binlog = 1;
48 SELECT @@global.sync_binlog;
49 SET @@global.sync_binlog = 4294967295;
50 SELECT @@global.sync_binlog;
51 SET @@global.sync_binlog = 4294967294;
52 SELECT @@global.sync_binlog;
53 SET @@global.sync_binlog = 65536;
54 SELECT @@global.sync_binlog;
55
56
57 --echo '#--------------------FN_DYNVARS_168_04-------------------------#'
58 ######################################################################
59 # Change the value of sync_binlog to invalid value #
60 ######################################################################
61
62 SET @@global.sync_binlog = -1;
63 SELECT @@global.sync_binlog;
64 SET @@global.sync_binlog = 4294967296;
65 SELECT @@global.sync_binlog;
66 SET @@global.sync_binlog = 10240022115;
67 SELECT @@global.sync_binlog;
68 --Error ER_WRONG_TYPE_FOR_VAR
69 SET @@global.sync_binlog = 10000.01;
70 SELECT @@global.sync_binlog;
71 SET @@global.sync_binlog = -1024;
72 SELECT @@global.sync_binlog;
73 SET @@global.sync_binlog = 42949672950;
74 SELECT @@global.sync_binlog;
75
76 --Error ER_WRONG_TYPE_FOR_VAR
77 SET @@global.sync_binlog = ON;
78 SELECT @@global.sync_binlog;
79 --Error ER_WRONG_TYPE_FOR_VAR
80 SET @@global.sync_binlog = 'test';
81 SELECT @@global.sync_binlog;
82
83
84 --echo '#-------------------FN_DYNVARS_168_05----------------------------#'
85 ###########################################################################
86 # Test if accessing session sync_binlog gives error #
87 ###########################################################################
88
89 --Error ER_GLOBAL_VARIABLE
90 SET @@session.sync_binlog = 0;
91 SELECT @@sync_binlog;
92
93
94 --echo '#----------------------FN_DYNVARS_168_06------------------------#'
95 ##############################################################################
96 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
97 ##############################################################################
98
99 SELECT @@global.sync_binlog = VARIABLE_VALUE
100 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
101 WHERE VARIABLE_NAME='sync_binlog';
102
103 --echo '#---------------------FN_DYNVARS_168_07----------------------#'
104 ##########################################################################
105 # Check if sync_binlog can be accessed with and without @@ sign #
106 ##########################################################################
107
108 --Error ER_GLOBAL_VARIABLE
109 SET sync_binlog = 1;
110 SELECT @@sync_binlog;
111 --Error ER_UNKNOWN_TABLE
112 SELECT local.sync_binlog;
113 --Error ER_UNKNOWN_TABLE
114 SELECT global.sync_binlog;
115 --Error ER_BAD_FIELD_ERROR
116 SELECT sync_binlog = @@session.sync_binlog;
117
118
119 ##############################
120 # Restore initial value #
121 ##############################
122
123 SET @@global.sync_binlog = @start_value;
124
125 ########################################################################
126 # END OF sync_binlog TESTS #
127 ########################################################################