mirror of
https://github.com/MariaDB/server.git
synced 2025-12-18 10:22:14 +03:00
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.
104 lines
3.8 KiB
Plaintext
104 lines
3.8 KiB
Plaintext
SET @start_value = @@big_tables;
|
|
SELECT @start_value;
|
|
@start_value
|
|
0
|
|
'#--------------------FN_DYNVARS_005_01------------------------#'
|
|
SET @@big_tables = 1;
|
|
SET @@big_tables = DEFAULT;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
1
|
|
'Bug# 34829: No default value for variable and setting default does not raise error';
|
|
'#--------------------FN_DYNVARS_005_02------------------------#'
|
|
SET @@big_tables = 0;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
0
|
|
SET @@big_tables = 1;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
1
|
|
'#--------------------FN_DYNVARS_005_03-------------------------#'
|
|
SET @@big_tables = 2;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of '2'
|
|
SET @@big_tables = -1;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of '-1'
|
|
SET @@big_tables = TRUEF;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of 'TRUEF'
|
|
SET @@big_tables = TRUE_F;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of 'TRUE_F'
|
|
SET @@big_tables = FALSE0;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of 'FALSE0'
|
|
SET @@big_tables = OON;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of 'OON'
|
|
SET @@big_tables = ONN;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of 'ONN'
|
|
SET @@big_tables = OOFF;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of 'OOFF'
|
|
SET @@big_tables = 0FF;
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of '0FF'
|
|
SET @@big_tables = ' ';
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of ' '
|
|
SET @@big_tables = " ";
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of ' '
|
|
SET @@big_tables = '';
|
|
ERROR 42000: Variable 'big_tables' can't be set to the value of ''
|
|
'#-------------------FN_DYNVARS_005_04----------------------------#'
|
|
SET @@global.big_tables = 0;
|
|
ERROR HY000: Variable 'big_tables' is a SESSION variable and can't be used with SET GLOBAL
|
|
SELECT @@global.big_tables;
|
|
ERROR HY000: Variable 'big_tables' is a SESSION variable
|
|
'#----------------------FN_DYNVARS_005_05------------------------#'
|
|
SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
|
|
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
|
WHERE VARIABLE_NAME='big_tables';
|
|
IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
|
|
1
|
|
Bug # 34839: Values in variable and information_schema do not match for autocommit
|
|
'#---------------------FN_DYNVARS_005_06----------------------#'
|
|
SET @@big_tables = OFF;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
0
|
|
SET @@big_tables = ON;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
1
|
|
'#---------------------FN_DYNVARS_005_07----------------------#'
|
|
SET @@big_tables = TRUE;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
1
|
|
SET @@big_tables = FALSE;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
0
|
|
'#---------------------FN_DYNVARS_005_08----------------------#'
|
|
SET @@big_tables = 0;
|
|
SELECT @@big_tables = @@session.big_tables;
|
|
@@big_tables = @@session.big_tables
|
|
1
|
|
SET @@big_tables = 1;
|
|
SELECT @@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables;
|
|
@@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables
|
|
1
|
|
'#---------------------FN_DYNVARS_005_09----------------------#'
|
|
SET big_tables = 1;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
1
|
|
SET local.big_tables = 1;
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'big_tables = 1' at line 1
|
|
SELECT local.big_tables;
|
|
ERROR 42S02: Unknown table 'local' in field list
|
|
SET session.big_tables = 1;
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'big_tables = 1' at line 1
|
|
SELECT session.big_tables;
|
|
ERROR 42S02: Unknown table 'session' in field list
|
|
select big_tables;
|
|
ERROR 42S22: Unknown column 'big_tables' in 'field list'
|
|
SET @@big_tables = @start_value;
|
|
SELECT @@big_tables;
|
|
@@big_tables
|
|
0
|