mirror of
https://github.com/MariaDB/server.git
synced 2025-07-10 04:22:00 +03:00
This is covered in mysql-test/t/variables.test. There is no sense to test this for every individual variables. This is to reduce the coming soon patch for ROW-type routine variables, which will change the error from ER_PARSE_ERROR to a new error "unknown structured variable".
126 lines
4.0 KiB
Plaintext
126 lines
4.0 KiB
Plaintext
SET @start_value = @@global.expire_logs_days;
|
|
SELECT @start_value;
|
|
@start_value
|
|
0
|
|
'#--------------------FN_DYNVARS_029_01------------------------#'
|
|
SET @@global.expire_logs_days = 99;
|
|
SET @@global.expire_logs_days = DEFAULT;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
0
|
|
'#---------------------FN_DYNVARS_029_02-------------------------#'
|
|
SET @@global.expire_logs_days = @start_value;
|
|
SELECT @@global.expire_logs_days = 0;
|
|
@@global.expire_logs_days = 0
|
|
1
|
|
'#--------------------FN_DYNVARS_029_03------------------------#'
|
|
SET @@global.expire_logs_days = 0;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
0
|
|
SET @@global.expire_logs_days = 99;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
SET @@global.expire_logs_days = 10;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
10
|
|
SET @@global.expire_logs_days = 21;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
21
|
|
'#--------------------FN_DYNVARS_029_04-------------------------#'
|
|
SET @@global.expire_logs_days = -1;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
0
|
|
SET @@global.expire_logs_days = 100;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect expire_logs_days value: '100'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
SET @@global.expire_logs_days = 1024;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect expire_logs_days value: '1024'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
SET @@global.expire_logs_days = 10000.01;
|
|
ERROR 42000: Incorrect argument type to variable 'expire_logs_days'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
SET @@global.expire_logs_days = -1024;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect expire_logs_days value: '-1024'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
0
|
|
SET @@global.expire_logs_days = 42949672950;
|
|
Warnings:
|
|
Warning 1292 Truncated incorrect expire_logs_days value: '42949672950'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
SET @@global.expire_logs_days = ON;
|
|
ERROR 42000: Incorrect argument type to variable 'expire_logs_days'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
SET @@global.expire_logs_days = 'test';
|
|
ERROR 42000: Incorrect argument type to variable 'expire_logs_days'
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
99
|
|
'#-------------------FN_DYNVARS_029_05----------------------------#'
|
|
SET @@session.expire_logs_days = 0;
|
|
ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SELECT @@expire_logs_days;
|
|
@@expire_logs_days
|
|
99
|
|
'#----------------------FN_DYNVARS_029_06------------------------#'
|
|
SELECT @@global.expire_logs_days = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
|
WHERE VARIABLE_NAME='expire_logs_days';
|
|
@@global.expire_logs_days = VARIABLE_VALUE
|
|
1
|
|
SELECT @@expire_logs_days = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
|
WHERE VARIABLE_NAME='expire_logs_days';
|
|
@@expire_logs_days = VARIABLE_VALUE
|
|
1
|
|
'#---------------------FN_DYNVARS_029_07----------------------#'
|
|
SET @@global.expire_logs_days = TRUE;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
1
|
|
SET @@global.expire_logs_days = FALSE;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
0
|
|
'#---------------------FN_DYNVARS_029_08----------------------#'
|
|
SET @@global.expire_logs_days = 1;
|
|
SELECT @@expire_logs_days = @@global.expire_logs_days;
|
|
@@expire_logs_days = @@global.expire_logs_days
|
|
1
|
|
'#---------------------FN_DYNVARS_029_09----------------------#'
|
|
SET expire_logs_days = 1;
|
|
ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SELECT @@expire_logs_days;
|
|
@@expire_logs_days
|
|
1
|
|
SELECT local.expire_logs_days;
|
|
ERROR 42S02: Unknown table 'local' in field list
|
|
SELECT global.expire_logs_days;
|
|
ERROR 42S02: Unknown table 'global' in field list
|
|
SELECT expire_logs_days = @@session.expire_logs_days;
|
|
ERROR 42S22: Unknown column 'expire_logs_days' in 'field list'
|
|
SET @@global.expire_logs_days = @start_value;
|
|
SELECT @@global.expire_logs_days;
|
|
@@global.expire_logs_days
|
|
0
|