Commit 88451eac authored by hhunger@hh-nb.hungers's avatar hhunger@hh-nb.hungers

Merge hh-nb.hungers:/work/trees/mysql-5.1-build-src-clean

into  hh-nb.hungers:/work/merge/mysql-5.1-build
parents 7a413660 afd90d61
......@@ -1287,6 +1287,8 @@ mysql-test/funcs_1.tar
mysql-test/gmon.out
mysql-test/install_test_db
mysql-test/lib/init_db.sql
mysql-test/linux_sys_vars.inc
mysql-test/load_sysvars.inc
mysql-test/mtr
mysql-test/mysql-test-run
mysql-test/mysql-test-run-shell
......@@ -1399,6 +1401,7 @@ mysql-test/t/index_merge.load
mysql-test/t/tmp.test
mysql-test/var
mysql-test/var/*
mysql-test/windows_sys_vars.inc
mysql.kdevprj
mysql.proj
mysql_priv.h
......
#
# This auxiliary script is used by character set test cases.
#
eval SET $charset_variable = big5;
eval SELECT $charset_variable;
eval SET $charset_variable = dec8;
eval SELECT $charset_variable;
eval SET $charset_variable = cp850;
eval SELECT $charset_variable;
eval SET $charset_variable = hp8;
eval SELECT $charset_variable;
eval SET $charset_variable = koi8r;
eval SELECT $charset_variable;
eval SET $charset_variable = latin1;
eval SELECT $charset_variable;
eval SET $charset_variable = latin2;
eval SELECT $charset_variable;
eval SET $charset_variable = swe7;
eval SELECT $charset_variable;
eval SET $charset_variable = ascii;
eval SELECT $charset_variable;
eval SET $charset_variable = ujis;
eval SELECT $charset_variable;
eval SET $charset_variable = sjis;
eval SELECT $charset_variable;
eval SET $charset_variable = hebrew;
eval SELECT $charset_variable;
eval SET $charset_variable = tis620;
eval SELECT $charset_variable;
eval SET $charset_variable = euckr;
eval SELECT $charset_variable;
eval SET $charset_variable = koi8u;
eval SELECT $charset_variable;
eval SET $charset_variable = gb2312;
eval SELECT $charset_variable;
eval SET $charset_variable = greek;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1250;
eval SELECT $charset_variable;
eval SET $charset_variable = gbk;
eval SELECT $charset_variable;
eval SET $charset_variable = latin5;
eval SELECT $charset_variable;
eval SET $charset_variable = armscii8;
eval SELECT $charset_variable;
eval SET $charset_variable = utf8;
eval SELECT $charset_variable;
# Error with Linux
--error 0,ER_WRONG_VALUE_FOR_VAR
eval SET $charset_variable = ucs2;
eval SELECT $charset_variable;
eval SET $charset_variable = cp866;
eval SELECT $charset_variable;
eval SET $charset_variable = keybcs2;
eval SELECT $charset_variable;
eval SET $charset_variable = macce;
eval SELECT $charset_variable;
eval SET $charset_variable = macroman;
eval SELECT $charset_variable;
eval SET $charset_variable = cp852;
eval SELECT $charset_variable;
eval SET $charset_variable = latin7;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1251;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1256;
eval SELECT $charset_variable;
eval SET $charset_variable = cp1257;
eval SELECT $charset_variable;
eval SET $charset_variable = binary;
eval SELECT $charset_variable;
eval SET $charset_variable = geostd8;
eval SELECT $charset_variable;
eval SET $charset_variable = cp932;
eval SELECT $charset_variable;
eval SET $charset_variable = eucjpms;
eval SELECT $charset_variable;
This diff is collapsed.
#
# This file contains default,min and max values for sys variables for redhat linux
#
--disable_query_log
SET @default_flush_time = 0;
SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size = 131072;
SET @min_key_buffer_size = 36;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
#SET @max_join_buffer_size = 4294967295;
SET @default_max_join_size = 4294967295;
SET @min_max_join_size = 1;
SET @max_max_join_size = 4294967295;
SET @default_sql_max_join_size = 4294967295;
SET @min_sql_max_join_size = 1;
SET @max_sql_max_join_size = 4294967295;
SET @default_sql_select_limit = 4294967295;
SET @min_sql_select_limit = 0;
SET @max_sql_select_limit = 4294967295;
SET @default_wait_timeout= 28800;
SET @min_wait_timeout= 1;
SET @max_wait_timeout= 31536000;
--enable_query_log
#
# This script is included by every test to include system dependant variables'
# default, minimum and maximum values
#
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows")`)
{
--source include/windows_sys_vars.inc
}
if (`select convert(@@version_compile_os using latin1) IN ("suse-linux-gnu","redhat-linux-gnu","pc-solaris2.10")`)
{
--source include/linux_sys_vars.inc
}
#
# This file contains default,min and max values for sys variables for windows
#
--disable_query_log
SET @default_flush_time = 1800;
SET @min_flush_time = 0;
#SET @max_flush_time = 0;
SET @default_key_buffer_size= 131072;
SET @min_key_buffer_size= 8;
#SET @default_join_buffer_size = 131072;
#SET @min_join_buffer_size = 8200;
#SET @max_join_buffer_size = 4294967295;
SET @default_max_join_size = 4294967295;
SET @min_max_join_size = 1;
SET @max_max_join_size = 4294967295;
SET @default_sql_max_join_size = 4294967295;
SET @min_sql_max_join_size = 1;
SET @max_sql_max_join_size = 4294967295;
SET @default_sql_select_limit = 4294967295;
SET @min_sql_select_limit = 0;
SET @max_sql_select_limit = 4294967295;
let $default_wait_timeout = 28800;
let $min_wait_timeout = 1;
let $max_wait_timeout = 2147483;
--enable_query_log
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 @@session.autocommit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='autocommit';
@@session.autocommit = VARIABLE_VALUE
0
Bug # 34839: Values in variable and information_schema do not match for autocommit
'#----------------------FN_DYNVARS_003_07------------------------#'
SET @@autocommit = 1;
SELECT @@autocommit = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='autocommit';
@@autocommit = VARIABLE_VALUE
0
'#---------------------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
SET @start_global_value = @@global.auto_increment_increment;
SELECT @start_global_value;
@start_global_value
1
SET @start_session_value = @@session.auto_increment_increment;
SELECT @start_session_value;
@start_session_value
1
'#--------------------FN_DYNVARS_001_01-------------------------#'
SET @@global.auto_increment_increment = 100;
SET @@global.auto_increment_increment = DEFAULT;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@session.auto_increment_increment = 200;
SET @@session.auto_increment_increment = DEFAULT;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
'#--------------------FN_DYNVARS_001_02-------------------------#'
SET @@global.auto_increment_increment = DEFAULT;
SELECT @@global.auto_increment_increment = 1;
@@global.auto_increment_increment = 1
1
SET @@session.auto_increment_increment = DEFAULT;
SELECT @@session.auto_increment_increment = 1;
@@session.auto_increment_increment = 1
1
'#--------------------FN_DYNVARS_001_03-------------------------#'
SET @@global.auto_increment_increment = 1;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = 60020;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
60020
SET @@global.auto_increment_increment = 65535;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@session.auto_increment_increment = 1;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = 50050;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
50050
SET @@session.auto_increment_increment = 65535;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
'#------------------FN_DYNVARS_001_05-----------------------#'
SET @@global.auto_increment_increment = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = 65536;
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '65536'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
SET @@global.auto_increment_increment = 65530.34.;
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 '.' at line 1
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
SET @@global.auto_increment_increment = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
65535
SET @@session.auto_increment_increment = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @@session.auto_increment_increment = 65530.34.;
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 '.' at line 1
SET @@session.auto_increment_increment = 65550;
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '65550'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.auto_increment_increment = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_increment'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
65535
'#------------------FN_DYNVARS_001_06-----------------------#'
SELECT @@global.auto_increment_increment = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='auto_increment_increment';
@@global.auto_increment_increment = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_001_07-----------------------#'
SELECT @@session.auto_increment_increment = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='auto_increment_increment';
@@session.auto_increment_increment = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_001_08-----------------------#'
SET @@global.auto_increment_increment = TRUE;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@global.auto_increment_increment = FALSE;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.auto_increment_increment = 10;
SET @@session.auto_increment_increment = 11;
SELECT @@auto_increment_increment = @@global.auto_increment_increment;
@@auto_increment_increment = @@global.auto_increment_increment
0
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@auto_increment_increment = 100;
SELECT @@auto_increment_increment = @@local.auto_increment_increment;
@@auto_increment_increment = @@local.auto_increment_increment
1
SELECT @@local.auto_increment_increment = @@session.auto_increment_increment;
@@local.auto_increment_increment = @@session.auto_increment_increment
1
'#---------------------FN_DYNVARS_001_11----------------------#'
SET auto_increment_increment = 1;
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
SELECT local.auto_increment_increment;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.auto_increment_increment;
ERROR 42S02: Unknown table 'session' in field list
SELECT auto_increment_increment = @@session.auto_increment_increment;
ERROR 42S22: Unknown column 'auto_increment_increment' in 'field list'
SET @@global.auto_increment_increment = @start_global_value;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
SET @@session.auto_increment_increment = @start_session_value;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
SET @global_auto_increment_increment = @@global.auto_increment_increment;
SET @session_auto_increment_increment = @@session.auto_increment_increment;
SET @global_auto_increment_offset = @@global.auto_increment_offset;
SET @session_auto_increment_offset = @@session.auto_increment_offset;
drop table if exists t1;
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_001_01-------------------------#'
## Setting initial value of auto_increment_increment to 5 ##
SET @@auto_increment_increment = 5;
'#--------------------FN_DYNVARS_001_02-------------------------#'
## Inserting first record in table to check behavior of the variable ##
INSERT into t1(name) values('Record_1');
SELECT * from t1;
id name
1 Record_1
## Changing value of variable to 10 ##
SET @@global.auto_increment_increment = 10;
## Inserting record and verifying value of column id ##
INSERT into t1(name) values('Record_2');
SELECT * from t1;
id name
1 Record_1
6 Record_2
## Test behavior of variable after assigning some larger value to it ##
SELECT @@auto_increment_increment;
@@auto_increment_increment
5
SET @@auto_increment_increment = 100;
INSERT into t1(name) values('Record_5');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
'#--------------------FN_DYNVARS_001_03-------------------------#'
## Creating new connection test_con1 ##
## Value of session & global vairable here should be 10 ##
SELECT @@global.auto_increment_increment = 10;
@@global.auto_increment_increment = 10
1
SELECT @@session.auto_increment_increment = 10;
@@session.auto_increment_increment = 10
1
## Setting global value of variable and inserting data in table ##
SET @@global.auto_increment_increment = 20;
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
20
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
## Setting session value of variable and inserting data in table ##
SET @@session.auto_increment_increment = 2;
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
2
INSERT into t1(name) values('Record_8');
INSERT into t1(name) values('Record_9');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
'#--------------------FN_DYNVARS_001_04-------------------------#'
## Creating another new connection test_con2 ##
## Verifying initial values of variable in global & session scope ##
## global & session initial value should be 20 ##
SELECT @@global.auto_increment_increment = 20;
@@global.auto_increment_increment = 20
1
SELECT @@session.auto_increment_increment = 20;
@@session.auto_increment_increment = 20
1
## Setting value of session variable to 5 and verifying its behavior ##
SET @@session.auto_increment_increment = 5;
INSERT into t1(name) values('Record_10');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
'Bug#35362: Here Record_10 id should be 120 instead of 115 because we'
'have set the value of variable to 5'
SET @@session.auto_increment_increment = 1;
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
20
'#--------------------FN_DYNVARS_001_05-------------------------#'
## Switching to test_con1 ##
## Verifying values of global & session value of variable ##
## global value should be 20 ##
SELECT @@global.auto_increment_increment = 20;
@@global.auto_increment_increment = 20
1
## session value should be 2 ##
SELECT @@session.auto_increment_increment = 2;
@@session.auto_increment_increment = 2
1
INSERT into t1(name) values('Record_11');
INSERT into t1(name) values('Record_12');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
'#--------------------FN_DYNVARS_001_06-------------------------#'
## Changing column's datatype to SmallInt and verifying variable's behavior ##
ALTER table t1 MODIFY id SMALLINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_13');
INSERT into t1(name) values('Record_14');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
121 Record_13
123 Record_14
## Changing column's datatype to BigInt and verifying variable's behavior ##
ALTER table t1 MODIFY id BIGINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_15');
INSERT into t1(name) values('Record_16');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
121 Record_13
123 Record_14
125 Record_15
127 Record_16
'#--------------------FN_DYNVARS_001_07-------------------------#'
## Verifying behavior of variable with negative value ##
SET @@auto_increment_increment = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-increment value: '0'
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
id name
1 Record_1
6 Record_2
101 Record_5
111 Record_6
113 Record_8
115 Record_9
116 Record_10
117 Record_11
119 Record_12
121 Record_13
123 Record_14
125 Record_15
127 Record_16
128 Record_17
129 Record_18
'Bug#35364: Variable is incrementing some random values on assigning -ve value'
## Disconnecting test_con2 ##
## Dropping table t1 ##
DROP table if exists t1;
## Disconnecting test_con1 ##
## switching to default connection ##
SET @@global.auto_increment_increment = @global_auto_increment_increment;
SET @@session.auto_increment_increment = @session_auto_increment_increment;
SET @@global.auto_increment_offset = @global_auto_increment_offset;
SET @@session.auto_increment_offset = @session_auto_increment_offset;
SET @start_global_value = @@global.auto_increment_offset;
SELECT @start_global_value;
@start_global_value
1
SET @start_session_value = @@session.auto_increment_offset;
SELECT @start_session_value;
@start_session_value
1
'#--------------------FN_DYNVARS_002_01-------------------------#'
SET @@global.auto_increment_offset = 100;
SET @@global.auto_increment_offset = DEFAULT;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@session.auto_increment_offset = 200;
SET @@session.auto_increment_offset = DEFAULT;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
'#--------------------FN_DYNVARS_002_02-------------------------#'
SET @@global.auto_increment_offset = @start_global_value;
SELECT @@global.auto_increment_offset = 1;
@@global.auto_increment_offset = 1
1
SET @@session.auto_increment_offset = @start_session_value;
SELECT @@session.auto_increment_offset = 1;
@@session.auto_increment_offset = 1
1
'#--------------------FN_DYNVARS_002_03-------------------------#'
SET @@global.auto_increment_offset = 1;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = 60020;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
60020
SET @@global.auto_increment_offset = 65535;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
'#--------------------FN_DYNVARS_002_04-------------------------#'
SET @@session.auto_increment_offset = 1;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = 50050;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
50050
SET @@session.auto_increment_offset = 65535;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
'#------------------FN_DYNVARS_002_05-----------------------#'
SET @@global.auto_increment_offset = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = -1024;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = 65536;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '65536'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@global.auto_increment_offset = ON;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@global.auto_increment_offset = OFF;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@global.auto_increment_offset = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
65535
SET @@session.auto_increment_offset = 0;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = -2;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @@session.auto_increment_offset = 65550;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '65550'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
'Bug # 34837: Errors are not coming on assigning invalid values to variable'
SET @@session.auto_increment_offset = ON;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
SET @@session.auto_increment_offset = OFF;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
SET @@session.auto_increment_offset = test;
ERROR 42000: Incorrect argument type to variable 'auto_increment_offset'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
65535
'#------------------FN_DYNVARS_002_06-----------------------#'
SELECT @@global.auto_increment_offset = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='auto_increment_offset';
@@global.auto_increment_offset = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_002_07-----------------------#'
SELECT @@session.auto_increment_offset = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='auto_increment_offset';
@@session.auto_increment_offset = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_002_08-----------------------#'
SET @@global.auto_increment_offset = TRUE;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@global.auto_increment_offset = FALSE;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.auto_increment_offset = 10;
SET @@session.auto_increment_offset = 11;
SELECT @@auto_increment_offset = @@global.auto_increment_offset;
@@auto_increment_offset = @@global.auto_increment_offset
0
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@auto_increment_offset = 100;
SELECT @@auto_increment_offset = @@local.auto_increment_offset;
@@auto_increment_offset = @@local.auto_increment_offset
1
SELECT @@local.auto_increment_offset = @@session.auto_increment_offset;
@@local.auto_increment_offset = @@session.auto_increment_offset
1
'#---------------------FN_DYNVARS_001_11----------------------#'
SET auto_increment_offset = 1;
SELECT @@auto_increment_offset;
@@auto_increment_offset
1
SELECT local.auto_increment_offset;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.auto_increment_offset;
ERROR 42S02: Unknown table 'session' in field list
SELECT auto_increment_offset = @@session.auto_increment_offset;
ERROR 42S22: Unknown column 'auto_increment_offset' in 'field list'
SET @@global.auto_increment_offset = @start_global_value;
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
SET @@session.auto_increment_offset = @start_session_value;
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
SET @global_auto_increment_increment = @@global.auto_increment_increment;
SET @session_auto_increment_increment = @@session.auto_increment_increment;
SET @global_auto_increment_offset = @@global.auto_increment_offset;
SET @session_auto_increment_offset = @@session.auto_increment_offset;
drop table if exists t1;
## Creating New Table ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_002_01-------------------------#'
## Setting initial value of variable to 5 ##
SET @@auto_increment_increment = 10;
SET @@auto_increment_offset = 5;
'#--------------------FN_DYNVARS_002_02-------------------------#'
## Inserting records in table and verifying variable's behavior ##
INSERT into t1(name) values('Record_1');
SELECT * from t1;
id name
5 Record_1
INSERT into t1(name) values('Record_2');
SELECT * from t1;
id name
5 Record_1
15 Record_2
## Test behavior of variable after updating value of variable ##
SET @@auto_increment_offset = 24;
SELECT @@auto_increment_offset;
@@auto_increment_offset
24
INSERT into t1(name) values('Record_3');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
INSERT into t1(name) values('Record_4');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
'#--------------------FN_DYNVARS_002_03-------------------------#'
## Changing value of global scope before opening new connection ##
SET @@global.auto_increment_increment = 15;
SET @@global.auto_increment_offset = 36;
## New connection test_con1 ##
## Value of session & global vairable here should be 10 ##
SELECT @@global.auto_increment_offset = 36;
@@global.auto_increment_offset = 36
1
SELECT @@session.auto_increment_offset = 36;
@@session.auto_increment_offset = 36
1
## Verify global value effect of variable by inserting new rows in table ##
INSERT into t1(name) values('Record_5');
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
## Setting session value of variable and inserting data in table ##
SET @@session.auto_increment_offset = 54;
INSERT into t1(name) values('Record_7');
INSERT into t1(name) values('Record_8');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
'#--------------------FN_DYNVARS_002_04-------------------------#'
## Setting value of variable less than last insert id ##
SET @@session.auto_increment_offset = 5;
INSERT into t1(name) values('Record_9');
'Bug#35367: Random value of id is increasing on assigning value to';
'variable that is less than current offset';
INSERT into t1(name) values('Record_10');
INSERT into t1(name) values('Record_11');
INSERT into t1(name) values('Record_12');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
'#--------------------FN_DYNVARS_002_05-------------------------#'
## Assigning value to variable greater than auto_increment_incrent value ##
SET @@auto_increment_offset = 140;
SET @@auto_increment_increment = 10;
INSERT into t1(name) values('Record_13');
INSERT into t1(name) values('Record_14');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
'Bug#35369: Some invalid value of id is increasing on assigning value to';
'variable that is greater than auto_increment_increment';
'#--------------------FN_DYNVARS_002_06-------------------------#'
## Changing datatype of column id with primary key to SmallInt ##
ALTER table t1 modify id SMALLINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_15');
INSERT into t1(name) values('Record_16');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
## Changing datatype of column id with primary key to BigInt ##
ALTER table t1 modify id BIGINT NOT NULL auto_increment;
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
170 Record_17
180 Record_18
'#--------------------FN_DYNVARS_002_07-------------------------#'
## Assigning -ve value to variable ##
SET @@auto_increment_offset = -10;
Warnings:
Warning 1292 Truncated incorrect auto-increment-offset value: '0'
SELECT @@auto_increment_offset = -10;
@@auto_increment_offset = -10
0
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
170 Record_17
180 Record_18
181 Record_17
191 Record_18
'Bug#35370: Some invalid value of id is increasing on assigning negative';
' value in variable';
## Assigning value that is out of range of variable ##
SET @@auto_increment_offset = 65536;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '65536'
SELECT @@auto_increment_offset;
@@auto_increment_offset
65535
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
INSERT into t1(name) values('Record_19');
INSERT into t1(name) values('Record_20');
SELECT * from t1;
id name
5 Record_1
15 Record_2
24 Record_3
34 Record_4
36 Record_5
51 Record_6
54 Record_7
69 Record_8
80 Record_9
95 Record_10
110 Record_11
125 Record_12
134 Record_13
140 Record_14
150 Record_15
160 Record_16
170 Record_17
180 Record_18
181 Record_17
191 Record_18
199 Record_17
209 Record_18
219 Record_19
229 Record_20
## No effect of auto_increment_offset since value of this variable is greater ##
## than auto_increment_increment ##
## Dropping table ##
DROP table if exists t1;
## Disconnecting connection ##
## switching to default connection ##
SET @@global.auto_increment_increment = @global_auto_increment_increment;
SET @@session.auto_increment_increment = @session_auto_increment_increment;
SET @@global.auto_increment_offset = @global_auto_increment_offset;
SET @@session.auto_increment_offset = @session_auto_increment_offset;
drop table if exists t1;
## Creating new table ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name varchar(30)
) ENGINE = INNODB;
'#--------------------FN_DYNVARS_003_01-------------------------#'
## Setting variable's value to 0 i.e false ##
SET @@autocommit = 0;
'#--------------------FN_DYNVARS_003_02-------------------------#'
## Creating new connection ##
## Checking value of variable after opening new connection ##
SELECT @@autocommit;
@@autocommit
1
## Setting value of variable to zero and inserting some rows ##
SET @@autocommit = 0;
INSERT into t1(name) values('Record_1');
INSERT into t1(name) values('Record_2');
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Creating another connection and verifying records in table ##
## New Connection test_con2 ##
SELECT * from t1;
id name
'#--------------------FN_DYNVARS_003_03-------------------------#'
## Verifying behavior of variable by commiting rows in test_con1 ##
## Connecting with connection # 01 ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
COMMIT;
## New Connection test_con2 ##
## Now verifying records in table from connection # 02 ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
'#--------------------FN_DYNVARS_003_04-------------------------#'
## Connecting to connection # 01 ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Updating value of first row ##
UPDATE t1 set name = 'Record_12' where name = 'Record_1';
SELECT * from t1;
id name
1 Record_12
2 Record_2
## Connecting to connecting # 02 and verifying effect of update query ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Now connecting with connection # 01 and using ROLLBACK after it ##
ROLLBACK;
SELECT * from t1;
id name
1 Record_1
2 Record_2
'#--------------------FN_DYNVARS_003_05-------------------------#'
## Connecting with connection # 01 ##
INSERT into t1(name) values('Record_3');
## Connection test_con2 ##
## Now verifying records in table from connection # 02 and changing value ##
## of autocommit to true ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
SET @@autocommit = 1;
INSERT into t1(name) values('Record_4');
INSERT into t1(name) values('Record_5');
SELECT * from t1;
id name
1 Record_1
2 Record_2
4 Record_4
5 Record_5
## Connecting with connection # 01 and inserting few records ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
3 Record_3
'Bug#35373: Records donot get committed in transaction on switching connections'
INSERT into t1(name) values('Record_6');
SELECT * from t1;
id name
1 Record_1
2 Record_2
3 Record_3
6 Record_6
## Now verifying the effect of these new records in second connection ##
SELECT * from t1;
id name
1 Record_1
2 Record_2
4 Record_4
5 Record_5
## Dropping table t1 ##
DROP table t1;
## Disconnecting both connections ##
SET @start_value = @@global.automatic_sp_privileges;
SELECT @start_value;
@start_value
1
'#--------------------FN_DYNVARS_004_01------------------------#'
SET @@global.automatic_sp_privileges = 0;
SET @@global.automatic_sp_privileges = DEFAULT;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
'#---------------------FN_DYNVARS_004_02-------------------------#'
SET @@global.automatic_sp_privileges = @start_value;
SELECT @@global.automatic_sp_privileges = TRUE;
@@global.automatic_sp_privileges = TRUE
1
'#--------------------FN_DYNVARS_004_03------------------------#'
SET @@global.automatic_sp_privileges = 0;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
0
SET @@global.automatic_sp_privileges = 1;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
'#--------------------FN_DYNVARS_004_04-------------------------#'
SET @@global.automatic_sp_privileges = 2;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of '2'
SET @@global.automatic_sp_privileges = -1;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of '-1'
SET @@global.automatic_sp_privileges = TRUEF;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'TRUEF'
SET @@global.automatic_sp_privileges = TRUE_F;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'TRUE_F'
SET @@global.automatic_sp_privileges = FALSE0;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'FALSE0'
SET @@global.automatic_sp_privileges = OON;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'OON'
SET @@global.automatic_sp_privileges = ONN;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'ONN'
SET @@global.automatic_sp_privileges = OOFF;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of 'OOFF'
SET @@global.automatic_sp_privileges = 0FF;
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of '0FF'
SET @@global.automatic_sp_privileges = ' ';
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of ' '
SET @@global.automatic_sp_privileges = " ";
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of ' '
SET @@global.automatic_sp_privileges = '';
ERROR 42000: Variable 'automatic_sp_privileges' can't be set to the value of ''
'#-------------------FN_DYNVARS_004_05----------------------------#'
SET @@session.automatic_sp_privileges = 1;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@session.automatic_sp_privileges;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable
'#----------------------FN_DYNVARS_004_06------------------------#'
SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='automatic_sp_privileges';
@@global.automatic_sp_privileges = VARIABLE_VALUE
0
'Bug# 34839: Values in variable and information_schema donot match'
'#---------------------FN_DYNVARS_004_07----------------------#'
SET @@global.automatic_sp_privileges = OFF;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
0
SET @@global.automatic_sp_privileges = ON;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
'#---------------------FN_DYNVARS_004_08----------------------#'
SET @@global.automatic_sp_privileges = TRUE;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
SET @@global.automatic_sp_privileges = FALSE;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
0
'#---------------------FN_DYNVARS_004_09----------------------#'
SET @@global.automatic_sp_privileges = 1;
SELECT @@automatic_sp_privileges = @@global.automatic_sp_privileges;
@@automatic_sp_privileges = @@global.automatic_sp_privileges
1
'#---------------------FN_DYNVARS_004_10----------------------#'
SET automatic_sp_privileges = 1;
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should be set with SET GLOBAL
SET local.automatic_sp_privileges = 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 'automatic_sp_privileges = 1' at line 1
SELECT local.automatic_sp_privileges;
ERROR 42S02: Unknown table 'local' in field list
SET global.automatic_sp_privileges = 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 'automatic_sp_privileges = 1' at line 1
SELECT global.automatic_sp_privileges;
ERROR 42S02: Unknown table 'global' in field list
SELECT automatic_sp_privileges = @@session.automatic_sp_privileges;
ERROR 42S22: Unknown column 'automatic_sp_privileges' in 'field list'
SET @@global.automatic_sp_privileges = @start_value;
SELECT @@global.automatic_sp_privileges;
@@global.automatic_sp_privileges
1
** Setup **
SET @global_automatic_sp_privileges = @@GLOBAL.automatic_sp_privileges;
CREATE TABLE t1 (a varchar(200));
INSERT INTO t1 VALUES('Procedure Executed.');
CREATE USER 'userTest'@'localhost';
CREATE USER 'userTest1'@'localhost';
** Connection default **
SET GLOBAL automatic_sp_privileges = TRUE;
** Connecting using userTest **
** Connection conUser **
CREATE PROCEDURE testProc ()
BEGIN
SELECT * FROM t1;
END;|
CALL testProc();
a
Procedure Executed.
Expecting SELECT executed
** Connection default**
SET GLOBAL automatic_sp_privileges = FALSE;
** Connecting using userTest1 **
** Connection conUser1 **
CREATE PROCEDURE testProc1 ()
BEGIN
SELECT * FROM t1;
END;|
Expected error access denied
CALL testProc1();
ERROR 42000: execute command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
Expected error access denied
ALTER PROCEDURE testProc1 COMMENT 'My Comment';
ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
Expected error access denied
DROP PROCEDURE testProc1;
ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
** Connection default **
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE testProc1 TO 'userTest1'@'localhost';
** Connection conUser1 **
CALL testProc1();
a
Procedure Executed.
Expecting seelect executed
ALTER PROCEDURE testProc1 COMMENT 'My Comment';
** Cleanup **
** Connection default **
disconnecting connections
SET GLOBAL automatic_sp_privileges = @global_automatic_sp_privileges;
REVOKE EXECUTE, ALTER ROUTINE ON PROCEDURE testProc FROM 'userTest'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest1'@'localhost';
DROP PROCEDURE testProc;
DROP PROCEDURE testProc1;
DROP USER 'userTest'@'localhost';
DROP USER 'userTest1'@'localhost';
DROP TABLE t1;
'#---------------------BS_STVARS_001_01----------------------#'
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
'#---------------------BS_STVARS_001_02----------------------#'
SET @@GLOBAL.basedir=1;
ERROR HY000: Variable 'basedir' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
'#---------------------BS_STVARS_001_03----------------------#'
SELECT @@GLOBAL.basedir = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='basedir';
@@GLOBAL.basedir = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='basedir';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_001_04----------------------#'
SELECT @@basedir = @@GLOBAL.basedir;
@@basedir = @@GLOBAL.basedir
1
1 Expected
'#---------------------BS_STVARS_001_05----------------------#'
SELECT COUNT(@@basedir);
COUNT(@@basedir)
1
1 Expected
SELECT COUNT(@@local.basedir);
ERROR HY000: Variable 'basedir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.basedir);
ERROR HY000: Variable 'basedir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.basedir);
COUNT(@@GLOBAL.basedir)
1
1 Expected
SELECT basedir = @@SESSION.basedir;
ERROR 42S22: Unknown column 'basedir' in 'field list'
Expected error 'Readonly variable'
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 @@big_tables = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='big_tables';
@@big_tables = VARIABLE_VALUE
0
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
'#---------------------BS_STVARS_002_01----------------------#'
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
'#---------------------BS_STVARS_002_02----------------------#'
SET @@GLOBAL.binlog_format=1;
Expected error 'Read only variable'
Bug: Writeable static variable
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SET @@SESSION.binlog_format=1;
Expected error 'Read only variable'
Bug: Writeable static variable
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
'#---------------------BS_STVARS_002_03----------------------#'
SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
@@GLOBAL.binlog_format = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_002_04----------------------#'
SELECT @@SESSION.binlog_format = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
@@SESSION.binlog_format = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='binlog_format';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_002_05----------------------#'
SELECT COUNT(@@binlog_format);
COUNT(@@binlog_format)
1
1 Expected
SELECT COUNT(@@local.binlog_format);
COUNT(@@local.binlog_format)
1
1 Expected
SELECT COUNT(@@SESSION.binlog_format);
COUNT(@@SESSION.binlog_format)
1
1 Expected
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
1
1 Expected
This diff is collapsed.
'#--------------------FN_DYNVARS_010_01-------------------------#'
SET @global_character_set_client = @@global.character_set_client;
SET @session_character_set_client = @@session.character_set_client;
SET @@global.character_set_client = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SELECT @@session.character_set_client;
@@session.character_set_client
latin1
'Bug# 35372: session character_set_client is not effected by global character_set_client'
'#--------------------FN_DYNVARS_010_02-------------------------#'
'connection default'
SHOW VARIABLES like 'character_set_client';
Variable_name Value
character_set_client latin1
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a CHAR(3) character set utf8);
'---verifying character_set_client with a utf8 character----'
'For latin1 characterset';
SET @@session.character_set_client = latin1;
INSERT INTO t1 values('è');
SELECT a,CHAR_LENGTH(a) FROM t1;
a CHAR_LENGTH(a)
è 2
DELETE FROM t1;
'For utf8 characterset';
SET @@session.character_set_client = utf8;
INSERT INTO t1 values('è');
SELECT a,CHAR_LENGTH(a) FROM t1;
a CHAR_LENGTH(a)
 1
DELETE FROM t1;
DROP TABLE IF EXISTS t1;
SET @@global.character_set_client = @global_character_set_client;
SET @@session.character_set_client = @session_character_set_client;
This diff is collapsed.
'#--------------------FN_DYNVARS_011_01-------------------------#'
SET @global_character_set_connection = @@global.character_set_connection;
SET @session_character_set_connection = @@session.character_set_connection;
SET @session_character_set_client = @@session.character_set_client;
SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_connection = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_connection;
@@global.character_set_connection
utf8
SELECT @@session.character_set_connection;
@@session.character_set_connection
utf8
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8);
'--verify that character_set_connection converts character_set_client--'
SET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8;
SET @@session.character_set_connection = latin1;
SELECT 'ЁЂЃЄ' AS utf_text;
utf_text
????
SET @@session.character_set_connection = utf8;
SELECT 'ЁЂЃЄ' AS utf_text;
utf_text
ЁЂЃЄ
'---now inserting utf8 string with different character_set_connection--'
SET @@session.character_set_connection = ascii;
INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1;
b
????
TRUNCATE TABLE t1;
'--now client & results charset in latin1 & connection charset in ascii-'
SET @@session.character_set_connection = ascii;
SET @@session.character_set_client = latin1;
SET @@session.character_set_results = latin1;
INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1;
b
????????
TRUNCATE TABLE t1;
SET NAMES utf8;
INSERT INTO t1 VALUES('ЁЂЃЄ');
SELECT * FROM t1;
b
ЁЂЃЄ
TRUNCATE TABLE t1;
SET @@global.character_set_connection = @global_character_set_connection;
SET @@session.character_set_connection = @session_character_set_connection;
SET @@session.character_set_client = @session_character_set_client;
SET @@session.character_set_results = @session_character_set_results;
This diff is collapsed.
'#--------------------FN_DYNVARS_008_01-------------------------#'
SET @global_character_set_database = @@global.character_set_database;
SET @session_character_set_database = @@session.character_set_database;
SET @session_character_set_server = @@session.character_set_server;
SET @@global.character_set_database = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_database;
@@global.character_set_database
utf8
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
'Bug#35356: session character_set_database differ from global character_set_database'
'#--------------------FN_DYNVARS_008_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
'--check if setting session character_set_database effects new databases'
SET @@session.character_set_server = utf8;
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
SET @@session.character_set_database = latin5;
SELECT @@session.character_set_database;
@@session.character_set_database
latin5
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */
CREATE TABLE t1(a INT, b VARCHAR(40));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(40) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
DROP TABLE t1;
DROP DATABASE db1;
'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set'
'--ascii character set specified--'
CREATE DATABASE db1 CHARACTER SET ascii;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET ascii */
CREATE TABLE t1(a INT, b VARCHAR(40));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` varchar(40) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=ascii
DROP TABLE t1;
DROP DATABASE db1;
'------Check if load data uses character_set_database----------'
USE test;
CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8;
'Verify with latin';
SET @@session.character_set_database = latin1;
LOAD DATA INFILE '../std_data_ln/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
2433
TRUNCATE TABLE t1;
'Verify with utf8';
SET @@session.character_set_database = utf8;
LOAD DATA INFILE '../std_data_ln/charset_utf8.txt' INTO TABLE t1;
SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1;
count(*)
1
DROP TABLE IF EXISTS t1;
SET @@global.character_set_database = @global_character_set_database;
SET @@session.character_set_database = @session_character_set_database;
SET @@session.character_set_server = @session_character_set_server;
This diff is collapsed.
'#--------------------FN_DYNVARS_012_01-------------------------#'
SET @global_character_set_results = @@global.character_set_results;
SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_results = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_results;
@@global.character_set_results
utf8
SELECT @@session.character_set_results;
@@session.character_set_results
utf8
'#--------------------FN_DYNVARS_012_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8);
SET NAMES utf8;
'----check string literals against different character_set_results---'
check if results are converted to character_set_results
SET @@session.character_set_results = greek;
SELECT 'ЁЂЃЄ' AS utf_text;
utf_text
????
check effect of character_set_results when introducers are used
SET @@session.character_set_results = latin1;
SELECT _latin1'Mller' AS latin1_text;
latin1_text
Mller
SET @@session.character_set_results = ascii;
SELECT _latin1'Mller' AS latin1_text;
latin1_text
M?ller
check when we dont want any conversion
SET @@session.character_set_results = NULL;
SELECT 'ЁЂЃЄ' AS utf_text;
utf_text
ЁЂЃЄ
'---check results from table against different character_set_results--'
INSERT INTO t1 VALUES(_utf8'ЁЂЃЄ');
INSERT INTO t1 VALUES('ФХЦЧШ');
SET @@session.character_set_results = NULL;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
ЁЂЃЄ 4
ФХЦЧШ 5
SET @@session.character_set_results = utf8;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
ЁЂЃЄ 4
ФХЦЧШ 5
SET @@session.character_set_results = koi8r;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
??? 4
5
SET @@session.character_set_results = cp1250;
SELECT b, CHAR_LENGTH(b) FROM t1;
b CHAR_LENGTH(b)
???? 4
????? 5
DROP TABLE t1;
'connection default;'
SET @@global.character_set_results = @global_character_set_results;
SET @@session.character_set_results = @session_character_set_results;
This diff is collapsed.
'#--------------------FN_DYNVARS_009_01-------------------------#'
SET @global_character_set_server = @@global.character_set_server;
SET @session_character_set_server = @@session.character_set_server;
SET @@global.character_set_server = utf8;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.character_set_server;
@@global.character_set_server
utf8
SELECT @@session.character_set_server;
@@session.character_set_server
utf8
'#--------------------FN_DYNVARS_009_02-------------------------#'
'connection default'
'---global character_set_server should not effects current connection---'
SET @@global.character_set_server = utf8;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */
DROP DATABASE db1;
select @@character_set_database;
@@character_set_database
latin1
'---session character_set_server should effects current connection---'
SET @@session.character_set_server = utf8;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */
DROP DATABASE db1;
select @@character_set_database;
@@character_set_database
utf8
'----test with new connection----'
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@session.character_set_server;
@@session.character_set_server
utf8
'----------character set not specified---------'
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */
DROP DATABASE db1;
SELECT @@character_set_database;
@@character_set_database
utf8
'----------ascii character set specified----------'
CREATE DATABASE db1 character set ascii;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET ascii */
DROP DATABASE db1;
select @@character_set_database;
@@character_set_database
utf8
'connection default;'
SET @@global.character_set_server = @global_character_set_server;
SET @@session.character_set_server = @session_character_set_server;
'#---------------------BS_STVARS_003_01----------------------#'
SELECT COUNT(@@GLOBAL.character_set_system);
COUNT(@@GLOBAL.character_set_system)
1
1 Expected
'#---------------------BS_STVARS_003_02----------------------#'
SET @@GLOBAL.character_set_system=1;
ERROR HY000: Variable 'character_set_system' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.character_set_system);
COUNT(@@GLOBAL.character_set_system)
1
1 Expected
'#---------------------BS_STVARS_003_03----------------------#'
SELECT @@GLOBAL.character_set_system = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_system';
@@GLOBAL.character_set_system = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.character_set_system);
COUNT(@@GLOBAL.character_set_system)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_system';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_003_04----------------------#'
SELECT @@character_set_system = @@GLOBAL.character_set_system;
@@character_set_system = @@GLOBAL.character_set_system
1
1 Expected
'#---------------------BS_STVARS_003_05----------------------#'
SELECT COUNT(@@character_set_system);
COUNT(@@character_set_system)
1
1 Expected
SELECT COUNT(@@local.character_set_system);
ERROR HY000: Variable 'character_set_system' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.character_set_system);
ERROR HY000: Variable 'character_set_system' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.character_set_system);
COUNT(@@GLOBAL.character_set_system)
1
1 Expected
SELECT character_set_system = @@SESSION.character_set_system;
ERROR 42S22: Unknown column 'character_set_system' in 'field list'
Expected error 'Readonly variable'
This diff is collapsed.
'#--------------------FN_DYNVARS_015_01-------------------------#'
SET @global_collation_connection = @@global.collation_connection;
SET @session_collation_connection = @@session.collation_connection;
SET @@global.collation_connection = latin1_danish_ci;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.collation_connection;
@@global.collation_connection
latin1_danish_ci
SELECT @@session.collation_connection;
@@session.collation_connection
latin1_danish_ci
'#--------------------FN_DYNVARS_015_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
'----check if collation_connection update character_set_connection---'
SET @@session.collation_connection = utf8_spanish_ci;
SELECT @@collation_connection, @@character_set_database;
@@collation_connection @@character_set_database
utf8_spanish_ci latin1
'---check if collation_connection works for literal string comparision--'
SET @@session.collation_connection = latin1_swedish_ci;
SELECT 'mysql'='MySql';
'mysql'='MySql'
1
SELECT _latin2'mysql' COLLATE latin2_general_ci='MySql';
_latin2'mysql' COLLATE latin2_general_ci='MySql'
1
SELECT _utf8'mysql'=_utf8'MySql' COLLATE utf8_unicode_ci;
_utf8'mysql'=_utf8'MySql' COLLATE utf8_unicode_ci
1
SET @@session.collation_connection = latin1_general_cs;
SELECT 'mysql'='MySql';
'mysql'='MySql'
0
SELECT _latin2'mysql'COLLATE latin2_general_ci='MySql';
_latin2'mysql'COLLATE latin2_general_ci='MySql'
1
SELECT _utf8'mysql'COLLATE utf8_danish_ci=_utf8'MySql'COLLATE utf8_unicode_ci;
ERROR HY000: Illegal mix of collations (utf8_danish_ci,EXPLICIT) and (utf8_unicode_ci,EXPLICIT) for operation '='
'---collation_connection does not effect comparision with column---'
CREATE TABLE t1(a CHAR(20)CHARACTER SET latin1 COLLATE latin1_german2_ci);
INSERT INTO t1 VALUES('Müller');
SET @@session.collation_connection = latin2_hungarian_ci;
SELECT * FROM t1 WHERE a='Müller';
a
Müller
SET @@session.collation_connection = latin1_general_cs;
SELECT * FROM t1 WHERE a='müller';
a
Müller
'check if string literal collation is used';
SELECT * FROM t1 WHERE a='müller' COLLATE latin1_general_cs;
a
SELECT * FROM t1 WHERE a='müller' COLLATE latin1_german1_ci;
a
Müller
DROP TABLE t1;
SET @@global.collation_connection = @global_collation_connection;
SET @@session.collation_connection = @session_collation_connection;
This diff is collapsed.
'#--------------------FN_DYNVARS_011_01-------------------------#'
SET @global_collation_database = @@global.collation_database;
SET @session_collation_database = @@session.collation_database;
SET @session_collation_server = @@session.collation_server;
SET @@global.collation_database = latin1_danish_ci;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.collation_database;
@@global.collation_database
latin1_danish_ci
SELECT @@session.collation_database;
@@session.collation_database
latin1_swedish_ci
'Bug#35378: New session collation_database is not change by global collation_database'
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1,t2;
SELECT @@character_set_server,@@collation_server;
@@character_set_server @@collation_server
latin1 latin1_swedish_ci
'--check if setting collation_database update character_set_database--'
SET @@session.collation_database = utf8_spanish_ci;
SELECT @@collation_database, @@character_set_database;
@@collation_database @@character_set_database
utf8_spanish_ci utf8
'--check if collation_database effects database/tables charset/collation'
SET @@session.collation_server = utf8_roman_ci;
SET @@session.collation_database = latin2_croatian_ci;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_roman_ci */
'Bug#35380: collation_database does not effects CREATE DATABASE without characater set'
CREATE TABLE t1(a CHAR(20));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(20) COLLATE utf8_roman_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_roman_ci
'---check if updating collation_database effects new table/column---'
SET @@session.collation_database = latin7_general_cs;
CREATE TABLE t2(a CHAR(10));
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` char(10) COLLATE utf8_roman_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_roman_ci
DROP TABLE t1,t2;
'--check value of collation and character set when current db is dropped'
DROP DATABASE db1;
SELECT @@collation_database,@@collation_server,@@character_set_database,@@character_set_server;
@@collation_database @@collation_server @@character_set_database @@character_set_server
utf8_roman_ci utf8_roman_ci utf8 utf8
USE test;
SELECT @@collation_database,@@collation_server,@@character_set_database,@@character_set_server;
@@collation_database @@collation_server @@character_set_database @@character_set_server
utf8_roman_ci utf8_roman_ci utf8 utf8
'fill table with some test data';
CREATE TABLE t1(a CHAR(20))CHARACTER SET=latin1;
INSERT INTO t1 VALUES('Muffler'),('Müller'),('MX Systems');
'---check if collation_database effects results sort order---'
SET @@session.collation_database = latin1_swedish_ci;
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
Müller
SET @@session.collation_database = latin1_german1_ci;
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
Müller
'explicit Collate clause should effects results sort order';
SELECT * FROM t1 ORDER BY a COLLATE latin1_swedish_ci;
a
Muffler
MX Systems
Müller
SELECT * FROM t1 ORDER BY a COLLATE latin1_german1_ci;
a
Muffler
Müller
MX Systems
'----check if indexing is effected by collation_database---'
SET @@session.collation_database = latin1_swedish_ci;
ALTER TABLE t1 ADD PRIMARY KEY (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
Müller
ALTER TABLE t1 DROP PRIMARY KEY;
SET @@session.collation_database = latin1_german1_ci;
ALTER TABLE t1 ADD PRIMARY KEY (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT * FROM t1 ORDER BY a;
a
Muffler
MX Systems
Müller
DROP TABLE t1;
SET @@global.collation_database = @global_collation_database;
SET @@session.collation_database = @session_collation_database;
SET @@session.collation_server = @session_collation_server;
This diff is collapsed.
'#--------------------FN_DYNVARS_014_01-------------------------#'
SET @global_collation_server = @@global.collation_server;
SET @session_collation_server = @@session.collation_server;
SET @@global.collation_server = latin1_danish_ci;
'connect (con1,localhost,root,,,,)'
'connection con1'
SELECT @@global.collation_server;
@@global.collation_server
latin1_danish_ci
SELECT @@session.collation_server;
@@session.collation_server
latin1_danish_ci
'#--------------------FN_DYNVARS_014_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1,t2;
'---check if setting collation_server update character_set_server---'
SET @@session.collation_server = utf8_spanish_ci;
SELECT @@collation_server, @@character_set_server;
@@collation_server @@character_set_server
utf8_spanish_ci utf8
'--check if collation_server effects database/table charset/collation--'
SET @@session.collation_server = latin1_german1_ci;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci */
CREATE TABLE t1(a CHAR(20));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(20) COLLATE latin1_german1_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
'---check if updating collation_server effects new table/column---'
SET @@session.collation_server = latin1_swedish_ci;
CREATE TABLE t2(a CHAR(10));
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` char(10) COLLATE latin1_german1_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
INSERT INTO t1 VALUES('Muffler'),('Müller'),('MX Systems');
'---check if collation_server effects results sort order---'
SET @@session.collation_server = latin1_swedish_ci;
SELECT * FROM t1 ORDER BY a;
a
Muffler
Müller
MX Systems
SET @@session.collation_server = latin1_german1_ci;
SELECT * FROM t1 ORDER BY a;
a
Muffler
Müller
MX Systems
SELECT * FROM t1 ORDER BY a COLLATE latin1_swedish_ci;
a
Muffler
MX Systems
Müller
SELECT * FROM t1 ORDER BY a COLLATE latin1_german1_ci;
a
Muffler
Müller
MX Systems
'---check if indexing is effected by collation_server---'
SET @@session.collation_server = latin1_swedish_ci;
ALTER TABLE t1 ADD PRIMARY KEY (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
db1.t1 repair status OK
SELECT * FROM t1 ORDER BY a;
a
Muffler
Müller
MX Systems
ALTER TABLE t1 DROP PRIMARY KEY;
SET @@session.collation_server = latin1_german1_ci;
ALTER TABLE t1 ADD PRIMARY KEY (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
db1.t1 repair status OK
SELECT * FROM t1 ORDER BY a;
a
Muffler
Müller
MX Systems
DROP TABLE t1,t2;
DROP DATABASE db1;
SET @@global.collation_server = @global_collation_server;
SET @@session.collation_server = @session_collation_server;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SET @start_value = @@global.general_log_file;
SELECT @start_value;
@start_value
test.log
'#---------------------FN_DYNVARS_004_01-------------------------#'
SET @@global.general_log_file = DEFAULT;
SELECT RIGHT(@@global.general_log_file,10) AS log_file;
log_file
master.log
'#--------------------FN_DYNVARS_004_02------------------------#'
SET @@global.general_log_file = mytest.log;
ERROR 42000: Variable 'general_log_file' can't be set to the value of 'log'
'#----------------------FN_DYNVARS_004_03------------------------#'
SELECT @@global.general_log_file = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='general_log_file';
@@global.general_log_file = VARIABLE_VALUE
1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment