| 1 |
############## mysql-test\t\sync_frm_basic.test ############################### |
| 2 |
# # |
| 3 |
# Variable Name: sync_frm # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: boolean # |
| 7 |
# Default Value: TRUE # |
| 8 |
# Range: # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-14 # |
| 12 |
# Author: Salman # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable sync_frm # |
| 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/load_sysvars.inc |
| 27 |
############################################################## |
| 28 |
# START OF sync_frm TESTS # |
| 29 |
############################################################## |
| 30 |
|
| 31 |
|
| 32 |
################################################################ |
| 33 |
# Saving initial value of sync_frm in a temporary variable # |
| 34 |
################################################################ |
| 35 |
|
| 36 |
SET @start_value = @@global.sync_frm; |
| 37 |
# In some cases the server may have been started with --disable-sync-frm |
| 38 |
--replace_column 1 VAL |
| 39 |
SELECT @start_value; |
| 40 |
|
| 41 |
|
| 42 |
--echo '#--------------------FN_DYNVARS_169_01------------------------#' |
| 43 |
###################################################### |
| 44 |
# Display the DEFAULT value of sync_frm # |
| 45 |
###################################################### |
| 46 |
|
| 47 |
SET @@global.sync_frm = FALSE; |
| 48 |
SET @@global.sync_frm = DEFAULT; |
| 49 |
SELECT @@global.sync_frm; |
| 50 |
|
| 51 |
|
| 52 |
--echo '#---------------------FN_DYNVARS_169_02-------------------------#' |
| 53 |
############################################### |
| 54 |
# Verify default value of variable # |
| 55 |
############################################### |
| 56 |
|
| 57 |
SET @@global.sync_frm = DEFAULT; |
| 58 |
SELECT @@global.sync_frm = TRUE; |
| 59 |
|
| 60 |
|
| 61 |
--echo '#--------------------FN_DYNVARS_169_03------------------------#' |
| 62 |
###################################################### |
| 63 |
# Change the value of sync_frm to a valid value # |
| 64 |
###################################################### |
| 65 |
|
| 66 |
SET @@global.sync_frm = ON; |
| 67 |
SELECT @@global.sync_frm; |
| 68 |
SET @@global.sync_frm = OFF; |
| 69 |
SELECT @@global.sync_frm; |
| 70 |
SET @@global.sync_frm = 0; |
| 71 |
SELECT @@global.sync_frm; |
| 72 |
SET @@global.sync_frm = 1; |
| 73 |
SELECT @@global.sync_frm; |
| 74 |
SET @@global.sync_frm = TRUE; |
| 75 |
SELECT @@global.sync_frm; |
| 76 |
SET @@global.sync_frm = FALSE; |
| 77 |
SELECT @@global.sync_frm; |
| 78 |
|
| 79 |
--echo '#--------------------FN_DYNVARS_169_04-------------------------#' |
| 80 |
#################################################################### |
| 81 |
# Change the value of sync_frm to invalid value # |
| 82 |
#################################################################### |
| 83 |
|
| 84 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 85 |
SET @@global.sync_frm = 2; |
| 86 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 87 |
SET @@global.sync_frm = -1; |
| 88 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 89 |
SET @@global.sync_frm = TRUEF; |
| 90 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 91 |
SET @@global.sync_frm = TRUE_F; |
| 92 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 93 |
SET @@global.sync_frm = FALSE0; |
| 94 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 95 |
SET @@global.sync_frm = OON; |
| 96 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 97 |
SET @@global.sync_frm = ONN; |
| 98 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 99 |
SET @@global.sync_frm = OOFF; |
| 100 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 101 |
SET @@global.sync_frm = 0FF; |
| 102 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 103 |
SET @@global.sync_frm = ' '; |
| 104 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 105 |
SET @@global.sync_frm = " "; |
| 106 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 107 |
SET @@global.sync_frm = ''; |
| 108 |
|
| 109 |
|
| 110 |
--echo '#-------------------FN_DYNVARS_169_05----------------------------#' |
| 111 |
#################################################################### |
| 112 |
# Test if accessing session sync_frm gives error # |
| 113 |
#################################################################### |
| 114 |
|
| 115 |
--Error ER_GLOBAL_VARIABLE |
| 116 |
SET @@session.sync_frm = 1; |
| 117 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 118 |
SELECT @@session.sync_frm; |
| 119 |
|
| 120 |
|
| 121 |
--echo '#----------------------FN_DYNVARS_169_06------------------------#' |
| 122 |
#################################################################### |
| 123 |
# Check if the value in GLOBAL Tables matches values in variable # |
| 124 |
#################################################################### |
| 125 |
|
| 126 |
SELECT IF(@@global.sync_frm, "ON", "OFF") = VARIABLE_VALUE |
| 127 |
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES |
| 128 |
WHERE VARIABLE_NAME='sync_frm'; |
| 129 |
|
| 130 |
--echo '#---------------------FN_DYNVARS_169_07----------------------#' |
| 131 |
############################################################################### |
| 132 |
# Check if accessing variable without SCOPE points to same session variable # |
| 133 |
############################################################################### |
| 134 |
|
| 135 |
SET @@global.sync_frm = 1; |
| 136 |
SELECT @@sync_frm = @@global.sync_frm; |
| 137 |
|
| 138 |
|
| 139 |
--echo '#---------------------FN_DYNVARS_169_08----------------------#' |
| 140 |
################################################################### |
| 141 |
# Check if sync_frm can be accessed with and without @@ sign # |
| 142 |
################################################################### |
| 143 |
|
| 144 |
--Error ER_GLOBAL_VARIABLE |
| 145 |
SET sync_frm = 1; |
| 146 |
SELECT @@sync_frm; |
| 147 |
--Error ER_UNKNOWN_TABLE |
| 148 |
SELECT global.sync_frm; |
| 149 |
--Error ER_BAD_FIELD_ERROR |
| 150 |
SELECT sync_frm = @@session.sync_frm; |
| 151 |
|
| 152 |
|
| 153 |
############################## |
| 154 |
# Restore initial value # |
| 155 |
############################## |
| 156 |
|
| 157 |
SET @@global.sync_frm = @start_value; |
| 158 |
--replace_column 1 VAL |
| 159 |
SELECT @@global.sync_frm; |
| 160 |
|
| 161 |
###################################################### |
| 162 |
# END OF sync_frm TESTS # |
| 163 |
###################################################### |