mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
220d9b8c4a
To-number conversion warnings work differenly with CHAR and VARCHAR sp variables. The original revision-IDs are: staale.smedseng@sun.com-20081124095339-2qdvzkp0rn1ljs30 staale.smedseng@sun.com-20081125104611-rtxic5d12e83ag2o The patch provides ER_TRUNCATED_WRONG_VALUE warning messages for conversion of VARCHAR to numberic values, in line with messages provided for CHAR conversions. Conversions are checked for success, and the message is emitted in case failure. The tests are amended to accept the added warning messages, and explicit conversion of ON/OFF values is added for statements checking system variables. In test rpl.rpl_switch_stm_row_mixed checking for warnings is temporarily disabled for one statement, as this generates warning messages for strings that vary between executions. sql/field.cc: The pushing of the truncation warning is now done in a separate static function, and used in various places.
105 lines
3.7 KiB
Text
105 lines
3.7 KiB
Text
SET @global_start_value = @@global.secure_auth;
|
|
SELECT @global_start_value;
|
|
@global_start_value
|
|
0
|
|
'#--------------------FN_DYNVARS_143_01------------------------#'
|
|
SET @@global.secure_auth = 1;
|
|
SET @@global.secure_auth = DEFAULT;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
0
|
|
'#---------------------FN_DYNVARS_143_02-------------------------#'
|
|
SET secure_auth = 1;
|
|
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SELECT @@secure_auth;
|
|
@@secure_auth
|
|
0
|
|
SELECT global.secure_auth;
|
|
ERROR 42S02: Unknown table 'global' in field list
|
|
SET global secure_auth = 1;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
1
|
|
'#--------------------FN_DYNVARS_143_03------------------------#'
|
|
SET @@global.secure_auth = 0;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
0
|
|
SET @@global.secure_auth = 1;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
1
|
|
'#--------------------FN_DYNVARS_143_04-------------------------#'
|
|
SET @@global.secure_auth = -1;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of '-1'
|
|
SET @@global.secure_auth = 2;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of '2'
|
|
SET @@global.secure_auth = "T";
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of 'T'
|
|
SET @@global.secure_auth = "Y";
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of 'Y'
|
|
SET @@global.secure_auth = YES;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of 'YES'
|
|
SET @@global.secure_auth = ONN;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of 'ONN'
|
|
SET @@global.secure_auth = OOF;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of 'OOF'
|
|
SET @@global.secure_auth = 0FF;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of '0FF'
|
|
SET @@global.secure_auth = ' 1';
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of ' 1'
|
|
SET @@global.secure_auth = NO;
|
|
ERROR 42000: Variable 'secure_auth' can't be set to the value of 'NO'
|
|
'#-------------------FN_DYNVARS_143_05----------------------------#'
|
|
SET @@session.secure_auth = 0;
|
|
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SET @@secure_auth = 0;
|
|
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SET @@local.secure_auth = 0;
|
|
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
|
|
SELECT @@session.secure_auth;
|
|
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable
|
|
SELECT @@local.secure_auth;
|
|
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable
|
|
'#----------------------FN_DYNVARS_143_06------------------------#'
|
|
SELECT count(VARIABLE_VALUE)
|
|
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
|
WHERE VARIABLE_NAME='secure_auth';
|
|
count(VARIABLE_VALUE)
|
|
1
|
|
'#----------------------FN_DYNVARS_143_07------------------------#'
|
|
SELECT IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
|
WHERE VARIABLE_NAME='secure_auth';
|
|
IF(@@global.secure_auth, "ON", "OFF") = VARIABLE_VALUE
|
|
1
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
1
|
|
SELECT VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
|
WHERE VARIABLE_NAME='secure_auth';
|
|
VARIABLE_VALUE
|
|
ON
|
|
'#---------------------FN_DYNVARS_143_08-------------------------#'
|
|
SET @@global.secure_auth = OFF;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
0
|
|
SET @@global.secure_auth = ON;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
1
|
|
'#---------------------FN_DYNVARS_143_09----------------------#'
|
|
SET @@global.secure_auth = TRUE;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
1
|
|
SET @@global.secure_auth = FALSE;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
0
|
|
SET @@global.secure_auth = @global_start_value;
|
|
SELECT @@global.secure_auth;
|
|
@@global.secure_auth
|
|
0
|