Commit | Line | Data |
---|---|---|
52c8d07a LLB |
1 | From 7580701e6279900fec40822952a3b874732289cf Mon Sep 17 00:00:00 2001 |
2 | From: Sergei Golubchik <serg@mariadb.org> | |
3 | Date: Thu, 18 Feb 2021 14:20:48 +0100 | |
4 | Subject: [PATCH] make @@wsrep_provider and @@wsrep_notify_cmd read-only | |
5 | ||
6 | this should simplify run-time cluster management | |
7 | --- | |
8 | mysql-test/suite/galera/disabled.def | 2 + | |
9 | .../galera/include/galera_load_provider.inc | 19 -------- | |
10 | .../galera/include/galera_unload_provider.inc | 3 +- | |
11 | .../suite/galera/r/galera_ist_rsync.result | 2 +- | |
12 | .../galera/r/galera_sst_mysqldump.result | 2 +- | |
13 | .../suite/galera/r/mysql-wsrep#33.result | 2 +- | |
14 | .../suite/sys_vars/r/sysvars_wsrep.result | 4 +- | |
15 | .../sys_vars/r/wsrep_notify_cmd_basic.result | 47 ------------------- | |
16 | .../sys_vars/r/wsrep_provider_basic.result | 40 ---------------- | |
17 | .../r/wsrep_provider_options_basic.result | 46 ------------------ | |
18 | .../sys_vars/t/wsrep_notify_cmd_basic.test | 43 ----------------- | |
19 | .../sys_vars/t/wsrep_provider_basic.test | 39 --------------- | |
20 | .../t/wsrep_provider_options_basic.test | 41 ---------------- | |
21 | mysql-test/suite/wsrep/disabled.def | 2 + | |
22 | mysql-test/suite/wsrep/r/variables.result | 12 ++--- | |
23 | mysql-test/suite/wsrep/t/variables.test | 32 +++---------- | |
24 | sql/sys_vars.cc | 8 ++-- | |
25 | 17 files changed, 25 insertions(+), 319 deletions(-) | |
26 | delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result | |
27 | delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_provider_basic.result | |
28 | delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result | |
29 | delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test | |
30 | delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_provider_basic.test | |
31 | delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test | |
32 | ||
33 | diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def | |
34 | index d940c702d54..83f26e81636 100644 | |
35 | --- a/mysql-test/suite/galera/disabled.def | |
36 | +++ b/mysql-test/suite/galera/disabled.def | |
37 | @@ -49,3 +49,5 @@ partition : MDEV-19958 Galera test failure on galera.partition | |
38 | query_cache: MDEV-15805 Test failure on galera.query_cache | |
39 | sql_log_bin : MDEV-21491 galera.sql_log_bin | |
40 | versioning_trx_id : MDEV-18590 galera.versioning_trx_id | |
41 | +galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons | |
42 | +pxc-421: wsrep_provider is read-only for security reasons | |
43 | diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc | |
44 | index 0f843597d9c..28010cc5b71 100644 | |
45 | --- a/mysql-test/suite/galera/include/galera_load_provider.inc | |
46 | +++ b/mysql-test/suite/galera/include/galera_load_provider.inc | |
47 | @@ -1,25 +1,6 @@ | |
48 | --echo Loading wsrep provider ... | |
49 | ||
50 | --disable_query_log | |
51 | ---eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; | |
52 | - | |
53 | -# | |
54 | -# count occurences of successful node starts in error log | |
55 | -# | |
56 | -perl; | |
57 | - use strict; | |
58 | - my $test_log=$ENV{'LOG_FILE'} or die "LOG_FILE not set"; | |
59 | - my $test_log_copy=$test_log . '.copy'; | |
60 | - if (-e $test_log_copy) { | |
61 | - unlink $test_log_copy; | |
62 | - } | |
63 | - | |
64 | -EOF | |
65 | ---copy_file $LOG_FILE $LOG_FILE.copy | |
66 | - | |
67 | -# | |
68 | -# now join to the cluster | |
69 | -# | |
70 | --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; | |
71 | ||
72 | --enable_query_log | |
73 | diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_unload_provider.inc | |
74 | index cd841f51fbc..ed7e9bc41f0 100644 | |
75 | --- a/mysql-test/suite/galera/include/galera_unload_provider.inc | |
76 | +++ b/mysql-test/suite/galera/include/galera_unload_provider.inc | |
77 | @@ -1,7 +1,6 @@ | |
78 | --echo Unloading wsrep provider ... | |
79 | ||
80 | --let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` | |
81 | ---let $wsrep_provider_orig = `SELECT @@wsrep_provider` | |
82 | --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` | |
83 | --let $wsrep_error_log_orig = `SELECT @@log_error` | |
84 | if(!$wsrep_log_error_orig) | |
85 | @@ -12,4 +11,4 @@ if(!$wsrep_log_error_orig) | |
86 | } | |
87 | --let LOG_FILE= $wsrep_log_error_orig | |
88 | ||
89 | -SET GLOBAL wsrep_provider = 'none'; | |
90 | +SET GLOBAL wsrep_cluster_address = ''; | |
91 | diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result | |
92 | index 13f7d898a59..70a87c73df7 100644 | |
93 | --- a/mysql-test/suite/galera/r/galera_ist_rsync.result | |
94 | +++ b/mysql-test/suite/galera/r/galera_ist_rsync.result | |
95 | @@ -23,7 +23,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); | |
96 | INSERT INTO t1 VALUES ('node2_committed_before'); | |
97 | COMMIT; | |
98 | Unloading wsrep provider ... | |
99 | -SET GLOBAL wsrep_provider = 'none'; | |
100 | +SET GLOBAL wsrep_cluster_address = ''; | |
101 | connection node_1; | |
102 | SET AUTOCOMMIT=OFF; | |
103 | START TRANSACTION; | |
104 | diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result | |
105 | index 4ed679ba477..145b3a94775 100644 | |
106 | --- a/mysql-test/suite/galera/r/galera_sst_mysqldump.result | |
107 | +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result | |
108 | @@ -30,7 +30,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); | |
109 | INSERT INTO t1 VALUES ('node2_committed_before'); | |
110 | COMMIT; | |
111 | Unloading wsrep provider ... | |
112 | -SET GLOBAL wsrep_provider = 'none'; | |
113 | +SET GLOBAL wsrep_cluster_address = ''; | |
114 | connection node_1; | |
115 | SET AUTOCOMMIT=OFF; | |
116 | START TRANSACTION; | |
117 | diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result | |
118 | index fb0b593cc96..45c6a3f660a 100644 | |
119 | --- a/mysql-test/suite/galera/r/mysql-wsrep#33.result | |
120 | +++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result | |
121 | @@ -32,7 +32,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); | |
122 | INSERT INTO t1 VALUES ('node2_committed_before'); | |
123 | COMMIT; | |
124 | Unloading wsrep provider ... | |
125 | -SET GLOBAL wsrep_provider = 'none'; | |
126 | +SET GLOBAL wsrep_cluster_address = ''; | |
127 | connection node_1; | |
128 | SET AUTOCOMMIT=OFF; | |
129 | START TRANSACTION; | |
130 | diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result | |
131 | index 4b6abf85434..f73bfbd13e7 100644 | |
132 | --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result | |
133 | +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result | |
134 | @@ -403,7 +403,7 @@ NUMERIC_MIN_VALUE NULL | |
135 | NUMERIC_MAX_VALUE NULL | |
136 | NUMERIC_BLOCK_SIZE NULL | |
137 | ENUM_VALUE_LIST NULL | |
138 | -READ_ONLY NO | |
139 | +READ_ONLY YES | |
140 | COMMAND_LINE_ARGUMENT REQUIRED | |
141 | GLOBAL_VALUE_PATH NULL | |
142 | VARIABLE_NAME WSREP_ON | |
143 | @@ -463,7 +463,7 @@ NUMERIC_MIN_VALUE NULL | |
144 | NUMERIC_MAX_VALUE NULL | |
145 | NUMERIC_BLOCK_SIZE NULL | |
146 | ENUM_VALUE_LIST NULL | |
147 | -READ_ONLY NO | |
148 | +READ_ONLY YES | |
149 | COMMAND_LINE_ARGUMENT REQUIRED | |
150 | GLOBAL_VALUE_PATH NULL | |
151 | VARIABLE_NAME WSREP_PROVIDER_OPTIONS | |
152 | diff --git a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result | |
153 | deleted file mode 100644 | |
154 | index 056ff8c817b..00000000000 | |
155 | --- a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result | |
156 | +++ /dev/null | |
157 | @@ -1,47 +0,0 @@ | |
158 | -# | |
159 | -# wsrep_notify_cmd | |
160 | -# | |
161 | -call mtr.add_suppression("WSREP: Failed to get provider options"); | |
162 | -# save the initial value | |
163 | -SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd; | |
164 | -# default | |
165 | -SELECT @@global.wsrep_notify_cmd; | |
166 | -@@global.wsrep_notify_cmd | |
167 | - | |
168 | - | |
169 | -# scope | |
170 | -SELECT @@session.wsrep_notify_cmd; | |
171 | -ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable | |
172 | -SET @@global.wsrep_notify_cmd='notify_cmd'; | |
173 | -SELECT @@global.wsrep_notify_cmd; | |
174 | -@@global.wsrep_notify_cmd | |
175 | -notify_cmd | |
176 | - | |
177 | -# valid values | |
178 | -SET @@global.wsrep_notify_cmd='command'; | |
179 | -SELECT @@global.wsrep_notify_cmd; | |
180 | -@@global.wsrep_notify_cmd | |
181 | -command | |
182 | -SET @@global.wsrep_notify_cmd='hyphenated-command'; | |
183 | -SELECT @@global.wsrep_notify_cmd; | |
184 | -@@global.wsrep_notify_cmd | |
185 | -hyphenated-command | |
186 | -SET @@global.wsrep_notify_cmd=default; | |
187 | -SELECT @@global.wsrep_notify_cmd; | |
188 | -@@global.wsrep_notify_cmd | |
189 | - | |
190 | -SET @@global.wsrep_notify_cmd=NULL; | |
191 | -SELECT @@global.wsrep_notify_cmd; | |
192 | -@@global.wsrep_notify_cmd | |
193 | -NULL | |
194 | - | |
195 | -# invalid values | |
196 | -SET @@global.wsrep_notify_cmd=1; | |
197 | -ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd' | |
198 | -SELECT @@global.wsrep_notify_cmd; | |
199 | -@@global.wsrep_notify_cmd | |
200 | -NULL | |
201 | - | |
202 | -# restore the initial value | |
203 | -SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved; | |
204 | -# End of test | |
205 | diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result | |
206 | deleted file mode 100644 | |
207 | index 3e4ac8ca883..00000000000 | |
208 | --- a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result | |
209 | +++ /dev/null | |
210 | @@ -1,40 +0,0 @@ | |
211 | -# | |
212 | -# wsrep_provider | |
213 | -# | |
214 | -# save the initial value | |
215 | -SET @wsrep_provider_global_saved = @@global.wsrep_provider; | |
216 | -# default | |
217 | -SELECT @@global.wsrep_provider; | |
218 | -@@global.wsrep_provider | |
219 | -none | |
220 | - | |
221 | -# scope | |
222 | -SELECT @@session.wsrep_provider; | |
223 | -ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable | |
224 | -SELECT @@global.wsrep_provider; | |
225 | -@@global.wsrep_provider | |
226 | -none | |
227 | - | |
228 | -# valid values | |
229 | -SET @@global.wsrep_provider=default; | |
230 | -SELECT @@global.wsrep_provider; | |
231 | -@@global.wsrep_provider | |
232 | -none | |
233 | - | |
234 | -# invalid values | |
235 | -SET @@global.wsrep_provider='/invalid/libgalera_smm.so'; | |
236 | -ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so' | |
237 | -SET @@global.wsrep_provider=NULL; | |
238 | -ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL' | |
239 | -SELECT @@global.wsrep_provider; | |
240 | -@@global.wsrep_provider | |
241 | -none | |
242 | -SET @@global.wsrep_provider=1; | |
243 | -ERROR 42000: Incorrect argument type to variable 'wsrep_provider' | |
244 | -SELECT @@global.wsrep_provider; | |
245 | -@@global.wsrep_provider | |
246 | -none | |
247 | - | |
248 | -# restore the initial value | |
249 | -SET @@global.wsrep_provider = @wsrep_provider_global_saved; | |
250 | -# End of test | |
251 | diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result | |
252 | deleted file mode 100644 | |
253 | index 15949a14e39..00000000000 | |
254 | --- a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result | |
255 | +++ /dev/null | |
256 | @@ -1,46 +0,0 @@ | |
257 | -# | |
258 | -# wsrep_provider_options | |
259 | -# | |
260 | -call mtr.add_suppression("WSREP: Failed to get provider options"); | |
261 | -# default | |
262 | -SELECT @@global.wsrep_provider_options; | |
263 | -@@global.wsrep_provider_options | |
264 | - | |
265 | - | |
266 | -# scope | |
267 | -SELECT @@session.wsrep_provider_options; | |
268 | -ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable | |
269 | -SET @@global.wsrep_provider_options='option1'; | |
270 | -SELECT @@global.wsrep_provider_options; | |
271 | -@@global.wsrep_provider_options | |
272 | - | |
273 | - | |
274 | -# valid values | |
275 | -SET @@global.wsrep_provider_options='name1=value1;name2=value2'; | |
276 | -ERROR HY000: WSREP (galera) not started | |
277 | -SELECT @@global.wsrep_provider_options; | |
278 | -@@global.wsrep_provider_options | |
279 | - | |
280 | -SET @@global.wsrep_provider_options='hyphenated-name:value'; | |
281 | -ERROR HY000: WSREP (galera) not started | |
282 | -SELECT @@global.wsrep_provider_options; | |
283 | -@@global.wsrep_provider_options | |
284 | - | |
285 | -SET @@global.wsrep_provider_options=default; | |
286 | -ERROR HY000: WSREP (galera) not started | |
287 | -SELECT @@global.wsrep_provider_options; | |
288 | -@@global.wsrep_provider_options | |
289 | - | |
290 | - | |
291 | -# invalid values | |
292 | -SET @@global.wsrep_provider_options=1; | |
293 | -ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options' | |
294 | -SELECT @@global.wsrep_provider_options; | |
295 | -@@global.wsrep_provider_options | |
296 | - | |
297 | -SET @@global.wsrep_provider_options=NULL; | |
298 | -Got one of the listed errors | |
299 | -SELECT @@global.wsrep_provider_options; | |
300 | -@@global.wsrep_provider_options | |
301 | - | |
302 | -# End of test | |
303 | diff --git a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test | |
304 | deleted file mode 100644 | |
305 | index 6d1535ba148..00000000000 | |
306 | --- a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test | |
307 | +++ /dev/null | |
308 | @@ -1,43 +0,0 @@ | |
309 | ---source include/have_wsrep.inc | |
310 | - | |
311 | ---echo # | |
312 | ---echo # wsrep_notify_cmd | |
313 | ---echo # | |
314 | - | |
315 | -call mtr.add_suppression("WSREP: Failed to get provider options"); | |
316 | - | |
317 | ---echo # save the initial value | |
318 | -SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd; | |
319 | - | |
320 | ---echo # default | |
321 | -SELECT @@global.wsrep_notify_cmd; | |
322 | - | |
323 | ---echo | |
324 | ---echo # scope | |
325 | ---error ER_INCORRECT_GLOBAL_LOCAL_VAR | |
326 | -SELECT @@session.wsrep_notify_cmd; | |
327 | -SET @@global.wsrep_notify_cmd='notify_cmd'; | |
328 | -SELECT @@global.wsrep_notify_cmd; | |
329 | - | |
330 | ---echo | |
331 | ---echo # valid values | |
332 | -SET @@global.wsrep_notify_cmd='command'; | |
333 | -SELECT @@global.wsrep_notify_cmd; | |
334 | -SET @@global.wsrep_notify_cmd='hyphenated-command'; | |
335 | -SELECT @@global.wsrep_notify_cmd; | |
336 | -SET @@global.wsrep_notify_cmd=default; | |
337 | -SELECT @@global.wsrep_notify_cmd; | |
338 | -SET @@global.wsrep_notify_cmd=NULL; | |
339 | -SELECT @@global.wsrep_notify_cmd; | |
340 | - | |
341 | ---echo | |
342 | ---echo # invalid values | |
343 | ---error ER_WRONG_TYPE_FOR_VAR | |
344 | -SET @@global.wsrep_notify_cmd=1; | |
345 | -SELECT @@global.wsrep_notify_cmd; | |
346 | - | |
347 | ---echo | |
348 | ---echo # restore the initial value | |
349 | -SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved; | |
350 | - | |
351 | ---echo # End of test | |
352 | diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test | |
353 | deleted file mode 100644 | |
354 | index 1190ab41bb0..00000000000 | |
355 | --- a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test | |
356 | +++ /dev/null | |
357 | @@ -1,39 +0,0 @@ | |
358 | ---source include/have_wsrep.inc | |
359 | - | |
360 | ---echo # | |
361 | ---echo # wsrep_provider | |
362 | ---echo # | |
363 | - | |
364 | ---echo # save the initial value | |
365 | -SET @wsrep_provider_global_saved = @@global.wsrep_provider; | |
366 | - | |
367 | ---echo # default | |
368 | -SELECT @@global.wsrep_provider; | |
369 | - | |
370 | ---echo | |
371 | ---echo # scope | |
372 | ---error ER_INCORRECT_GLOBAL_LOCAL_VAR | |
373 | -SELECT @@session.wsrep_provider; | |
374 | -SELECT @@global.wsrep_provider; | |
375 | - | |
376 | ---echo | |
377 | ---echo # valid values | |
378 | -SET @@global.wsrep_provider=default; | |
379 | -SELECT @@global.wsrep_provider; | |
380 | - | |
381 | ---echo | |
382 | ---echo # invalid values | |
383 | ---error ER_WRONG_VALUE_FOR_VAR | |
384 | -SET @@global.wsrep_provider='/invalid/libgalera_smm.so'; | |
385 | ---error ER_WRONG_VALUE_FOR_VAR | |
386 | -SET @@global.wsrep_provider=NULL; | |
387 | -SELECT @@global.wsrep_provider; | |
388 | ---error ER_WRONG_TYPE_FOR_VAR | |
389 | -SET @@global.wsrep_provider=1; | |
390 | -SELECT @@global.wsrep_provider; | |
391 | - | |
392 | ---echo | |
393 | ---echo # restore the initial value | |
394 | -SET @@global.wsrep_provider = @wsrep_provider_global_saved; | |
395 | - | |
396 | ---echo # End of test | |
397 | diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test | |
398 | deleted file mode 100644 | |
399 | index 6eb3a94b6a4..00000000000 | |
400 | --- a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test | |
401 | +++ /dev/null | |
402 | @@ -1,41 +0,0 @@ | |
403 | ---source include/have_wsrep.inc | |
404 | - | |
405 | ---echo # | |
406 | ---echo # wsrep_provider_options | |
407 | ---echo # | |
408 | - | |
409 | -call mtr.add_suppression("WSREP: Failed to get provider options"); | |
410 | - | |
411 | ---echo # default | |
412 | -SELECT @@global.wsrep_provider_options; | |
413 | - | |
414 | ---echo | |
415 | ---echo # scope | |
416 | ---error ER_INCORRECT_GLOBAL_LOCAL_VAR | |
417 | -SELECT @@session.wsrep_provider_options; | |
418 | ---error 0,ER_WRONG_ARGUMENTS | |
419 | -SET @@global.wsrep_provider_options='option1'; | |
420 | -SELECT @@global.wsrep_provider_options; | |
421 | - | |
422 | ---echo | |
423 | ---echo # valid values | |
424 | ---error ER_WRONG_ARGUMENTS | |
425 | -SET @@global.wsrep_provider_options='name1=value1;name2=value2'; | |
426 | -SELECT @@global.wsrep_provider_options; | |
427 | ---error ER_WRONG_ARGUMENTS | |
428 | -SET @@global.wsrep_provider_options='hyphenated-name:value'; | |
429 | -SELECT @@global.wsrep_provider_options; | |
430 | ---error ER_WRONG_ARGUMENTS | |
431 | -SET @@global.wsrep_provider_options=default; | |
432 | -SELECT @@global.wsrep_provider_options; | |
433 | - | |
434 | ---echo | |
435 | ---echo # invalid values | |
436 | ---error ER_WRONG_TYPE_FOR_VAR | |
437 | -SET @@global.wsrep_provider_options=1; | |
438 | -SELECT @@global.wsrep_provider_options; | |
439 | ---error ER_WRONG_ARGUMENTS,ER_WRONG_ARGUMENTS | |
440 | -SET @@global.wsrep_provider_options=NULL; | |
441 | -SELECT @@global.wsrep_provider_options; | |
442 | - | |
443 | ---echo # End of test | |
444 | diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def | |
445 | index 11577bfe8b0..3d204db6945 100644 | |
446 | --- a/mysql-test/suite/wsrep/disabled.def | |
447 | +++ b/mysql-test/suite/wsrep/disabled.def | |
448 | @@ -10,3 +10,5 @@ | |
449 | # | |
450 | ############################################################################## | |
451 | ||
452 | + | |
453 | +mdev_6832: wsrep_provider is read-only for security reasons | |
454 | diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result | |
455 | index a9988fd1628..e57440125ee 100644 | |
456 | --- a/mysql-test/suite/wsrep/r/variables.result | |
457 | +++ b/mysql-test/suite/wsrep/r/variables.result | |
458 | @@ -14,7 +14,6 @@ SET SESSION wsrep_replicate_myisam= ON; | |
459 | ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL | |
460 | SET GLOBAL wsrep_replicate_myisam= ON; | |
461 | SET GLOBAL wsrep_replicate_myisam= OFF; | |
462 | -SET GLOBAL wsrep_provider=none; | |
463 | # | |
464 | # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of | |
465 | # variables when using "_" | |
466 | @@ -151,7 +150,6 @@ wsrep_local_state_comment # | |
467 | # Should show nothing. | |
468 | SHOW STATUS LIKE 'x'; | |
469 | Variable_name Value | |
470 | -SET GLOBAL wsrep_provider=none; | |
471 | ||
472 | SHOW STATUS LIKE 'wsrep_local_state_uuid'; | |
473 | Variable_name Value | |
474 | @@ -160,7 +158,6 @@ wsrep_local_state_uuid # | |
475 | SHOW STATUS LIKE 'wsrep_last_committed'; | |
476 | Variable_name Value | |
477 | wsrep_last_committed # | |
478 | -SET GLOBAL wsrep_provider=none; | |
479 | ||
480 | # | |
481 | # MDEV#6206: wsrep_slave_threads subtracts from max_connections | |
482 | @@ -174,7 +171,7 @@ SELECT @@global.wsrep_slave_threads; | |
483 | 1 | |
484 | SELECT @@global.wsrep_cluster_address; | |
485 | @@global.wsrep_cluster_address | |
486 | - | |
487 | +gcomm:// | |
488 | SELECT @@global.wsrep_on; | |
489 | @@global.wsrep_on | |
490 | 1 | |
491 | @@ -183,14 +180,14 @@ Variable_name Value | |
492 | Threads_connected 1 | |
493 | SHOW STATUS LIKE 'wsrep_thread_count'; | |
494 | Variable_name Value | |
495 | -wsrep_thread_count 0 | |
496 | +wsrep_thread_count 2 | |
497 | ||
498 | SELECT @@global.wsrep_provider; | |
499 | @@global.wsrep_provider | |
500 | libgalera_smm.so | |
501 | SELECT @@global.wsrep_cluster_address; | |
502 | @@global.wsrep_cluster_address | |
503 | - | |
504 | +gcomm:// | |
505 | SELECT @@global.wsrep_on; | |
506 | @@global.wsrep_on | |
507 | 1 | |
508 | @@ -199,11 +196,10 @@ Variable_name Value | |
509 | Threads_connected 1 | |
510 | SHOW STATUS LIKE 'wsrep_thread_count'; | |
511 | Variable_name Value | |
512 | -wsrep_thread_count 0 | |
513 | +wsrep_thread_count 2 | |
514 | ||
515 | # Setting wsrep_cluster_address triggers the creation of | |
516 | # applier/rollbacker threads. | |
517 | -SET GLOBAL wsrep_cluster_address= 'gcomm://'; | |
518 | # Wait for applier thread to get created 1. | |
519 | # Wait for applier thread to get created 2. | |
520 | SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; | |
521 | diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test | |
522 | index f2c3a0a3b78..fd352b61a3a 100644 | |
523 | --- a/mysql-test/suite/wsrep/t/variables.test | |
524 | +++ b/mysql-test/suite/wsrep/t/variables.test | |
525 | @@ -23,7 +23,7 @@ SET GLOBAL wsrep_replicate_myisam= ON; | |
526 | ||
527 | # Reset it back. | |
528 | SET GLOBAL wsrep_replicate_myisam= OFF; | |
529 | -SET GLOBAL wsrep_provider=none; | |
530 | +#SET GLOBAL wsrep_provider=none; | |
531 | ||
532 | --echo # | |
533 | --echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of | |
534 | @@ -32,9 +32,6 @@ SET GLOBAL wsrep_provider=none; | |
535 | ||
536 | CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*"); | |
537 | ||
538 | ---disable_query_log | |
539 | -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
540 | ---enable_query_log | |
541 | ||
542 | --replace_column 2 # | |
543 | SHOW GLOBAL STATUS LIKE 'wsrep%'; | |
544 | @@ -50,11 +47,9 @@ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment'; | |
545 | SHOW STATUS LIKE 'x'; | |
546 | ||
547 | # Reset it back. | |
548 | -SET GLOBAL wsrep_provider=none; | |
549 | +#SET GLOBAL wsrep_provider=none; | |
550 | ||
551 | ---disable_query_log | |
552 | -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
553 | ---enable_query_log | |
554 | +#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
555 | ||
556 | # The following 2 variables are used by mariabackup | |
557 | # SST. | |
558 | @@ -66,7 +61,7 @@ SHOW STATUS LIKE 'wsrep_local_state_uuid'; | |
559 | SHOW STATUS LIKE 'wsrep_last_committed'; | |
560 | ||
561 | # Reset it back. | |
562 | -SET GLOBAL wsrep_provider=none; | |
563 | +#SET GLOBAL wsrep_provider=none; | |
564 | ||
565 | --echo | |
566 | --echo # | |
567 | @@ -74,9 +69,7 @@ SET GLOBAL wsrep_provider=none; | |
568 | --echo # | |
569 | call mtr.add_suppression("WSREP: Failed to get provider options"); | |
570 | ||
571 | ---disable_query_log | |
572 | -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
573 | ---enable_query_log | |
574 | +#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
575 | ||
576 | --replace_regex /.*libgalera_smm.*/libgalera_smm.so/ | |
577 | SELECT @@global.wsrep_provider; | |
578 | @@ -87,9 +80,7 @@ SHOW STATUS LIKE 'threads_connected'; | |
579 | SHOW STATUS LIKE 'wsrep_thread_count'; | |
580 | --echo | |
581 | ||
582 | ---disable_query_log | |
583 | -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
584 | ---enable_query_log | |
585 | +#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
586 | ||
587 | --replace_regex /.*libgalera_smm.*/libgalera_smm.so/ | |
588 | SELECT @@global.wsrep_provider; | |
589 | @@ -101,7 +92,7 @@ SHOW STATUS LIKE 'wsrep_thread_count'; | |
590 | ||
591 | --echo # Setting wsrep_cluster_address triggers the creation of | |
592 | --echo # applier/rollbacker threads. | |
593 | -SET GLOBAL wsrep_cluster_address= 'gcomm://'; | |
594 | +#SET GLOBAL wsrep_cluster_address= 'gcomm://'; | |
595 | ||
596 | --echo # Wait for applier thread to get created 1. | |
597 | --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count'; | |
598 | @@ -162,15 +153,6 @@ SET @@global.wsrep_sst_auth= NULL; | |
599 | SELECT @@global.wsrep_sst_auth; | |
600 | SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved; | |
601 | ||
602 | -# Reset (for mtr internal checks) | |
603 | - | |
604 | ---disable_query_log | |
605 | -SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved; | |
606 | -eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; | |
607 | -SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved; | |
608 | -SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved; | |
609 | ---enable_query_log | |
610 | - | |
611 | --source include/galera_wait_ready.inc | |
612 | ||
613 | --echo # End of test. | |
614 | diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc | |
615 | index 64040243df0..8c67a4d432a 100644 | |
616 | --- a/sql/sys_vars.cc | |
617 | +++ b/sql/sys_vars.cc | |
618 | @@ -5669,8 +5669,8 @@ static Sys_var_tz Sys_time_zone( | |
619 | ||
620 | static Sys_var_charptr_fscs Sys_wsrep_provider( | |
621 | "wsrep_provider", "Path to replication provider library", | |
622 | - PREALLOCATED GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG), | |
623 | - DEFAULT(WSREP_NONE), | |
624 | + PREALLOCATED READ_ONLY GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG), | |
625 | + DEFAULT(WSREP_NONE), | |
626 | NO_MUTEX_GUARD, NOT_IN_BINLOG, | |
627 | ON_CHECK(wsrep_provider_check), ON_UPDATE(wsrep_provider_update)); | |
628 | ||
629 | @@ -5886,8 +5886,8 @@ static Sys_var_ulong Sys_wsrep_max_ws_rows ( | |
630 | ||
631 | static Sys_var_charptr Sys_wsrep_notify_cmd( | |
632 | "wsrep_notify_cmd", "", | |
633 | - GLOBAL_VAR(wsrep_notify_cmd),CMD_LINE(REQUIRED_ARG), | |
634 | - DEFAULT("")); | |
635 | + READ_ONLY GLOBAL_VAR(wsrep_notify_cmd), CMD_LINE(REQUIRED_ARG), | |
636 | + DEFAULT("")); | |
637 | ||
638 | static Sys_var_mybool Sys_wsrep_certify_nonPK( | |
639 | "wsrep_certify_nonPK", "Certify tables with no primary key", | |
640 | -- | |
641 | 2.31.0 | |
642 |