mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
This patch changes the main name of 3 byte character set from utf8 to utf8mb3. New old_mode UTF8_IS_UTF8MB3 is added and set TRUE by default, so that utf8 would mean utf8mb3. If not set, utf8 would mean utf8mb4.
71 lines
2.2 KiB
Plaintext
71 lines
2.2 KiB
Plaintext
'#--------------------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
|
|
utf8mb3
|
|
SELECT @@session.character_set_server;
|
|
@@session.character_set_server
|
|
utf8mb3
|
|
disconnect con1;
|
|
'#--------------------FN_DYNVARS_009_02-------------------------#'
|
|
connection default;
|
|
'--global character_set_server should not effects current connection--'
|
|
select @@character_set_database=@@character_set_connection;
|
|
@@character_set_database=@@character_set_connection
|
|
1
|
|
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 utf8mb3 */
|
|
DROP DATABASE db1;
|
|
select @@character_set_database;
|
|
@@character_set_database
|
|
utf8mb3
|
|
'----test with new connection----'
|
|
connect con1,localhost,root,,,,;
|
|
connection con1;
|
|
SELECT @@session.character_set_server;
|
|
@@session.character_set_server
|
|
utf8mb3
|
|
'----------character set not specified---------'
|
|
CREATE DATABASE db1;
|
|
USE db1;
|
|
SHOW CREATE DATABASE db1;
|
|
Database Create Database
|
|
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 */
|
|
DROP DATABASE db1;
|
|
SELECT @@character_set_database;
|
|
@@character_set_database
|
|
utf8mb3
|
|
'----------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
|
|
utf8mb3
|
|
disconnect con1;
|
|
connection default;
|
|
SET @@global.character_set_server = @global_character_set_server;
|
|
SET @@session.character_set_server = @session_character_set_server;
|