1
############## mysql-test\t\log_bin_trust_function_creators_basic.test ########
3
# Variable Name: log_bin_trust_function_creators #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
7
# Default Value: False #
11
# Creation Date: 2008-02-11 #
14
# Description: Test Cases of Dynamic System Variable #
15
# log_bin_trust_function_creators that checks the behavior of #
16
# this variable in the following ways #
18
# * Valid & Invalid values #
19
# * Scope & Access method #
22
# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system #
23
# -variables.html#option_mysqld_log-bin-trust-function-ceators #
25
###############################################################################
27
--source include/load_sysvars.inc
29
####################################################################
30
# START OF log_bin_trust_function_creators TESTS #
31
####################################################################
34
#############################################################
35
# Save initial value #
36
#############################################################
38
SET @start_global_value = @@global.log_bin_trust_function_creators;
39
SELECT @start_global_value;
40
--echo 'Bug# 34876: TRUE value is coming as Default'
41
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
42
SET @start_session_value = @@session.log_bin_trust_function_creators;
43
--echo 'Bug# 34881: According to documentation the scope of this variable is GLOBAL as well as SESSION too';
45
--echo '#--------------------FN_DYNVARS_063_01-------------------------#'
46
########################################################################
47
# Display the DEFAULT value of log_bin_trust_function_creators #
48
########################################################################
50
SET @@global.log_bin_trust_function_creators = TRUE;
51
SET @@global.log_bin_trust_function_creators = DEFAULT;
52
SELECT @@global.log_bin_trust_function_creators;
55
--echo '#--------------------FN_DYNVARS_063_02-------------------------#'
56
###############################################################################
57
# Check the DEFAULT value of log_bin_trust_function_creators #
58
###############################################################################
60
SET @@global.log_bin_trust_function_creators = DEFAULT;
61
SELECT @@global.log_bin_trust_function_creators = 'FALSE';
64
--echo '#--------------------FN_DYNVARS_063_03-------------------------#'
65
##################################################################
66
# Change the value of variable to a valid value for GLOBAL Scope #
67
##################################################################
69
SET @@global.log_bin_trust_function_creators = ON;
70
SELECT @@global.log_bin_trust_function_creators;
71
SET @@global.log_bin_trust_function_creators = OFF;
72
SELECT @@global.log_bin_trust_function_creators;
73
SET @@global.log_bin_trust_function_creators = 0;
74
SELECT @@global.log_bin_trust_function_creators;
75
SET @@global.log_bin_trust_function_creators = 1;
76
SELECT @@global.log_bin_trust_function_creators;
77
SET @@global.log_bin_trust_function_creators = TRUE;
78
SELECT @@global.log_bin_trust_function_creators;
79
SET @@global.log_bin_trust_function_creators = FALSE;
80
SELECT @@global.log_bin_trust_function_creators;
83
--echo '#-------------------FN_DYNVARS_063_04----------------------------#'
84
###############################################################################
85
# Test if accessing session log_bin_trust_function_creators gives error #
86
###############################################################################
88
--Error ER_GLOBAL_VARIABLE
89
SET @@session.log_bin_trust_function_creators = 0;
90
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
91
SELECT @@session.log_bin_trust_function_creators;
93
--echo '#------------------FN_DYNVARS_063_05-----------------------#'
94
###########################################################################
95
# Change the value of log_bin_trust_function_creators to an invalid value #
96
###########################################################################
98
--Error ER_WRONG_VALUE_FOR_VAR
99
SET @@global.log_bin_trust_function_creators = 'ONN';
100
--Error ER_WRONG_VALUE_FOR_VAR
101
SET @@global.log_bin_trust_function_creators = "OFFF";
102
SET @@global.log_bin_trust_function_creators = OF;
104
--echo 'Bug# 34828: OF is also working as OFF and no error is coming';
106
--Error ER_WRONG_VALUE_FOR_VAR
107
SET @@global.log_bin_trust_function_creators = TTRUE;
108
--Error ER_WRONG_VALUE_FOR_VAR
109
SET @@global.log_bin_trust_function_creators = FELSE;
110
--Error ER_WRONG_VALUE_FOR_VAR
111
SET @@global.log_bin_trust_function_creators = -1024;
112
--Error ER_WRONG_VALUE_FOR_VAR
113
SET @@global.log_bin_trust_function_creators = 65536;
114
--Error ER_WRONG_VALUE_FOR_VAR
115
SET @@global.log_bin_trust_function_creators = 65530.34;
116
--Error ER_WRONG_VALUE_FOR_VAR
117
SET @@global.log_bin_trust_function_creators = test;
119
--echo '#------------------FN_DYNVARS_063_06-----------------------#'
120
###############################################################################
121
# Check if the value in GLOBAL & SESSION Tables matches value in variable #
122
###############################################################################
125
SELECT @@global.log_bin_trust_function_creators = VARIABLE_VALUE
126
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
127
WHERE VARIABLE_NAME='log_bin_trust_function_creators';
129
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
130
SELECT @@session.log_bin_trust_function_creators = VARIABLE_VALUE
131
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
132
WHERE VARIABLE_NAME='log_bin_trust_function_creators';
134
--echo '#---------------------FN_DYNVARS_063_07----------------------#'
135
###############################################################################
136
# Check if accessing variable with and without GLOBAL point to same variable #
137
###############################################################################
140
SET @@global.log_bin_trust_function_creators = TRUE;
141
SELECT @@log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
144
--echo '#---------------------FN_DYNVARS_063_08----------------------#'
145
###################################################################
146
# Check if variable can be accessed with and without @@ sign #
147
###################################################################
149
SET @@global.log_bin_trust_function_creators = TRUE;
150
SELECT @@log_bin_trust_function_creators;
151
--Error ER_UNKNOWN_TABLE
152
SELECT local.log_bin_trust_function_creators;
153
--Error ER_UNKNOWN_TABLE
154
SELECT session.log_bin_trust_function_creators;
155
--Error ER_BAD_FIELD_ERROR
156
SELECT log_bin_trust_function_creators = @@session.log_bin_trust_function_creators;
159
####################################
160
# Restore initial value #
161
####################################
163
SET @@global.log_bin_trust_function_creators = @start_global_value;
164
SELECT @@global.log_bin_trust_function_creators;
167
#########################################################
168
# END OF log_bin_trust_function_creators TESTS #
169
#########################################################