| 1 |
################################################################################ |
| 2 |
# gtid_executed_compression_period |
| 3 |
# |
| 4 |
# It is a global variable only and can be set dynamically. |
| 5 |
# It has UINT type and accepts numbers from 0 to 4294967295. Default value is 1000. |
| 6 |
# |
| 7 |
# This test verifies the variable can be set, selected and showed correctly. |
| 8 |
################################################################################ |
| 9 |
|
| 10 |
SET @start_global_value = @@global.gtid_executed_compression_period; |
| 11 |
SELECT @start_global_value; |
| 12 |
|
| 13 |
--echo # |
| 14 |
--echo # It exists as a global variable |
| 15 |
--echo # |
| 16 |
SELECT @@GLOBAL.gtid_executed_compression_period; |
| 17 |
|
| 18 |
SHOW GLOBAL VARIABLES LIKE 'gtid_executed_compression_period'; |
| 19 |
|
| 20 |
--disable_warnings |
| 21 |
SELECT * FROM performance_schema.global_variables WHERE |
| 22 |
VARIABLE_NAME = 'gtid_executed_compression_period'; |
| 23 |
--enable_warnings |
| 24 |
|
| 25 |
--echo # |
| 26 |
--echo # It is not a session variable |
| 27 |
--echo # |
| 28 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 29 |
SELECT @@SESSION.gtid_executed_compression_period; |
| 30 |
|
| 31 |
--error ER_GLOBAL_VARIABLE |
| 32 |
SET SESSION gtid_executed_compression_period= 2; |
| 33 |
SHOW SESSION VARIABLES LIKE 'gtid_executed_compression_period'; |
| 34 |
|
| 35 |
SHOW SESSION VARIABLES LIKE 'gtid_executed_compression_period'; |
| 36 |
|
| 37 |
--disable_warnings |
| 38 |
SELECT * FROM performance_schema.session_variables WHERE |
| 39 |
VARIABLE_NAME ='gtid_executed_compression_period'; |
| 40 |
--enable_warnings |
| 41 |
|
| 42 |
--echo # |
| 43 |
--echo # Verify that it's writable |
| 44 |
--echo # |
| 45 |
SET GLOBAL gtid_executed_compression_period= 0; |
| 46 |
SELECT @@GLOBAL.gtid_executed_compression_period; |
| 47 |
|
| 48 |
SET GLOBAL gtid_executed_compression_period= 5000; |
| 49 |
SELECT @@GLOBAL.gtid_executed_compression_period; |
| 50 |
|
| 51 |
SET GLOBAL gtid_executed_compression_period= 4294967295; |
| 52 |
SELECT @@GLOBAL.gtid_executed_compression_period; |
| 53 |
|
| 54 |
|
| 55 |
--echo # |
| 56 |
--echo # Verify that it could not bet set with invalid values |
| 57 |
--echo # |
| 58 |
|
| 59 |
# Allowed value range: (0, UINT_MAX32) |
| 60 |
# Value lower than allowed range |
| 61 |
SET GLOBAL gtid_executed_compression_period= -1; |
| 62 |
SELECT @@GLOBAL.gtid_executed_compression_period; |
| 63 |
|
| 64 |
# Value higher than allowed range |
| 65 |
SET GLOBAL gtid_executed_compression_period= 4294967296; |
| 66 |
SELECT @@GLOBAL.gtid_executed_compression_period; |
| 67 |
|
| 68 |
# Incompatible value types |
| 69 |
--error ER_WRONG_TYPE_FOR_VAR |
| 70 |
set global gtid_executed_compression_period= 1.1; |
| 71 |
--error ER_WRONG_TYPE_FOR_VAR |
| 72 |
set global gtid_executed_compression_period= 1e1; |
| 73 |
--error ER_WRONG_TYPE_FOR_VAR |
| 74 |
set global gtid_executed_compression_period= "foobar"; |
| 75 |
|
| 76 |
SET @@global.gtid_executed_compression_period= @start_global_value; |
| 77 |
SELECT @@global.gtid_executed_compression_period; |