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
51 --echo '#--------------------FN_DYNVARS_063_02-------------------------#'
52 ###############################################################################
53 # Check the DEFAULT value of log_bin_trust_function_creators #
54 ###############################################################################
55
56 SET @@global.log_bin_trust_function_creators = DEFAULT;
57 SELECT @@global.log_bin_trust_function_creators = 'FALSE';
58
59
60 --echo '#--------------------FN_DYNVARS_063_03-------------------------#'
61 ##################################################################
62 # Change the value of variable to a valid value for GLOBAL Scope #
63 ##################################################################
64
65 SET @@global.log_bin_trust_function_creators = ON;
66 SELECT @@global.log_bin_trust_function_creators;
67 SET @@global.log_bin_trust_function_creators = OFF;
68 SELECT @@global.log_bin_trust_function_creators;
69 SET @@global.log_bin_trust_function_creators = 0;
70 SELECT @@global.log_bin_trust_function_creators;
71 SET @@global.log_bin_trust_function_creators = 1;
72 SELECT @@global.log_bin_trust_function_creators;
73 SET @@global.log_bin_trust_function_creators = TRUE;
74 SELECT @@global.log_bin_trust_function_creators;
75 SET @@global.log_bin_trust_function_creators = FALSE;
76 SELECT @@global.log_bin_trust_function_creators;
77
78
79 --echo '#-------------------FN_DYNVARS_063_04----------------------------#'
80 ###############################################################################
81 # Test if accessing session log_bin_trust_function_creators gives error #
82 ###############################################################################
83
84 --Error ER_GLOBAL_VARIABLE
85 SET @@session.log_bin_trust_function_creators = 0;
86 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
87 SELECT @@session.log_bin_trust_function_creators;
88
89 --echo '#------------------FN_DYNVARS_063_05-----------------------#'
90 ###########################################################################
91 # Change the value of log_bin_trust_function_creators to an invalid value #
92 ###########################################################################
93
94 --Error ER_WRONG_VALUE_FOR_VAR
95 SET @@global.log_bin_trust_function_creators = 'ONN';
96 --Error ER_WRONG_VALUE_FOR_VAR
97 SET @@global.log_bin_trust_function_creators = "OFFF";
98 --Error ER_WRONG_VALUE_FOR_VAR
99 SET @@global.log_bin_trust_function_creators = OF;
100 --Error ER_WRONG_VALUE_FOR_VAR
101 SET @@global.log_bin_trust_function_creators = TTRUE;
102 --Error ER_WRONG_VALUE_FOR_VAR
103 SET @@global.log_bin_trust_function_creators = FELSE;
104 --Error ER_WRONG_VALUE_FOR_VAR
105 SET @@global.log_bin_trust_function_creators = -1024;
106 --Error ER_WRONG_VALUE_FOR_VAR
107 SET @@global.log_bin_trust_function_creators = 65536;
108 --Error ER_WRONG_TYPE_FOR_VAR
109 SET @@global.log_bin_trust_function_creators = 65530.34;
110 --Error ER_WRONG_VALUE_FOR_VAR
111 SET @@global.log_bin_trust_function_creators = test;
112
113 --echo '#------------------FN_DYNVARS_063_06-----------------------#'
114 ###############################################################################
115 # Check if the value in GLOBAL & SESSION Tables matches value in variable #
116 ###############################################################################
117
118
119 SELECT IF(@@global.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
120 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
121 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
122
123 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
124 SELECT IF(@@session.log_bin_trust_function_creators, "ON", "OFF") = VARIABLE_VALUE
125 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
126 WHERE VARIABLE_NAME='log_bin_trust_function_creators';
127
128 --echo '#---------------------FN_DYNVARS_063_07----------------------#'
129 ###############################################################################
130 # Check if accessing variable with and without GLOBAL point to same variable #
131 ###############################################################################
132
133
134 SET @@global.log_bin_trust_function_creators = TRUE;
135 SELECT @@log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
136
137
138 --echo '#---------------------FN_DYNVARS_063_08----------------------#'
139 ###################################################################
140 # Check if variable can be accessed with and without @@ sign #
141 ###################################################################
142
143 SET @@global.log_bin_trust_function_creators = TRUE;
144 SELECT @@log_bin_trust_function_creators;
145 --Error ER_UNKNOWN_TABLE
146 SELECT local.log_bin_trust_function_creators;
147 --Error ER_UNKNOWN_TABLE
148 SELECT session.log_bin_trust_function_creators;
149 --Error ER_BAD_FIELD_ERROR
150 SELECT log_bin_trust_function_creators = @@session.log_bin_trust_function_creators;
151
152
153 ####################################
154 # Restore initial value #
155 ####################################
156
157 SET @@global.log_bin_trust_function_creators = @start_global_value;
158 SELECT @@global.log_bin_trust_function_creators;
159
160
161 #########################################################
162 # END OF log_bin_trust_function_creators TESTS #
163 #########################################################
164