67 lines
2.9 KiB
Plaintext
67 lines
2.9 KiB
Plaintext
'#--------------------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;
|
||
Warnings:
|
||
Warning 3778 'utf8_spanish_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
|
||
SELECT @@collation_connection, @@character_set_database;
|
||
@@collation_connection @@character_set_database
|
||
utf8_spanish_ci utf8mb4
|
||
'---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
|
||
Warnings:
|
||
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
|
||
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
|
||
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(_latin1'M<>ller');
|
||
SET @@session.collation_connection = latin2_hungarian_ci;
|
||
SELECT * FROM t1 WHERE a=_latin1'M<>ller';
|
||
a
|
||
Müller
|
||
SET @@session.collation_connection = latin1_general_cs;
|
||
SELECT * FROM t1 WHERE a=_latin1'm<>ller';
|
||
a
|
||
Müller
|
||
'check if string literal collation is used';
|
||
SELECT * FROM t1 WHERE a=_latin1'm<>ller' COLLATE latin1_general_cs;
|
||
a
|
||
SELECT * FROM t1 WHERE a=_latin1'm<>ller' COLLATE latin1_german1_ci;
|
||
a
|
||
Müller
|
||
DROP TABLE t1;
|
||
set names utf8mb4;
|
||
SET @@global.collation_connection = @global_collation_connection;
|
||
SET @@session.collation_connection = @session_collation_connection;
|