| 1 |
################## mysql-test/t/innodb_adaptive_max_sleep_delay.test ########## |
| 2 |
# # |
| 3 |
# Variable Name: innodb_adaptive_max_sleep_delay # |
| 4 |
# Scope: Global # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: numeric # |
| 7 |
# # |
| 8 |
# Note: This variable is only defined if innodb_have_atomic_builtins=ON # |
| 9 |
# # |
| 10 |
# Creation Date: 2011-08-17 # |
| 11 |
# Author : Sunny Bains # |
| 12 |
# # |
| 13 |
# # |
| 14 |
# Description: Dynamic config global variable innodb_adaptive_max_sleep_delay # |
| 15 |
# * Value check # |
| 16 |
# * Scope check # |
| 17 |
# # |
| 18 |
############################################################################### |
| 19 |
|
| 20 |
|
| 21 |
# Check if builtins are enabled |
| 22 |
if (`SELECT LOWER(VARIABLE_VALUE)='off' FROM performance_schema.global_status |
| 23 |
WHERE LOWER(variable_name) = 'innodb_have_atomic_builtins'`) { |
| 24 |
--skip Test requires InnoDB atomic builtins |
| 25 |
} |
| 26 |
|
| 27 |
# Display default value |
| 28 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 29 |
--echo 150000 Expected |
| 30 |
|
| 31 |
# Check if value can be set |
| 32 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100; |
| 33 |
|
| 34 |
# Check for valid values |
| 35 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=0; |
| 36 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 37 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100000; |
| 38 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 39 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000000; |
| 40 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 41 |
|
| 42 |
# Check for out of bounds |
| 43 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001; |
| 44 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 45 |
--echo 1000000 Expected |
| 46 |
|
| 47 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=4294967295; |
| 48 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 49 |
--echo 1000000 Expected |
| 50 |
|
| 51 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1; |
| 52 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 53 |
--echo 0 Expected |
| 54 |
|
| 55 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1024; |
| 56 |
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 57 |
--echo 0 Expected |
| 58 |
|
| 59 |
SELECT COUNT(@@GLOBAL.innodb_adaptive_max_sleep_delay); |
| 60 |
--echo 1 Expected |
| 61 |
|
| 62 |
# Check if the value in GLOBAL table matches value in variable |
| 63 |
--disable_warnings |
| 64 |
SELECT VARIABLE_VALUE |
| 65 |
FROM performance_schema.global_variables |
| 66 |
WHERE VARIABLE_NAME='innodb_adaptive_max_sleep_delay'; |
| 67 |
--enable_warnings |
| 68 |
--echo 100 Expected |
| 69 |
|
| 70 |
# Check if accessing variable with and without GLOBAL point to same |
| 71 |
# variable |
| 72 |
SELECT @@innodb_adaptive_max_sleep_delay = @@GLOBAL.innodb_adaptive_max_sleep_delay; |
| 73 |
--echo 1000000 Expected |
| 74 |
|
| 75 |
# Check if innodb_adaptive_max_sleep_delay can be accessed with and |
| 76 |
# without @@ sign. |
| 77 |
SELECT COUNT(@@innodb_adaptive_max_sleep_delay); |
| 78 |
--echo 1 Expected |
| 79 |
|
| 80 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 81 |
SELECT COUNT(@@local.innodb_adaptive_max_sleep_delay); |
| 82 |
--echo Expected error 'Variable is a GLOBAL variable' |
| 83 |
|
| 84 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 85 |
SELECT COUNT(@@SESSION.innodb_adaptive_max_sleep_delay); |
| 86 |
--echo Expected error 'Variable is a GLOBAL variable' |
| 87 |
|
| 88 |
--Error ER_BAD_FIELD_ERROR |
| 89 |
SELECT innodb_adaptive_max_sleep_delay; |
| 90 |
|
| 91 |
# Reset the default |
| 92 |
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=150000; |