Debian Codegraph @

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

raw
1 ################ mysql-test\t\secure_auth_basic.test ##########################
2 # #
3 # Variable Name: secure_auth #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: boolean #
7 # Default Value: FALSE #
8 # Valid Values: TRUE, FALSE #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Rizwan #
13 # #
14 # Description: Test Cases of Dynamic System Variable secure_auth #
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 ########################################################################
29 # START OF secure_auth TESTS #
30 ########################################################################
31
32
33 ###############################################################################
34 # Saving initial value of secure_auth in a temporary variable #
35 ###############################################################################
36
37 SET @global_start_value = @@global.secure_auth;
38 SELECT @global_start_value;
39
40 --echo '#--------------------FN_DYNVARS_143_01------------------------#'
41 ########################################################################
42 # Display the DEFAULT value of secure_auth #
43 ########################################################################
44
45 SET @@global.secure_auth = 1;
46 SET @@global.secure_auth = DEFAULT;
47 SELECT @@global.secure_auth;
48
49 --echo '#---------------------FN_DYNVARS_143_02-------------------------#'
50 #############################################################################
51 # Check if secure_auth can be accessed with and without @@ sign #
52 #############################################################################
53
54 --Error ER_GLOBAL_VARIABLE
55 SET secure_auth = 1;
56 SELECT @@secure_auth;
57 --Error ER_UNKNOWN_TABLE
58 SELECT global.secure_auth;
59
60 SET global secure_auth = 1;
61 SELECT @@global.secure_auth;
62
63
64 --echo '#--------------------FN_DYNVARS_143_03------------------------#'
65 ########################################################################
66 # Change the value of secure_auth to a valid value #
67 ########################################################################
68
69 SET @@global.secure_auth = 0;
70 SELECT @@global.secure_auth;
71 SET @@global.secure_auth = 1;
72 SELECT @@global.secure_auth;
73
74
75 --echo '#--------------------FN_DYNVARS_143_04-------------------------#'
76 ###########################################################################
77 # Change the value of secure_auth to invalid value #
78 ###########################################################################
79
80 --Error ER_WRONG_VALUE_FOR_VAR
81 SET @@global.secure_auth = -1;
82 --Error ER_WRONG_VALUE_FOR_VAR
83 SET @@global.secure_auth = 2;
84 --Error ER_WRONG_VALUE_FOR_VAR
85 SET @@global.secure_auth = "T";
86 --Error ER_WRONG_VALUE_FOR_VAR
87 SET @@global.secure_auth = "Y";
88 --Error ER_WRONG_VALUE_FOR_VAR
89 SET @@global.secure_auth = YES;
90 --Error ER_WRONG_VALUE_FOR_VAR
91 SET @@global.secure_auth = ONN;
92 --Error ER_WRONG_VALUE_FOR_VAR
93 SET @@global.secure_auth = OOF;
94 --Error ER_WRONG_VALUE_FOR_VAR
95 SET @@global.secure_auth = 0FF;
96 --Error ER_WRONG_VALUE_FOR_VAR
97 SET @@global.secure_auth = ' 1';
98 --Error ER_WRONG_VALUE_FOR_VAR
99 SET @@global.secure_auth = NO;
100
101
102 --echo '#-------------------FN_DYNVARS_143_05----------------------------#'
103 ###########################################################################
104 # Test if accessing session secure_auth gives error #
105 ###########################################################################
106
107 --Error ER_GLOBAL_VARIABLE
108 SET @@session.secure_auth = 0;
109 --Error ER_GLOBAL_VARIABLE
110 SET @@secure_auth = 0;
111 --Error ER_GLOBAL_VARIABLE
112 SET @@local.secure_auth = 0;
113 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
114 SELECT @@session.secure_auth;
115 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
116 SELECT @@local.secure_auth;
117
118 --echo '#----------------------FN_DYNVARS_143_06------------------------#'
119 #########################################################################
120 # Check if the value in SESSION Table contains variable value #
121 #########################################################################
122
123 SELECT count(VARIABLE_VALUE)
124 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
125 WHERE VARIABLE_NAME='secure_auth';
126
127
128 --echo '#----------------------FN_DYNVARS_143_07------------------------#'
129 ########################################################################
130 # Check if the value in GLOBAL Table matches value in variable #
131 ########################################################################
132
133 SELECT IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
134 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
135 WHERE VARIABLE_NAME='secure_auth';
136 SELECT @@global.secure_auth;
137 SELECT VARIABLE_VALUE
138 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
139 WHERE VARIABLE_NAME='secure_auth';
140
141 --echo '#---------------------FN_DYNVARS_143_08-------------------------#'
142 ###################################################################
143 # Check if ON and OFF values can be used on variable #
144 ###################################################################
145
146 SET @@global.secure_auth = OFF;
147 SELECT @@global.secure_auth;
148 SET @@global.secure_auth = ON;
149 SELECT @@global.secure_auth;
150
151 --echo '#---------------------FN_DYNVARS_143_09----------------------#'
152 ###################################################################
153 # Check if TRUE and FALSE values can be used on variable #
154 ###################################################################
155
156 SET @@global.secure_auth = TRUE;
157 SELECT @@global.secure_auth;
158 SET @@global.secure_auth = FALSE;
159 SELECT @@global.secure_auth;
160
161 ##############################
162 # Restore initial value #
163 ##############################
164
165 SET @@global.secure_auth = @global_start_value;
166 SELECT @@global.secure_auth;
167
168 ###############################################################
169 # END OF secure_auth TESTS #
170 ###############################################################