| 1 |
################## mysql-test\t\binlog_error_action_basic.test ################ |
| 2 |
# # |
| 3 |
# Variable Name: binlog_error_action # |
| 4 |
# Scope: Global # |
| 5 |
# Data Type: enumeration # |
| 6 |
# # |
| 7 |
# # |
| 8 |
# Creation Date: 2014-09-11 # |
| 9 |
# Author : Sujatha Sivakumar # |
| 10 |
# # |
| 11 |
# # |
| 12 |
# Description:Test Cases of Dynamic System Variable binlog_error_action # |
| 13 |
# that checks the behavior of this variable in the following ways # |
| 14 |
# * Value Check # |
| 15 |
# * Scope Check # |
| 16 |
############################################################################### |
| 17 |
|
| 18 |
|
| 19 |
SELECT @@GLOBAL.binlog_error_action; |
| 20 |
--echo ABORT_SERVER Expected |
| 21 |
|
| 22 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 23 |
SELECT @@SESSION.binlog_error_action; |
| 24 |
|
| 25 |
SET @start_value= @@global.binlog_error_action; |
| 26 |
#################################################################### |
| 27 |
# Displaying default value # |
| 28 |
#################################################################### |
| 29 |
SHOW GLOBAL VARIABLES LIKE 'binlog_error_action'; |
| 30 |
|
| 31 |
#################################################################### |
| 32 |
# Check if Value can set # |
| 33 |
#################################################################### |
| 34 |
SET @@GLOBAL.binlog_error_action=IGNORE_ERROR; |
| 35 |
SELECT @@GLOBAL.binlog_error_action; |
| 36 |
--echo IGNORE_ERROR Expected |
| 37 |
|
| 38 |
SET @@GLOBAL.binlog_error_action=ABORT_SERVER; |
| 39 |
SELECT @@GLOBAL.binlog_error_action; |
| 40 |
--echo ABORT_SERVER Expected |
| 41 |
|
| 42 |
################################################################# |
| 43 |
# Check if the value in GLOBAL Table matches value in variable # |
| 44 |
################################################################# |
| 45 |
|
| 46 |
--disable_warnings |
| 47 |
SELECT @@GLOBAL.binlog_error_action = VARIABLE_VALUE |
| 48 |
FROM performance_schema.global_variables |
| 49 |
WHERE VARIABLE_NAME='binlog_error_action'; |
| 50 |
--echo 1 Expected |
| 51 |
|
| 52 |
SELECT COUNT(@@GLOBAL.binlog_error_action); |
| 53 |
--echo 1 Expected |
| 54 |
|
| 55 |
SELECT COUNT(VARIABLE_VALUE) |
| 56 |
FROM performance_schema.global_variables |
| 57 |
WHERE VARIABLE_NAME='binlog_error_action'; |
| 58 |
--echo 1 Expected |
| 59 |
--enable_warnings |
| 60 |
|
| 61 |
################################################################################ |
| 62 |
# Check if binlog_error_action can be accessed with @@ sign # |
| 63 |
################################################################################ |
| 64 |
|
| 65 |
SELECT COUNT(@@binlog_error_action); |
| 66 |
--echo 1 Expected |
| 67 |
SELECT COUNT(@@GLOBAL.binlog_error_action); |
| 68 |
--echo 1 Expected |
| 69 |
|
| 70 |
SET @@global.binlog_error_action= @start_value; |