Debian Codegraph @

mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_basic.test

raw
1 #############mysql-test\t\log_bin_trust_function_creators_basic.test ########
2 # #
3 # Variable Name: log_bin_trust_function_creators #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: boolean #
7 # Default Value: False #
8 # Range: #
9 # #
10 # #
11 # Creation Date: 2008-02-11 #
12 # Author: Salman #
13 # #
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 #
17 # * Default Value #
18 # * Valid & Invalid values #
19 # * Scope & Access method #
20 # * Data Integrity #
21 # #
22 # Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system #
23 # -variables.html#option_mysqld_log-bin-trust-function-ceators #
24 # #
25 ###############################################################################
26
27 --source include/load_sysvars.inc
28
29 ####################################################################
30 # START OF log_bin_trust_function_creators TESTS #
31 ####################################################################
32
33
34 #############################################################
35 # Save initial value #
36 #############################################################
37
38 SET @start_global_value = @@global.log_bin_trust_function_creators;
39 SELECT @start_global_value;
40
41 --echo '#--------------------FN_DYNVARS_063_01-------------------------#'
42 ########################################################################
43 # Display the DEFAULT value of log_bin_trust_function_creators #
44 ########################################################################
45
46 SET @@global.log_bin_trust_function_creators = TRUE;
47 SET @@global.log_bin_trust_function_creators = DEFAULT;
48 SELECT @@global.log_bin_trust_function_creators;
49
50 --echo '#--------------------FN_DYNVARS_063_02-------------------------#'
51 ###############################################################################
52 # Check the DEFAULT value of log_bin_trust_function_creators #
53 ###############################################################################
54
55 SET @@global.log_bin_trust_function_creators = DEFAULT;
56 SELECT @@global.log_bin_trust_function_creators = 'FALSE';
57
58
59 --echo '#--------------------FN_DYNVARS_063_03-------------------------#'
60 ##################################################################
61 # Change the value of variable to a valid value for GLOBAL Scope #
62 ##################################################################
63
64 SET @@global.log_bin_trust_function_creators = ON;
65 SELECT @@global.log_bin_trust_function_creators;
66 SET @@global.log_bin_trust_function_creators = OFF;
67 SELECT @@global.log_bin_trust_function_creators;
68 SET @@global.log_bin_trust_function_creators = 0;
69 SELECT @@global.log_bin_trust_function_creators;
70 SET @@global.log_bin_trust_function_creators = 1;
71 SELECT @@global.log_bin_trust_function_creators;
72 SET @@global.log_bin_trust_function_creators = TRUE;
73 SELECT @@global.log_bin_trust_function_creators;
74 SET @@global.log_bin_trust_function_creators = FALSE;
75 SELECT @@global.log_bin_trust_function_creators;
76
77
78 --echo '#-------------------FN_DYNVARS_063_04----------------------------#'
79 ###############################################################################
80 # Test if accessing session log_bin_trust_function_creators gives error #
81 ###############################################################################
82
83 --Error ER_GLOBAL_VARIABLE
84 SET @@session.log_bin_trust_function_creators = 0;
85 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
86 SELECT @@session.log_bin_trust_function_creators;
87
88 --echo '#------------------FN_DYNVARS_063_05-----------------------#'
89 ###########################################################################
90 # Change the value of log_bin_trust_function_creators to an invalid value #
91 ###########################################################################
92
93 --Error ER_WRONG_VALUE_FOR_VAR
94 SET @@global.log_bin_trust_function_creators = 'ONN';
95 --Error ER_WRONG_VALUE_FOR_VAR
96 SET @@global.log_bin_trust_function_creators = "OFFF";
97 --error ER_PARSE_ERROR
98 SET @@global.log_bin_trust_function_creators = OF;
99 --Error ER_WRONG_VALUE_FOR_VAR
100 SET @@global.log_bin_trust_function_creators = TTRUE;
101 --Error ER_WRONG_VALUE_FOR_VAR
102 SET @@global.log_bin_trust_function_creators = FELSE;
103 --Error ER_WRONG_VALUE_FOR_VAR
104 SET @@global.log_bin_trust_function_creators = -1024;
105 --Error ER_WRONG_VALUE_FOR_VAR
106 SET @@global.log_bin_trust_function_creators = 65536;
107 --Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.log_bin_trust_function_creators = 65530.34;
109 --Error ER_WRONG_VALUE_FOR_VAR
110 SET @@global.log_bin_trust_function_creators = test;
111
112 --echo '#------------------FN_DYNVARS_063_06-----------------------#'
113 ##############################################################################
114 # Check if the value in GLOBAL & SESSION Tables matches value in variable #
115 ###############################################################################
116
117
118 --disable_warnings
119 SELECT IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
120 FROM performance_schema.global_variables
121 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
122 --enable_warnings
123
124 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
125 SELECT IF(@@session.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
126 FROM performance_schema.session_variables
127 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
128
129 --echo '#---------------------FN_DYNVARS_063_07----------------------#'
130 ###############################################################################
131 # Check if accessing variable with and without GLOBAL point to same variable #
132 ###############################################################################
133
134
135 SET @@global.log_bin_trust_function_creators = TRUE;
136 SELECT @@log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
137
138
139 --echo '#---------------------FN_DYNVARS_063_08----------------------#'
140 ###################################################################
141 # Check if variable can be accessed with and without @@ sign #
142 ###################################################################
143
144 SET @@global.log_bin_trust_function_creators = TRUE;
145 SELECT @@log_bin_trust_function_creators;
146 --Error ER_UNKNOWN_TABLE
147 SELECT local.log_bin_trust_function_creators;
148 --Error ER_UNKNOWN_TABLE
149 SELECT session.log_bin_trust_function_creators;
150 --Error ER_BAD_FIELD_ERROR
151 SELECT log_bin_trust_function_creators;
152 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
153 SELECT @@session.log_bin_trust_function_creators;
154
155
156 ####################################
157 # Restore initial value #
158 ####################################
159
160 SET @@global.log_bin_trust_function_creators = @start_global_value;
161 SELECT @@global.log_bin_trust_function_creators;
162
163
164 #########################################################
165 # END OF log_bin_trust_function_creators TESTS #
166 #########################################################
167