Debian Codegraph @

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

raw
1 ############## mysql-test\t\sha256_password_proxy_users_basic.test ############
2 # #
3 # Variable Name: sha256_password_proxy_users #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 0 #
8 # Range: - #
9 # #
10 # #
11 # Creation Date: 2015-01-20 #
12 # Author: Todd Farmer #
13 # Description: Test Cases of Dynamic System Variable #
14 # sha256_password_proxy_usersthat checks the #
15 # 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 sha256_password_proxy_users TESTS #
30 ################################################################
31
32 ################################################################
33 # Saving initial value of sha256_password_proxy_users #
34 # in a temporary variable #
35 ################################################################
36
37 SET @start_value = @@global.sha256_password_proxy_users;
38 SELECT @start_value;
39
40 --echo '#----- 3.2.1 Default value -----------------------------------#'
41 ################################################################
42 # Display the DEFAULT value of #
43 # sha256_password_proxy_users #
44 ################################################################
45
46 SET @@global.sha256_password_proxy_users = 1;
47 SET @@global.sha256_password_proxy_users = DEFAULT;
48 SELECT @@global.sha256_password_proxy_users;
49
50 ###############################################
51 # Verify default value of variable #
52 ###############################################
53
54 SET @@global.sha256_password_proxy_users = @start_value;
55 SELECT @@global.sha256_password_proxy_users = 0;
56
57
58 --echo '#----- 3.2.1 Valid values ------------------------------------#'
59 #################################################################
60 # Change the value of #
61 # sha256_password_proxy_users to a valid value #
62 #################################################################
63
64 SET @@global.sha256_password_proxy_users = 0;
65 SELECT @@global.sha256_password_proxy_users;
66 SET @@global.sha256_password_proxy_users = 1;
67 SELECT @@global.sha256_password_proxy_users;
68 SET @@global.sha256_password_proxy_users = TRUE;
69 SELECT @@global.sha256_password_proxy_users;
70 SET @@global.sha256_password_proxy_users = FALSE;
71 SELECT @@global.sha256_password_proxy_users;
72 SET @@global.sha256_password_proxy_users = ON;
73 SELECT @@global.sha256_password_proxy_users;
74 SET @@global.sha256_password_proxy_users = OFF;
75 SELECT @@global.sha256_password_proxy_users;
76
77 --echo '#----- 3.2.1 Invalid values -----------------------------------#'
78 ####################################################################
79 # Change the value of #
80 # sha256_password_proxy_users to invalid value #
81 ####################################################################
82
83 --Error ER_WRONG_VALUE_FOR_VAR
84 SET @@global.sha256_password_proxy_users = -1;
85 SELECT @@global.sha256_password_proxy_users;
86 --Error ER_WRONG_VALUE_FOR_VAR
87 SET @@global.sha256_password_proxy_users = 4294967296;
88 SELECT @@global.sha256_password_proxy_users;
89 --Error ER_WRONG_VALUE_FOR_VAR
90 SET @@global.sha256_password_proxy_users = 10240022115;
91 SELECT @@global.sha256_password_proxy_users;
92 --Error ER_WRONG_TYPE_FOR_VAR
93 SET @@global.sha256_password_proxy_users = 10000.01;
94 SELECT @@global.sha256_password_proxy_users;
95 --Error ER_WRONG_VALUE_FOR_VAR
96 SET @@global.sha256_password_proxy_users = -1024;
97 SELECT @@global.sha256_password_proxy_users;
98 --Error ER_WRONG_VALUE_FOR_VAR
99 SET @@global.sha256_password_proxy_users = 42949672950;
100 SELECT @@global.sha256_password_proxy_users;
101
102 --Error ER_WRONG_VALUE_FOR_VAR
103 SET @@global.sha256_password_proxy_users = 'test';
104 SELECT @@global.sha256_password_proxy_users;
105
106 --echo '#----- 3.2.5 Session variable -----------------------------------#'
107 ####################################################################
108 # Test if accessing session #
109 # sha256_password_proxy_users gives error #
110 ####################################################################
111
112 --Error ER_GLOBAL_VARIABLE
113 SET @@session.sha256_password_proxy_users = 0;
114 SELECT @@sha256_password_proxy_users;
115
116 ##############################################################################
117 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
118 ##############################################################################
119
120 --disable_warnings
121 SELECT IF(@@global.sha256_password_proxy_users, "ON", "OFF") = VARIABLE_VALUE
122 FROM performance_schema.global_variables
123 WHERE VARIABLE_NAME='sha256_password_proxy_users';
124
125 SELECT IF(@@sha256_password_proxy_users, "ON", "OFF") = VARIABLE_VALUE
126 FROM performance_schema.session_variables
127 WHERE VARIABLE_NAME='sha256_password_proxy_users';
128 --enable_warnings
129
130 ####################################################################################################
131 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
132 ####################################################################################################
133
134 SET @@global.sha256_password_proxy_users = 1;
135 SELECT @@sha256_password_proxy_users = @@global.sha256_password_proxy_users;
136
137 --echo '#----- 3.2.6 Notation with/without @@ sign ------------------#'
138 ###################################################################
139 # Check if sha256_password_proxy_users can be #
140 # accessed with and without @@ sign #
141 ###################################################################
142
143 --Error ER_GLOBAL_VARIABLE
144 SET sha256_password_proxy_users = 1;
145 SELECT @@sha256_password_proxy_users;
146 --Error ER_PARSE_ERROR
147 SET local.sha256_password_proxy_users = 1;
148 --Error ER_UNKNOWN_TABLE
149 SELECT local.sha256_password_proxy_users;
150 --Error ER_PARSE_ERROR
151 SET global.sha256_password_proxy_users = 1;
152 --Error ER_UNKNOWN_TABLE
153 SELECT global.sha256_password_proxy_users;
154 --Error ER_BAD_FIELD_ERROR
155 SELECT sha256_password_proxy_users;
156 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
157 SELECT @@session.sha256_password_proxy_users;
158
159 ##############################
160 # Restore initial value #
161 ##############################
162
163 SET @@global.sha256_password_proxy_users = @start_value;
164 SELECT @@global.sha256_password_proxy_users;
165
166
167 ########################################################################
168 # END OF sha256_password_proxy_users TESTS #
169 ########################################################################