mariadb/mysql-test/r/character_set_connection_func.result
2008-04-10 15:14:28 +02:00

55 lines
2 KiB
Text

'#--------------------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;