Commit ac0b0efa authored by Marko Mäkelä's avatar Marko Mäkelä

Post-fix MDEV-11695 Define a reasonable upper limit for innodb_spin_wait_delay

Adjust the tests.
parent 4ce579d2
...@@ -43,14 +43,40 @@ set global innodb_spin_wait_delay=0; ...@@ -43,14 +43,40 @@ set global innodb_spin_wait_delay=0;
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay @@global.innodb_spin_wait_delay
0 0
set global innodb_spin_wait_delay=5000;
select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay
5000
set global innodb_spin_wait_delay=65535; set global innodb_spin_wait_delay=65535;
Warnings:
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '65535'
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay @@global.innodb_spin_wait_delay
65535 6000
set global innodb_spin_wait_delay=4294967295; set global innodb_spin_wait_delay=4294967295;
Warnings:
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '4294967295'
select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay
6000
set @@global.innodb_spin_wait_delay = 4294967296;
Warnings:
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '4294967296'
select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay
6000
set @@global.innodb_spin_wait_delay = 12345678901;
Warnings:
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '12345678901'
select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay
6000
set @@global.innodb_spin_wait_delay = 18446744073709551615;
Warnings:
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '18446744073709551615'
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay @@global.innodb_spin_wait_delay
4294967295 6000
set global innodb_spin_wait_delay=1.1; set global innodb_spin_wait_delay=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay' ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
set global innodb_spin_wait_delay=1e1; set global innodb_spin_wait_delay=1e1;
...@@ -61,12 +87,12 @@ set global innodb_spin_wait_delay=' '; ...@@ -61,12 +87,12 @@ set global innodb_spin_wait_delay=' ';
ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay' ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay @@global.innodb_spin_wait_delay
4294967295 6000
set global innodb_spin_wait_delay=" "; set global innodb_spin_wait_delay=" ";
ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay' ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay @@global.innodb_spin_wait_delay
4294967295 6000
set global innodb_spin_wait_delay=-7; set global innodb_spin_wait_delay=-7;
Warnings: Warnings:
Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '-7' Warning 1292 Truncated incorrect innodb_spin_wait_delay value: '-7'
...@@ -82,18 +108,6 @@ select @@global.innodb_spin_wait_delay; ...@@ -82,18 +108,6 @@ select @@global.innodb_spin_wait_delay;
select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
INNODB_SPIN_WAIT_DELAY 0 INNODB_SPIN_WAIT_DELAY 0
SET @@global.innodb_spin_wait_delay = 4294967296;
SELECT @@global.innodb_spin_wait_delay IN (4294967296,4294967295);
@@global.innodb_spin_wait_delay IN (4294967296,4294967295)
1
SET @@global.innodb_spin_wait_delay = 12345678901;
SELECT @@global.innodb_spin_wait_delay IN (12345678901,4294967295);
@@global.innodb_spin_wait_delay IN (12345678901,4294967295)
1
SET @@global.innodb_spin_wait_delay = 18446744073709551615;
SELECT @@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295);
@@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295)
1
SET @@global.innodb_spin_wait_delay = @start_global_value; SET @@global.innodb_spin_wait_delay = @start_global_value;
SELECT @@global.innodb_spin_wait_delay; SELECT @@global.innodb_spin_wait_delay;
@@global.innodb_spin_wait_delay @@global.innodb_spin_wait_delay
......
...@@ -2199,7 +2199,7 @@ VARIABLE_SCOPE GLOBAL ...@@ -2199,7 +2199,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum delay between polling for a spin lock (6 by default) VARIABLE_COMMENT Maximum delay between polling for a spin lock (6 by default)
NUMERIC_MIN_VALUE 0 NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 18446744073709551615 NUMERIC_MAX_VALUE 6000
NUMERIC_BLOCK_SIZE 0 NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
......
...@@ -46,10 +46,21 @@ select @@global.innodb_spin_wait_delay; ...@@ -46,10 +46,21 @@ select @@global.innodb_spin_wait_delay;
# #
set global innodb_spin_wait_delay=0; set global innodb_spin_wait_delay=0;
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
set global innodb_spin_wait_delay=5000;
select @@global.innodb_spin_wait_delay;
#
# invalid values
#
set global innodb_spin_wait_delay=65535; set global innodb_spin_wait_delay=65535;
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
set global innodb_spin_wait_delay=4294967295; set global innodb_spin_wait_delay=4294967295;
select @@global.innodb_spin_wait_delay; select @@global.innodb_spin_wait_delay;
set @@global.innodb_spin_wait_delay = 4294967296;
select @@global.innodb_spin_wait_delay;
set @@global.innodb_spin_wait_delay = 12345678901;
select @@global.innodb_spin_wait_delay;
set @@global.innodb_spin_wait_delay = 18446744073709551615;
select @@global.innodb_spin_wait_delay;
# #
# incorrect types # incorrect types
...@@ -74,26 +85,6 @@ select @@global.innodb_spin_wait_delay; ...@@ -74,26 +85,6 @@ select @@global.innodb_spin_wait_delay;
select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay'; select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
--enable_warnings --enable_warnings
#
# Check for out of bounds
#
# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
--disable_warnings
SET @@global.innodb_spin_wait_delay = 4294967296;
--enable_warnings
SELECT @@global.innodb_spin_wait_delay IN (4294967296,4294967295);
--disable_warnings
SET @@global.innodb_spin_wait_delay = 12345678901;
--enable_warnings
SELECT @@global.innodb_spin_wait_delay IN (12345678901,4294967295);
--disable_warnings
SET @@global.innodb_spin_wait_delay = 18446744073709551615;
--enable_warnings
SELECT @@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295);
# #
# cleanup # cleanup
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment