mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
537fc572d4
Allowing assigning of DECIMAL(N,0) values to INT-alike system variables.
140 lines
5 KiB
Text
140 lines
5 KiB
Text
SET @start_global_value = @@global.wait_timeout;
|
|
SET @start_session_value = @@session.wait_timeout;
|
|
'#--------------------FN_DYNVARS_005_01-------------------------#'
|
|
SET @@global.wait_timeout = 100;
|
|
SET @@global.wait_timeout = DEFAULT;
|
|
SELECT @@global.wait_timeout;
|
|
@@global.wait_timeout
|
|
28800
|
|
SET @@session.wait_timeout = 200;
|
|
SET @@session.wait_timeout = DEFAULT;
|
|
SELECT @@session.wait_timeout;
|
|
@@session.wait_timeout
|
|
28800
|
|
'#--------------------FN_DYNVARS_005_02-------------------------#'
|
|
SET @@global.wait_timeout = DEFAULT;
|
|
SELECT @@global.wait_timeout = @default_wait_timeout;
|
|
@@global.wait_timeout = @default_wait_timeout
|
|
1
|
|
SET @@session.wait_timeout = DEFAULT;
|
|
SELECT @@session.wait_timeout = @default_wait_timeout;
|
|
@@session.wait_timeout = @default_wait_timeout
|
|
1
|
|
'#--------------------FN_DYNVARS_005_03-------------------------#'
|
|
SET @@global.wait_timeout= 1;
|
|
SELECT @@global.wait_timeout;
|
|
@@global.wait_timeout
|
|
1
|
|
SET @@global.wait_timeout = 60020;
|
|
SELECT @@global.wait_timeout;
|
|
@@global.wait_timeout
|
|
60020
|
|
SET @@global.wait_timeout = 31536000;
|
|
SELECT @@global.wait_timeout = @max_wait_timeout;
|
|
@@global.wait_timeout = @max_wait_timeout
|
|
1
|
|
'#--------------------FN_DYNVARS_005_04-------------------------#'
|
|
SET @@session.wait_timeout =6000;
|
|
SELECT @@session.wait_timeout;
|
|
@@session.wait_timeout
|
|
6000
|
|
'#------------------FN_DYNVARS_005_05-----------------------#'
|
|
SET @@global.wait_timeout = 0;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect wait_timeout value: '0'
|
|
SET @@global.wait_timeout = -1024;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect wait_timeout value: '-1024'
|
|
SET @@global.wait_timeout = ON;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@global.wait_timeout = OFF;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@global.wait_timeout = True;
|
|
SELECT @@global.wait_timeout;
|
|
@@global.wait_timeout
|
|
1
|
|
SET @@global.wait_timeout = False;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect wait_timeout value: '0'
|
|
SELECT @@global.wait_timeout;
|
|
@@global.wait_timeout
|
|
1
|
|
SET @@global.wait_timeout = 65530.34;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@global.wait_timeout ="Test";
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@session.wait_timeout = ON;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@session.wait_timeout = OFF;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@session.wait_timeout = True;
|
|
SELECT @@session.wait_timeout;
|
|
@@session.wait_timeout
|
|
1
|
|
SET @@session.wait_timeout = False;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect wait_timeout value: '0'
|
|
SELECT @@session.wait_timeout;
|
|
@@session.wait_timeout
|
|
1
|
|
SET @@session.wait_timeout = "Test";
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@session.wait_timeout = 'test';
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@session.wait_timeout = 123456789031;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect wait_timeout value: '123456789031'
|
|
SELECT @@session.wait_timeout = @max_wait_timeout;
|
|
@@session.wait_timeout = @max_wait_timeout
|
|
1
|
|
'#------------------FN_DYNVARS_005_06-----------------------#'
|
|
SELECT @@global.wait_timeout = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
|
WHERE VARIABLE_NAME='wait_timeout';
|
|
@@global.wait_timeout = VARIABLE_VALUE
|
|
1
|
|
'#------------------FN_DYNVARS_005_07-----------------------#'
|
|
SELECT @@session.wait_timeout = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
|
WHERE VARIABLE_NAME='wait_timeout';
|
|
@@session.wait_timeout = VARIABLE_VALUE
|
|
1
|
|
'#---------------------FN_DYNVARS_001_09----------------------#'
|
|
SET @@global.wait_timeout = 30000;
|
|
SET @@global.wait_timeout = 40000;
|
|
SELECT @@wait_timeout = @@global.wait_timeout;
|
|
@@wait_timeout = @@global.wait_timeout
|
|
0
|
|
'#---------------------FN_DYNVARS_001_10----------------------#'
|
|
SET @@wait_timeout = 100;
|
|
SELECT @@wait_timeout = @@local.wait_timeout;
|
|
@@wait_timeout = @@local.wait_timeout
|
|
1
|
|
SELECT @@local.wait_timeout = @@session.wait_timeout;
|
|
@@local.wait_timeout = @@session.wait_timeout
|
|
1
|
|
'#---------------------FN_DYNVARS_001_11----------------------#'
|
|
SET wait_timeout = 1027;
|
|
SELECT @@wait_timeout;
|
|
@@wait_timeout
|
|
1027
|
|
SELECT local.wait_timeout;
|
|
ERROR 42S02: Unknown table 'local' in field list
|
|
SELECT session.wait_timeout;
|
|
ERROR 42S02: Unknown table 'session' in field list
|
|
SELECT wait_timeout = @@session.wait_timeout;
|
|
ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
|
|
#
|
|
# MDEV-9516 type error when setting session variable
|
|
#
|
|
SET SESSION wait_timeout= 28000;
|
|
SET SESSION wait_timeout= GREATEST(28000, @@wait_timeout);
|
|
SET SESSION wait_timeout= COALESCE(28000, @@wait_timeout);
|
|
SET SESSION wait_timeout= IFNULL(28000, @@wait_timeout);
|
|
SET SESSION wait_timeout= CASE WHEN TRUE THEN 28000 ELSE @@wait_timeout END;
|
|
SET SESSION wait_timeout= 28000.0;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET SESSION wait_timeout= 28000.1;
|
|
ERROR 42000: Incorrect argument type to variable 'wait_timeout'
|
|
SET @@global.wait_timeout = @start_global_value;
|
|
SET @@session.wait_timeout = @start_session_value;
|