| 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 |
--replace_column 1 # |
| 29 |
SELECT @@GLOBAL.binlog_format; |
| 30 |
|
| 31 |
--echo '#---------------------BS_STVARS_002_01----------------------#' |
| 32 |
#################################################################### |
| 33 |
# Displaying default value # |
| 34 |
#################################################################### |
| 35 |
SET @start_value= @@global.binlog_format; |
| 36 |
|
| 37 |
SELECT COUNT(@@GLOBAL.binlog_format); |
| 38 |
--echo 1 Expected |
| 39 |
|
| 40 |
SELECT COUNT(@@SESSION.binlog_format); |
| 41 |
--echo 1 Expected |
| 42 |
|
| 43 |
--echo '#---------------------BS_STVARS_002_02----------------------#' |
| 44 |
#################################################################### |
| 45 |
# Check if Value can set # |
| 46 |
#################################################################### |
| 47 |
SET @@GLOBAL.binlog_format=1; |
| 48 |
SELECT @@GLOBAL.binlog_format; |
| 49 |
|
| 50 |
SET @@SESSION.binlog_format=1; |
| 51 |
SELECT @@SESSION.binlog_format; |
| 52 |
|
| 53 |
--echo '#---------------------BS_STVARS_002_03----------------------#' |
| 54 |
################################################################# |
| 55 |
# Check if the value in GLOBAL Table matches value in variable # |
| 56 |
################################################################# |
| 57 |
|
| 58 |
--disable_warnings |
| 59 |
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE |
| 60 |
FROM performance_schema.global_variables |
| 61 |
WHERE VARIABLE_NAME='binlog_format'; |
| 62 |
--enable_warnings |
| 63 |
--echo 1 Expected |
| 64 |
|
| 65 |
SELECT COUNT(@@GLOBAL.binlog_format); |
| 66 |
--echo 1 Expected |
| 67 |
|
| 68 |
--disable_warnings |
| 69 |
SELECT COUNT(VARIABLE_VALUE) |
| 70 |
FROM performance_schema.global_variables |
| 71 |
WHERE VARIABLE_NAME='binlog_format'; |
| 72 |
--enable_warnings |
| 73 |
--echo 1 Expected |
| 74 |
|
| 75 |
|
| 76 |
--echo '#---------------------BS_STVARS_002_04----------------------#' |
| 77 |
################################################################# |
| 78 |
# Check if the value in SESSION Table matches value in variable # |
| 79 |
################################################################# |
| 80 |
|
| 81 |
--disable_warnings |
| 82 |
SELECT @@SESSION.binlog_format = VARIABLE_VALUE |
| 83 |
FROM performance_schema.session_variables |
| 84 |
WHERE VARIABLE_NAME='binlog_format'; |
| 85 |
--enable_warnings |
| 86 |
--echo 1 Expected |
| 87 |
|
| 88 |
SELECT COUNT(@@SESSION.binlog_format); |
| 89 |
--echo 1 Expected |
| 90 |
|
| 91 |
--disable_warnings |
| 92 |
SELECT COUNT(VARIABLE_VALUE) |
| 93 |
FROM performance_schema.session_variables |
| 94 |
WHERE VARIABLE_NAME='binlog_format'; |
| 95 |
--enable_warnings |
| 96 |
--echo 1 Expected |
| 97 |
|
| 98 |
|
| 99 |
--echo '#---------------------BS_STVARS_002_05----------------------#' |
| 100 |
################################################################################ |
| 101 |
# Check if binlog_format can be accessed with and without @@ sign # |
| 102 |
################################################################################ |
| 103 |
|
| 104 |
SELECT COUNT(@@binlog_format); |
| 105 |
--echo 1 Expected |
| 106 |
SELECT COUNT(@@local.binlog_format); |
| 107 |
--echo 1 Expected |
| 108 |
SELECT COUNT(@@SESSION.binlog_format); |
| 109 |
--echo 1 Expected |
| 110 |
SELECT COUNT(@@GLOBAL.binlog_format); |
| 111 |
--echo 1 Expected |
| 112 |
|
| 113 |
--echo ######################################################################### |
| 114 |
--echo # Bug #26269280: SET SESSION BINLOG_FORMAT = ROW GIVES SYNTAX ERROR # |
| 115 |
--echo ######################################################################### |
| 116 |
|
| 117 |
SET binlog_format = ROW; |
| 118 |
SET SESSION binlog_format = ROW; |
| 119 |
SET @@session.binlog_format= ROW; |
| 120 |
|
| 121 |
--echo ######################################################################### |
| 122 |
|
| 123 |
SET @@global.binlog_format= @start_value; |