2009-12-22 10:35:56 +01:00
|
|
|
SET @start_value = @@global.autocommit;
|
2008-04-10 15:14:28 +02:00
|
|
|
SELECT @start_value;
|
|
|
|
@start_value
|
|
|
|
1
|
|
|
|
'#--------------------FN_DYNVARS_003_01------------------------#'
|
|
|
|
SET @@autocommit = 0;
|
|
|
|
SET @@autocommit = DEFAULT;
|
|
|
|
SELECT @@autocommit;
|
|
|
|
@@autocommit
|
2009-12-22 10:35:56 +01:00
|
|
|
1
|
2008-04-10 15:14:28 +02:00
|
|
|
'#---------------------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;
|
|
|
|
SELECT @@global.autocommit;
|
2009-12-22 10:35:56 +01:00
|
|
|
@@global.autocommit
|
|
|
|
0
|
|
|
|
SET @@global.autocommit = 1;
|
2008-04-10 15:14:28 +02:00
|
|
|
'#----------------------FN_DYNVARS_003_06------------------------#'
|
2009-10-09 15:34:07 +02:00
|
|
|
SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
|
2008-04-10 15:14:28 +02:00
|
|
|
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
|
|
|
WHERE VARIABLE_NAME='autocommit';
|
2009-10-09 15:34:07 +02:00
|
|
|
IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
|
|
|
|
1
|
2008-04-10 15:14:28 +02:00
|
|
|
'#----------------------FN_DYNVARS_003_07------------------------#'
|
|
|
|
SET @@autocommit = 1;
|
2009-10-09 15:34:07 +02:00
|
|
|
SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
|
2008-04-10 15:14:28 +02:00
|
|
|
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
|
|
|
WHERE VARIABLE_NAME='autocommit';
|
2009-10-09 15:34:07 +02:00
|
|
|
IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
|
|
|
|
1
|
2008-04-10 15:14:28 +02:00
|
|
|
'#---------------------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'
|
2009-12-22 10:35:56 +01:00
|
|
|
SET @@global.autocommit = @start_value;
|
|
|
|
SELECT @@global.autocommit;
|
|
|
|
@@global.autocommit
|
2008-04-10 15:14:28 +02:00
|
|
|
1
|