Commit 8c5c3a45 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-26067 innodb_lock_wait_timeout values above 100,000,000 are useless

The practical maximum value of the parameter innodb_lock_wait_timeout
is 100,000,000. Any value larger than that specifies an infinite timeout.

Therefore, we should make 100,000,000 the maximum value of the parameter.
parent ce1c957a
...@@ -74,9 +74,11 @@ SELECT @@global.innodb_lock_wait_timeout; ...@@ -74,9 +74,11 @@ SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1024 1024
SET @@global.innodb_lock_wait_timeout=1073741824; SET @@global.innodb_lock_wait_timeout=1073741824;
Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073741824'
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1073741824 100000000
SET @@session.innodb_lock_wait_timeout=1; SET @@session.innodb_lock_wait_timeout=1;
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
...@@ -86,14 +88,16 @@ SELECT @@session.innodb_lock_wait_timeout; ...@@ -86,14 +88,16 @@ SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1024 1024
SET @@session.innodb_lock_wait_timeout=1073741824; SET @@session.innodb_lock_wait_timeout=1073741824;
Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073741824'
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1073741824 100000000
SET @@global.innodb_lock_wait_timeout="t"; SET @@global.innodb_lock_wait_timeout="t";
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1073741824 100000000
SET @@global.innodb_lock_wait_timeout=-1024; SET @@global.innodb_lock_wait_timeout=-1024;
Warnings: Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '-1024' Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '-1024'
...@@ -105,27 +109,27 @@ Warnings: ...@@ -105,27 +109,27 @@ Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073741825' Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073741825'
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1073741824 100000000
SET @@global.innodb_lock_wait_timeout=" "; SET @@global.innodb_lock_wait_timeout=" ";
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1073741824 100000000
SET @@global.innodb_lock_wait_timeout=' '; SET @@global.innodb_lock_wait_timeout=' ';
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1073741824 100000000
SET @@global.innodb_lock_wait_timeout=1.1; SET @@global.innodb_lock_wait_timeout=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
1073741824 100000000
SET @@session.innodb_lock_wait_timeout="T"; SET @@session.innodb_lock_wait_timeout="T";
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1073741824 100000000
SET @@session.innodb_lock_wait_timeout=-1024; SET @@session.innodb_lock_wait_timeout=-1024;
Warnings: Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '-1024' Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '-1024'
...@@ -137,22 +141,22 @@ Warnings: ...@@ -137,22 +141,22 @@ Warnings:
Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073999999' Warning 1292 Truncated incorrect innodb_lock_wait_timeout value: '1073999999'
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1073741824 100000000
SET @@session.innodb_lock_wait_timeout=' '; SET @@session.innodb_lock_wait_timeout=' ';
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1073741824 100000000
SET @@session.innodb_lock_wait_timeout=" "; SET @@session.innodb_lock_wait_timeout=" ";
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1073741824 100000000
SET @@session.innodb_lock_wait_timeout=1.1; SET @@session.innodb_lock_wait_timeout=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout' ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
SELECT @@session.innodb_lock_wait_timeout; SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout @@session.innodb_lock_wait_timeout
1073741824 100000000
SET @@global.innodb_lock_wait_timeout = @start_global_value; SET @@global.innodb_lock_wait_timeout = @start_global_value;
SELECT @@global.innodb_lock_wait_timeout; SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout @@global.innodb_lock_wait_timeout
......
...@@ -207,15 +207,6 @@ ...@@ -207,15 +207,6 @@
NUMERIC_BLOCK_SIZE 0 NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
@@ -1021,7 +1021,7 @@
SESSION_VALUE 50
DEFAULT_VALUE 50
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1073741824
@@ -1033,10 +1033,10 @@ @@ -1033,10 +1033,10 @@
SESSION_VALUE NULL SESSION_VALUE NULL
DEFAULT_VALUE 16777216 DEFAULT_VALUE 16777216
......
...@@ -1009,10 +1009,10 @@ VARIABLE_NAME INNODB_LOCK_WAIT_TIMEOUT ...@@ -1009,10 +1009,10 @@ VARIABLE_NAME INNODB_LOCK_WAIT_TIMEOUT
SESSION_VALUE 50 SESSION_VALUE 50
DEFAULT_VALUE 50 DEFAULT_VALUE 50
VARIABLE_SCOPE SESSION VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout. VARIABLE_COMMENT Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. The value 100000000 is infinite timeout.
NUMERIC_MIN_VALUE 0 NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1073741824 NUMERIC_MAX_VALUE 100000000
NUMERIC_BLOCK_SIZE 0 NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
......
...@@ -270,7 +270,7 @@ replace t1 values (1,2),(1,3),(2,4); ...@@ -270,7 +270,7 @@ replace t1 values (1,2),(1,3),(2,4);
# MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE # MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
# #
set @old_lock_wait_timeout= @@innodb_lock_wait_timeout; set @old_lock_wait_timeout= @@innodb_lock_wait_timeout;
set @@innodb_lock_wait_timeout= 1073741824; set @@innodb_lock_wait_timeout= 100000000;
create or replace table t1 (pk int, a char(3), b char(3), primary key(pk)) create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
engine=innodb with system versioning; engine=innodb with system versioning;
insert into t1 (pk) values (1); insert into t1 (pk) values (1);
......
...@@ -173,7 +173,7 @@ replace t1 values (1,2),(1,3),(2,4); ...@@ -173,7 +173,7 @@ replace t1 values (1,2),(1,3),(2,4);
--echo # MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE --echo # MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
--echo # --echo #
set @old_lock_wait_timeout= @@innodb_lock_wait_timeout; set @old_lock_wait_timeout= @@innodb_lock_wait_timeout;
set @@innodb_lock_wait_timeout= 1073741824; set @@innodb_lock_wait_timeout= 100000000;
create or replace table t1 (pk int, a char(3), b char(3), primary key(pk)) create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
engine=innodb with system versioning; engine=innodb with system versioning;
......
...@@ -869,9 +869,9 @@ static MYSQL_THDVAR_BOOL(ft_enable_stopword, PLUGIN_VAR_OPCMDARG, ...@@ -869,9 +869,9 @@ static MYSQL_THDVAR_BOOL(ft_enable_stopword, PLUGIN_VAR_OPCMDARG,
NULL, NULL, NULL, NULL,
/* default */ TRUE); /* default */ TRUE);
static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG, static MYSQL_THDVAR_UINT(lock_wait_timeout, PLUGIN_VAR_RQCMDARG,
"Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.", "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. The value 100000000 is infinite timeout.",
NULL, NULL, 50, 0, 1024 * 1024 * 1024, 0); NULL, NULL, 50, 0, 100000000, 0);
static MYSQL_THDVAR_STR(ft_user_stopword_table, static MYSQL_THDVAR_STR(ft_user_stopword_table,
PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_MEMALLOC,
...@@ -1857,7 +1857,7 @@ thd_has_edited_nontrans_tables( ...@@ -1857,7 +1857,7 @@ thd_has_edited_nontrans_tables(
/******************************************************************//** /******************************************************************//**
Returns the lock wait timeout for the current connection. Returns the lock wait timeout for the current connection.
@return the lock wait timeout, in seconds */ @return the lock wait timeout, in seconds */
ulong uint
thd_lock_wait_timeout( thd_lock_wait_timeout(
/*==================*/ /*==================*/
THD* thd) /*!< in: thread handle, or NULL to query THD* thd) /*!< in: thread handle, or NULL to query
......
...@@ -242,7 +242,7 @@ const char *thd_innodb_tmpdir(THD *thd); ...@@ -242,7 +242,7 @@ const char *thd_innodb_tmpdir(THD *thd);
/******************************************************************//** /******************************************************************//**
Returns the lock wait timeout for the current connection. Returns the lock wait timeout for the current connection.
@return the lock wait timeout, in seconds */ @return the lock wait timeout, in seconds */
ulong uint
thd_lock_wait_timeout( thd_lock_wait_timeout(
/*==================*/ /*==================*/
THD* thd); /*!< in: thread handle, or NULL to query THD* thd); /*!< in: thread handle, or NULL to query
......
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