mariadb/mysql-test/suite/sys_vars/r/auto_commit_basic.result
Staale Smedseng 5eb71aca21 This is a backport of the two patches for Bug #28299:
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.
2009-10-09 15:34:07 +02:00

117 lines
3.9 KiB
Text

SET @start_value = @@autocommit;
SELECT @start_value;
@start_value
1
'#--------------------FN_DYNVARS_003_01------------------------#'
SET @@autocommit = 0;
SET @@autocommit = DEFAULT;
SELECT @@autocommit;
@@autocommit
0
'Bug: variable DEFAULT value not working and is not throwing error'
'#---------------------FN_DYNVARS_003_02-------------------------#'
SET @@autocommit = @start_value;
SELECT @@autocommit = 1;
@@autocommit = 1
1
'#--------------------FN_DYNVARS_003_03------------------------#'
SET @@autocommit = 0;
SELECT @@autocommit;
@@autocommit
0
SET @@autocommit = 1;
SELECT @@autocommit;
@@autocommit
1
'#--------------------FN_DYNVARS_003_04-------------------------#'
SET @@autocommit = 2;
ERROR 42000: Variable 'autocommit' can't be set to the value of '2'
SET @@autocommit = -1;
ERROR 42000: Variable 'autocommit' can't be set to the value of '-1'
SET @@autocommit = TRUEF;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'TRUEF'
SET @@autocommit = TRUE_F;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'TRUE_F'
SET @@autocommit = FALSE0;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'FALSE0'
SET @@autocommit = OON;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'OON'
SET @@autocommit = ONN;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'ONN'
SET @@autocommit = OOFF;
ERROR 42000: Variable 'autocommit' can't be set to the value of 'OOFF'
SET @@autocommit = 0FF;
ERROR 42000: Variable 'autocommit' can't be set to the value of '0FF'
SET @@autocommit = ' ';
ERROR 42000: Variable 'autocommit' can't be set to the value of ' '
SET @@autocommit = " ";
ERROR 42000: Variable 'autocommit' can't be set to the value of ' '
SET @@autocommit = '';
ERROR 42000: Variable 'autocommit' can't be set to the value of ''
'#-------------------FN_DYNVARS_003_05----------------------------#'
SET @@global.autocommit = 0;
ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
SELECT @@global.autocommit;
ERROR HY000: Variable 'autocommit' is a SESSION variable
'#----------------------FN_DYNVARS_003_06------------------------#'
SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
1
Bug # 34839: Values in variable and information_schema do not match for autocommit
'#----------------------FN_DYNVARS_003_07------------------------#'
SET @@autocommit = 1;
SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='autocommit';
IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
1
'#---------------------FN_DYNVARS_003_08-------------------------#'
SET @@autocommit = OFF;
SELECT @@autocommit;
@@autocommit
0
SET @@autocommit = ON;
SELECT @@autocommit;
@@autocommit
1
'#---------------------FN_DYNVARS_003_09----------------------#'
SET @@autocommit = TRUE;
SELECT @@autocommit;
@@autocommit
1
SET @@autocommit = FALSE;
SELECT @@autocommit;
@@autocommit
0
'#---------------------FN_DYNVARS_003_10----------------------#'
SET @@autocommit = 0;
SELECT @@autocommit = @@local.autocommit;
@@autocommit = @@local.autocommit
1
SELECT @@local.autocommit = @@session.autocommit;
@@local.autocommit = @@session.autocommit
1
SET @@autocommit = 1;
SELECT @@autocommit = @@local.autocommit;
@@autocommit = @@local.autocommit
1
SELECT @@session.autocommit = @@autocommit;
@@session.autocommit = @@autocommit
1
'#---------------------FN_DYNVARS_003_11----------------------#'
SET autocommit = 1;
SELECT @@autocommit;
@@autocommit
1
SELECT local.autocommit;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.autocommit;
ERROR 42S02: Unknown table 'session' in field list
SELECT autocommit = @@session.autocommit;
ERROR 42S22: Unknown column 'autocommit' in 'field list'
SET @@autocommit = @start_value;
SELECT @@autocommit;
@@autocommit
1