File: innodb_adaptive_max_sleep_delay_basic.test

package info (click to toggle)
mariadb-10.0 10.0.32-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 476,064 kB
  • sloc: cpp: 1,400,131; ansic: 832,140; perl: 54,391; sh: 41,304; pascal: 32,365; yacc: 14,921; xml: 5,257; sql: 4,667; cs: 4,647; makefile: 4,555; ruby: 4,465; python: 2,292; lex: 1,427; java: 941; asm: 295; awk: 54; php: 22; sed: 16
file content (75 lines) | stat: -rw-r--r-- 3,251 bytes parent folder | download | duplicates (6)
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
################## mysql-test/t/innodb_adaptive_max_sleep_delay.test ##########
#                                                                             #
# Variable Name: innodb_adaptive_max_sleep_delay                              #
# Scope: Global                                                               #
# Access Type: Dynamic                                                        #
# Data Type: numeric                                                          #
#                                                                             #
# Note: This variable is only defined if innodb_have_atomic_builtins=ON       #
#                                                                             #
# Creation Date: 2011-08-17                                                   #
# Author : Sunny Bains                                                        #
#                                                                             #
#                                                                             #
# Description: Dynamic config global variable innodb_adaptive_max_sleep_delay #
#              * Value check                                                  #
#              * Scope check                                                  #
#                                                                             #
###############################################################################

--source include/have_innodb.inc

# Check if builtins are enabled
if (`SELECT LOWER(VARIABLE_VALUE)='off' FROM INFORMATION_SCHEMA.GLOBAL_STATUS
    WHERE LOWER(variable_name) = 'innodb_have_atomic_builtins'`) {
	--skip Test requires InnoDB atomic builtins
}

# Display default value
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 150000 Expected

# Check if value can be set
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;

# Check for out of bounds
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001;
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 1000000 Expected

SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1;
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 0 Expected

SELECT COUNT(@@GLOBAL.innodb_adaptive_max_sleep_delay);
--echo 1 Expected

# Check if the value in GLOBAL table matches value in variable
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_adaptive_max_sleep_delay';
--echo 100 Expected

# Check if accessing variable with and without GLOBAL point to same
# variable
SELECT @@innodb_adaptive_max_sleep_delay = @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 1000000 Expected

# Check if innodb_adaptive_max_sleep_delay can be accessed with and
# without @@ sign.
SELECT COUNT(@@innodb_adaptive_max_sleep_delay);
--echo 1 Expected

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_adaptive_max_sleep_delay);
--echo Expected error 'Variable is a GLOBAL variable'

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_adaptive_max_sleep_delay);
--echo Expected error 'Variable is a GLOBAL variable'

--Error ER_BAD_FIELD_ERROR
SELECT innodb_adaptive_max_sleep_delay = @@SESSION.innodb_adaptive_max_sleep_delay;

# Reset the default
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=150000;