Skip to content

Commit ac0b0ef

Browse files
committed
Post-fix MDEV-11695 Define a reasonable upper limit for innodb_spin_wait_delay
Adjust the tests.
1 parent 4ce579d commit ac0b0ef

File tree

3 files changed

+42
-37
lines changed

3 files changed

+42
-37
lines changed

mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,40 @@ set global innodb_spin_wait_delay=0;
4343
select @@global.innodb_spin_wait_delay;
4444
@@global.innodb_spin_wait_delay
4545
0
46+
set global innodb_spin_wait_delay=5000;
47+
select @@global.innodb_spin_wait_delay;
48+
@@global.innodb_spin_wait_delay
49+
5000
4650
set global innodb_spin_wait_delay=65535;
51+
Warnings:
52+
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '65535'
4753
select @@global.innodb_spin_wait_delay;
4854
@@global.innodb_spin_wait_delay
49-
65535
55+
6000
5056
set global innodb_spin_wait_delay=4294967295;
57+
Warnings:
58+
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '4294967295'
59+
select @@global.innodb_spin_wait_delay;
60+
@@global.innodb_spin_wait_delay
61+
6000
62+
set @@global.innodb_spin_wait_delay = 4294967296;
63+
Warnings:
64+
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '4294967296'
65+
select @@global.innodb_spin_wait_delay;
66+
@@global.innodb_spin_wait_delay
67+
6000
68+
set @@global.innodb_spin_wait_delay = 12345678901;
69+
Warnings:
70+
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '12345678901'
71+
select @@global.innodb_spin_wait_delay;
72+
@@global.innodb_spin_wait_delay
73+
6000
74+
set @@global.innodb_spin_wait_delay = 18446744073709551615;
75+
Warnings:
76+
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '18446744073709551615'
5177
select @@global.innodb_spin_wait_delay;
5278
@@global.innodb_spin_wait_delay
53-
4294967295
79+
6000
5480
set global innodb_spin_wait_delay=1.1;
5581
ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
5682
set global innodb_spin_wait_delay=1e1;
@@ -61,12 +87,12 @@ set global innodb_spin_wait_delay=' ';
6187
ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
6288
select @@global.innodb_spin_wait_delay;
6389
@@global.innodb_spin_wait_delay
64-
4294967295
90+
6000
6591
set global innodb_spin_wait_delay=" ";
6692
ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
6793
select @@global.innodb_spin_wait_delay;
6894
@@global.innodb_spin_wait_delay
69-
4294967295
95+
6000
7096
set global innodb_spin_wait_delay=-7;
7197
Warnings:
7298
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '-7'
@@ -82,18 +108,6 @@ select @@global.innodb_spin_wait_delay;
82108
select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
83109
VARIABLE_NAME VARIABLE_VALUE
84110
INNODB_SPIN_WAIT_DELAY 0
85-
SET @@global.innodb_spin_wait_delay = 4294967296;
86-
SELECT @@global.innodb_spin_wait_delay IN (4294967296,4294967295);
87-
@@global.innodb_spin_wait_delay IN (4294967296,4294967295)
88-
1
89-
SET @@global.innodb_spin_wait_delay = 12345678901;
90-
SELECT @@global.innodb_spin_wait_delay IN (12345678901,4294967295);
91-
@@global.innodb_spin_wait_delay IN (12345678901,4294967295)
92-
1
93-
SET @@global.innodb_spin_wait_delay = 18446744073709551615;
94-
SELECT @@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295);
95-
@@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295)
96-
1
97111
SET @@global.innodb_spin_wait_delay = @start_global_value;
98112
SELECT @@global.innodb_spin_wait_delay;
99113
@@global.innodb_spin_wait_delay

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ VARIABLE_SCOPE GLOBAL
21992199
VARIABLE_TYPE BIGINT UNSIGNED
22002200
VARIABLE_COMMENT Maximum delay between polling for a spin lock (6 by default)
22012201
NUMERIC_MIN_VALUE 0
2202-
NUMERIC_MAX_VALUE 18446744073709551615
2202+
NUMERIC_MAX_VALUE 6000
22032203
NUMERIC_BLOCK_SIZE 0
22042204
ENUM_VALUE_LIST NULL
22052205
READ_ONLY NO

mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,21 @@ select @@global.innodb_spin_wait_delay;
4646
#
4747
set global innodb_spin_wait_delay=0;
4848
select @@global.innodb_spin_wait_delay;
49+
set global innodb_spin_wait_delay=5000;
50+
select @@global.innodb_spin_wait_delay;
51+
#
52+
# invalid values
53+
#
4954
set global innodb_spin_wait_delay=65535;
5055
select @@global.innodb_spin_wait_delay;
5156
set global innodb_spin_wait_delay=4294967295;
5257
select @@global.innodb_spin_wait_delay;
58+
set @@global.innodb_spin_wait_delay = 4294967296;
59+
select @@global.innodb_spin_wait_delay;
60+
set @@global.innodb_spin_wait_delay = 12345678901;
61+
select @@global.innodb_spin_wait_delay;
62+
set @@global.innodb_spin_wait_delay = 18446744073709551615;
63+
select @@global.innodb_spin_wait_delay;
5364

5465
#
5566
# incorrect types
@@ -74,26 +85,6 @@ select @@global.innodb_spin_wait_delay;
7485
select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
7586
--enable_warnings
7687

77-
#
78-
# Check for out of bounds
79-
#
80-
81-
# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
82-
--disable_warnings
83-
SET @@global.innodb_spin_wait_delay = 4294967296;
84-
--enable_warnings
85-
SELECT @@global.innodb_spin_wait_delay IN (4294967296,4294967295);
86-
87-
--disable_warnings
88-
SET @@global.innodb_spin_wait_delay = 12345678901;
89-
--enable_warnings
90-
SELECT @@global.innodb_spin_wait_delay IN (12345678901,4294967295);
91-
92-
--disable_warnings
93-
SET @@global.innodb_spin_wait_delay = 18446744073709551615;
94-
--enable_warnings
95-
SELECT @@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295);
96-
9788
#
9889
# cleanup
9990
#

0 commit comments

Comments
 (0)