polardbxengine/mysql-test/suite/sys_vars/r/character_set_client_func.r...

44 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

'#--------------------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;
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.
'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
utf8mb4
'#--------------------FN_DYNVARS_010_02-------------------------#'
'connection default'
SHOW VARIABLES like 'character_set_client';
Variable_name Value
character_set_client utf8mb4
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a CHAR(3) character set utf8);
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.
'---verifying character_set_client with a utf8 character----'
'For latin1 characterset';
SET @@session.character_set_client = latin1;
INSERT INTO t1 values('è');
SELECT hex(a),CHAR_LENGTH(a) FROM t1;
hex(a) CHAR_LENGTH(a)
03C3A8 2
DELETE FROM t1;
'For utf8 characterset';
SET @@session.character_set_client = utf8;
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.
INSERT INTO t1 values('è');
SELECT hex(a),CHAR_LENGTH(a) FROM t1;
hex(a) CHAR_LENGTH(a)
03 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;