3
################## mysql-test\t\binlog_format_basic.test ######################
5
# Variable Name: binlog_format #
6
# Scope: Global & Session #
7
# Access Type: Static #
8
# Data Type: enumeration #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable binlog_format #
16
# that checks the behavior of this variable in the following ways #
20
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21
# server-system-variables.html #
23
###############################################################################
25
###################################################################
26
# BUG#39812: Make statement replication default for 5.1 (to match 5.0)
27
# We just verify that the default binlog_format is STATEMENT in 5.1.
28
# In 6.0, it should be MIXED.
29
###################################################################
30
SELECT @@GLOBAL.binlog_format;
32
--echo '#---------------------BS_STVARS_002_01----------------------#'
33
####################################################################
34
# Displaying default value #
35
####################################################################
36
SELECT COUNT(@@GLOBAL.binlog_format);
39
SELECT COUNT(@@SESSION.binlog_format);
42
--echo '#---------------------BS_STVARS_002_02----------------------#'
43
####################################################################
44
# Check if Value can set #
45
####################################################################
47
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
48
SET @@GLOBAL.binlog_format=1;
49
--echo Expected error 'Read only variable'
50
--echo Bug: Writeable static variable
51
SELECT COUNT(@@GLOBAL.binlog_format);
56
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
57
SET @@SESSION.binlog_format=1;
58
--echo Expected error 'Read only variable'
59
--echo Bug: Writeable static variable
60
SELECT COUNT(@@SESSION.binlog_format);
65
--echo '#---------------------BS_STVARS_002_03----------------------#'
66
#################################################################
67
# Check if the value in GLOBAL Table matches value in variable #
68
#################################################################
70
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
71
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
72
WHERE VARIABLE_NAME='binlog_format';
75
SELECT COUNT(@@GLOBAL.binlog_format);
78
SELECT COUNT(VARIABLE_VALUE)
79
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
80
WHERE VARIABLE_NAME='binlog_format';
84
--echo '#---------------------BS_STVARS_002_04----------------------#'
85
#################################################################
86
# Check if the value in SESSION Table matches value in variable #
87
#################################################################
89
SELECT @@SESSION.binlog_format = VARIABLE_VALUE
90
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
91
WHERE VARIABLE_NAME='binlog_format';
94
SELECT COUNT(@@SESSION.binlog_format);
97
SELECT COUNT(VARIABLE_VALUE)
98
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
99
WHERE VARIABLE_NAME='binlog_format';
105
--echo '#---------------------BS_STVARS_002_05----------------------#'
106
################################################################################
107
# Check if binlog_format can be accessed with and without @@ sign #
108
################################################################################
110
SELECT COUNT(@@binlog_format);
112
SELECT COUNT(@@local.binlog_format);
114
SELECT COUNT(@@SESSION.binlog_format);
116
SELECT COUNT(@@GLOBAL.binlog_format);