| 1 |
# Verify that the same system variables can be registered on master and slave. |
| 2 |
|
| 3 |
--source ../include/have_component_test_sys_var_service.inc |
| 4 |
|
| 5 |
--source include/master-slave.inc |
| 6 |
|
| 7 |
call mtr.add_suppression("duplicate variable name"); |
| 8 |
--echo # Simple load test |
| 9 |
INSTALL COMPONENT "file://component_test_sys_var_service"; |
| 10 |
|
| 11 |
SELECT VARIABLE_NAME, MIN_VALUE, MAX_VALUE FROM performance_schema.variables_info |
| 12 |
WHERE VARIABLE_NAME LIKE '%component%' |
| 13 |
ORDER BY VARIABLE_NAME; |
| 14 |
|
| 15 |
--echo # Testing integer and bool type variable |
| 16 |
SELECT @@test_component.int_sys_var; |
| 17 |
SELECT @@global.test_component.int_sys_var; |
| 18 |
SELECT @@global.test_component.bool_sys_var; |
| 19 |
SELECT @@test_component.int_sys_var, @@test_component.bool_sys_var; |
| 20 |
--error 1229 |
| 21 |
SET test_component.bool_sys_var=1; |
| 22 |
SET GLOBAL test_component.int_sys_var=7; |
| 23 |
# The max value for the test_component.int_sys_var is 1024. Hence below SET |
| 24 |
# stmt will set the value to 1024. |
| 25 |
SET GLOBAL test_component.int_sys_var=1234567; |
| 26 |
SELECT @@test_component.int_sys_var; |
| 27 |
# The min value for the test_component.int_sys_var is 0. Hence below SET stmt |
| 28 |
# will set the value to 0. |
| 29 |
SET GLOBAL test_component.int_sys_var=-1; |
| 30 |
SELECT @@test_component.int_sys_var; |
| 31 |
--error 1232 |
| 32 |
SET GLOBAL test_component.int_sys_var=1.25; |
| 33 |
--error 1232 |
| 34 |
SET GLOBAL test_component.int_sys_var="hello"; |
| 35 |
SET GLOBAL test_component.int_sys_var=123, test_component.bool_sys_var=0; |
| 36 |
SELECT @@test_component.int_sys_var, @@test_component.bool_sys_var; |
| 37 |
--error 1229 |
| 38 |
SET SESSION test_component.int_sys_var=123; |
| 39 |
|
| 40 |
--echo # Testing enum type variable |
| 41 |
SELECT @@test_component.enum_sys_var; |
| 42 |
SET GLOBAL test_component.enum_sys_var="LOW"; |
| 43 |
SELECT @@test_component.enum_sys_var; |
| 44 |
|
| 45 |
--echo # Testing string type variable |
| 46 |
SELECT @@test_component.str_sys_var; |
| 47 |
SET GLOBAL test_component.str_sys_var="dictionary.txt"; |
| 48 |
SELECT @@test_component.str_sys_var; |
| 49 |
SET GLOBAL test_component.str_sys_var=default; |
| 50 |
SELECT @@test_component.str_sys_var; |
| 51 |
|
| 52 |
--echo # Testing unsigned integer type variable |
| 53 |
SELECT @@test_component.uint_sys_var; |
| 54 |
SET GLOBAL test_component.uint_sys_var=12345678; |
| 55 |
SELECT @@test_component.uint_sys_var; |
| 56 |
SET GLOBAL test_component.uint_sys_var=default; |
| 57 |
SELECT @@test_component.uint_sys_var; |
| 58 |
|
| 59 |
--echo # Testing long type variable |
| 60 |
SELECT @@test_component.long_sys_var; |
| 61 |
SET GLOBAL test_component.long_sys_var=1234567890; |
| 62 |
SELECT @@test_component.long_sys_var; |
| 63 |
SET GLOBAL test_component.long_sys_var=default; |
| 64 |
SELECT @@test_component.long_sys_var; |
| 65 |
|
| 66 |
--echo # Testing unsigned long type variable |
| 67 |
SELECT @@test_component.ulong_sys_var; |
| 68 |
SET GLOBAL test_component.ulong_sys_var=1234567890; |
| 69 |
SELECT @@test_component.ulong_sys_var; |
| 70 |
SET GLOBAL test_component.ulong_sys_var=default; |
| 71 |
SELECT @@test_component.ulong_sys_var; |
| 72 |
|
| 73 |
--echo # Testing long long type variable |
| 74 |
SELECT @@test_component.longlong_sys_var; |
| 75 |
SET GLOBAL test_component.longlong_sys_var=1234567890; |
| 76 |
SELECT @@test_component.longlong_sys_var; |
| 77 |
SET GLOBAL test_component.longlong_sys_var=default; |
| 78 |
SELECT @@test_component.longlong_sys_var; |
| 79 |
|
| 80 |
--echo # Testing unsigned long long type variable |
| 81 |
SELECT @@test_component.ulonglong_sys_var; |
| 82 |
SET GLOBAL test_component.ulonglong_sys_var=1234567890; |
| 83 |
SELECT @@test_component.ulonglong_sys_var; |
| 84 |
SET GLOBAL test_component.ulonglong_sys_var=default; |
| 85 |
SELECT @@test_component.ulonglong_sys_var; |
| 86 |
|
| 87 |
--echo # Testing PERSIST for component system variables |
| 88 |
SET PERSIST test_component.int_sys_var=7; |
| 89 |
SELECT @@test_component.int_sys_var; |
| 90 |
SELECT * FROM performance_schema.persisted_variables; |
| 91 |
RESET PERSIST `test_component.int_sys_var`; |
| 92 |
SELECT * FROM performance_schema.persisted_variables; |
| 93 |
|
| 94 |
--echo sync_slave_with_master; |
| 95 |
sync_slave_with_master; |
| 96 |
|
| 97 |
--echo connection slave; |
| 98 |
connection slave; |
| 99 |
INSTALL COMPONENT "file://component_test_sys_var_service"; |
| 100 |
|
| 101 |
SELECT VARIABLE_NAME, MIN_VALUE, MAX_VALUE FROM performance_schema.variables_info |
| 102 |
WHERE VARIABLE_NAME LIKE '%component%' |
| 103 |
ORDER BY VARIABLE_NAME; |
| 104 |
|
| 105 |
SET GLOBAL test_component.int_sys_var=7; |
| 106 |
SET GLOBAL test_component.str_sys_var="salve.txt"; |
| 107 |
SELECT @@test_component.int_sys_var; |
| 108 |
SELECT @@test_component.long_sys_var; |
| 109 |
SELECT @@test_component.ulong_sys_var; |
| 110 |
SELECT @@test_component.longlong_sys_var; |
| 111 |
SELECT @@test_component.ulonglong_sys_var; |
| 112 |
SELECT @@test_component.str_sys_var; |
| 113 |
|
| 114 |
UNINSTALL COMPONENT "file://component_test_sys_var_service"; |
| 115 |
|
| 116 |
--echo connection master; |
| 117 |
connection master; |
| 118 |
UNINSTALL COMPONENT "file://component_test_sys_var_service"; |
| 119 |
|
| 120 |
sync_slave_with_master; |
| 121 |
--source include/rpl_end.inc |