Debian Codegraph @

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

raw
1 ################## mysql-test\t\binlog_format_basic.test ######################
2 # #
3 # Variable Name: binlog_format #
4 # Scope: Global & Session #
5 # Access Type: Static #
6 # Data Type: enumeration #
7 # #
8 # #
9 # Creation Date: 2008-02-07 #
10 # Author : Sharique Abdullah #
11 # #
12 # #
13 # Description:Test Cases of Dynamic System Variable binlog_format #
14 # that checks the behavior of this variable in the following ways #
15 # * Value Check #
16 # * Scope Check #
17 # #
18 # Reference: #
19 # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
20 # #
21 ###############################################################################
22
23 ###################################################################
24 # BUG#39812: Make statement replication default for 5.1 (to match 5.0)
25 # We just verify that the default binlog_format is STATEMENT in 5.1.
26 # In 6.0, it should be MIXED.
27 ###################################################################
28 SELECT @@GLOBAL.binlog_format;
29
30 --echo '#---------------------BS_STVARS_002_01----------------------#'
31 ####################################################################
32 # Displaying default value #
33 ####################################################################
34 SET @start_value= @@global.binlog_format;
35
36 SELECT COUNT(@@GLOBAL.binlog_format);
37 --echo 1 Expected
38
39 SELECT COUNT(@@SESSION.binlog_format);
40 --echo 1 Expected
41
42 --echo '#---------------------BS_STVARS_002_02----------------------#'
43 ####################################################################
44 # Check if Value can set #
45 ####################################################################
46 SET @@GLOBAL.binlog_format=1;
47 SELECT @@GLOBAL.binlog_format;
48
49 SET @@SESSION.binlog_format=1;
50 SELECT @@SESSION.binlog_format;
51
52 --echo '#---------------------BS_STVARS_002_03----------------------#'
53 #################################################################
54 # Check if the value in GLOBAL Table matches value in variable #
55 #################################################################
56
57 SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
58 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
59 WHERE VARIABLE_NAME='binlog_format';
60 --echo 1 Expected
61
62 SELECT COUNT(@@GLOBAL.binlog_format);
63 --echo 1 Expected
64
65 SELECT COUNT(VARIABLE_VALUE)
66 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
67 WHERE VARIABLE_NAME='binlog_format';
68 --echo 1 Expected
69
70
71 --echo '#---------------------BS_STVARS_002_04----------------------#'
72 #################################################################
73 # Check if the value in SESSION Table matches value in variable #
74 #################################################################
75
76 SELECT @@SESSION.binlog_format = VARIABLE_VALUE
77 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
78 WHERE VARIABLE_NAME='binlog_format';
79 --echo 1 Expected
80
81 SELECT COUNT(@@SESSION.binlog_format);
82 --echo 1 Expected
83
84 SELECT COUNT(VARIABLE_VALUE)
85 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
86 WHERE VARIABLE_NAME='binlog_format';
87 --echo 1 Expected
88
89
90 --echo '#---------------------BS_STVARS_002_05----------------------#'
91 ################################################################################
92 # Check if binlog_format can be accessed with and without @@ sign #
93 ################################################################################
94
95 SELECT COUNT(@@binlog_format);
96 --echo 1 Expected
97 SELECT COUNT(@@local.binlog_format);
98 --echo 1 Expected
99 SELECT COUNT(@@SESSION.binlog_format);
100 --echo 1 Expected
101 SELECT COUNT(@@GLOBAL.binlog_format);
102 --echo 1 Expected
103
104 SET @@global.binlog_format= @start_value;
105