File: rpl_sys_var_reg.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (121 lines) | stat: -rw-r--r-- 4,412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Verify that the same system variables can be registered on master and slave.

--source ../include/have_component_test_sys_var_service.inc

--source include/master-slave.inc

call mtr.add_suppression("duplicate variable name");
--echo # Simple load test
INSTALL COMPONENT "file://component_test_sys_var_service";

SELECT VARIABLE_NAME, MIN_VALUE, MAX_VALUE FROM performance_schema.variables_info
       WHERE VARIABLE_NAME LIKE '%component%'
       ORDER BY VARIABLE_NAME;

--echo # Testing integer and bool type variable
SELECT @@test_component.int_sys_var;
SELECT @@global.test_component.int_sys_var;
SELECT @@global.test_component.bool_sys_var;
SELECT @@test_component.int_sys_var, @@test_component.bool_sys_var;
--error 1229
SET test_component.bool_sys_var=1;
SET GLOBAL test_component.int_sys_var=7;
# The max value for the test_component.int_sys_var is 1024.  Hence below SET
# stmt will set the value to 1024.
SET GLOBAL test_component.int_sys_var=1234567;
SELECT @@test_component.int_sys_var;
# The min value for the test_component.int_sys_var is 0.  Hence below SET stmt
# will set the value to 0.
SET GLOBAL test_component.int_sys_var=-1;
SELECT @@test_component.int_sys_var;
--error 1232
SET GLOBAL test_component.int_sys_var=1.25;
--error 1232
SET GLOBAL test_component.int_sys_var="hello";
SET GLOBAL test_component.int_sys_var=123, test_component.bool_sys_var=0;
SELECT @@test_component.int_sys_var, @@test_component.bool_sys_var;
--error 1229
SET SESSION test_component.int_sys_var=123;

--echo # Testing enum type variable
SELECT @@test_component.enum_sys_var;
SET GLOBAL test_component.enum_sys_var="LOW";
SELECT @@test_component.enum_sys_var;

--echo # Testing string type variable
SELECT @@test_component.str_sys_var;
SET GLOBAL test_component.str_sys_var="dictionary.txt";
SELECT @@test_component.str_sys_var;
SET GLOBAL test_component.str_sys_var=default;
SELECT @@test_component.str_sys_var;

--echo # Testing unsigned integer type variable
SELECT @@test_component.uint_sys_var;
SET GLOBAL test_component.uint_sys_var=12345678;
SELECT @@test_component.uint_sys_var;
SET GLOBAL test_component.uint_sys_var=default;
SELECT @@test_component.uint_sys_var;

--echo # Testing long type variable
SELECT @@test_component.long_sys_var;
SET GLOBAL test_component.long_sys_var=1234567890;
SELECT @@test_component.long_sys_var;
SET GLOBAL test_component.long_sys_var=default;
SELECT @@test_component.long_sys_var;

--echo # Testing unsigned long type variable
SELECT @@test_component.ulong_sys_var;
SET GLOBAL test_component.ulong_sys_var=1234567890;
SELECT @@test_component.ulong_sys_var;
SET GLOBAL test_component.ulong_sys_var=default;
SELECT @@test_component.ulong_sys_var;

--echo # Testing long long type variable
SELECT @@test_component.longlong_sys_var;
SET GLOBAL test_component.longlong_sys_var=1234567890;
SELECT @@test_component.longlong_sys_var;
SET GLOBAL test_component.longlong_sys_var=default;
SELECT @@test_component.longlong_sys_var;

--echo # Testing unsigned long long type variable
SELECT @@test_component.ulonglong_sys_var;
SET GLOBAL test_component.ulonglong_sys_var=1234567890;
SELECT @@test_component.ulonglong_sys_var;
SET GLOBAL test_component.ulonglong_sys_var=default;
SELECT @@test_component.ulonglong_sys_var;

--echo # Testing PERSIST for component system variables
SET PERSIST test_component.int_sys_var=7;
SELECT @@test_component.int_sys_var;
SELECT * FROM performance_schema.persisted_variables;
RESET PERSIST `test_component.int_sys_var`;
SELECT * FROM performance_schema.persisted_variables;

--echo sync_slave_with_master;
sync_slave_with_master;

--echo connection slave;
connection slave;
INSTALL COMPONENT "file://component_test_sys_var_service";

SELECT VARIABLE_NAME, MIN_VALUE, MAX_VALUE FROM performance_schema.variables_info
       WHERE VARIABLE_NAME LIKE '%component%'
       ORDER BY VARIABLE_NAME;

SET GLOBAL test_component.int_sys_var=7;
SET GLOBAL test_component.str_sys_var="salve.txt";
SELECT @@test_component.int_sys_var;
SELECT @@test_component.long_sys_var;
SELECT @@test_component.ulong_sys_var;
SELECT @@test_component.longlong_sys_var;
SELECT @@test_component.ulonglong_sys_var;
SELECT @@test_component.str_sys_var;

UNINSTALL COMPONENT "file://component_test_sys_var_service";

--echo connection master;
connection master;
UNINSTALL COMPONENT "file://component_test_sys_var_service";

sync_slave_with_master;
--source include/rpl_end.inc