123 lines
5.3 KiB
Plaintext
123 lines
5.3 KiB
Plaintext
set names gbk;
|
|
select @@character_set_connection;
|
|
@@character_set_connection
|
|
gbk
|
|
select @@collation_connection;
|
|
@@collation_connection
|
|
gbk_chinese_ci
|
|
set @@character_set_client=gbk;
|
|
select @@character_set_client;
|
|
@@character_set_client
|
|
gbk
|
|
set names utf8mb4;
|
|
set @@character_set_connection=gbk;
|
|
select @@character_set_connection;
|
|
@@character_set_connection
|
|
gbk
|
|
select @@collation_connection;
|
|
@@collation_connection
|
|
gbk_chinese_ci
|
|
select _gbk 'a';
|
|
Error 1115 (42000): Unsupported character introducer: 'gbk'
|
|
create table t1(a char(10) charset gbk);
|
|
create table t2(a char(10) charset gbk collate gbk_bin);
|
|
create table t3(a char(10)) charset gbk;
|
|
alter table t3 add column b char(10) charset gbk;
|
|
show create table t3;
|
|
Table Create Table
|
|
t3 CREATE TABLE `t3` (
|
|
`a` char(10) DEFAULT NULL,
|
|
`b` char(10) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci
|
|
create table t4(a char(10));
|
|
alter table t4 add column b char(10) charset gbk;
|
|
show create table t4;
|
|
Table Create Table
|
|
t4 CREATE TABLE `t4` (
|
|
`a` char(10) DEFAULT NULL,
|
|
`b` char(10) CHARACTER SET gbk COLLATE gbk_chinese_ci DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
|
|
create table t5(a char(20), b char(20) charset utf8, c binary) charset gbk collate gbk_bin;
|
|
create database test_gbk charset gbk;
|
|
use test_gbk;
|
|
create table t1(a char(10));
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` char(10) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci
|
|
drop database test_gbk;
|
|
use executor__charset;
|
|
set names DEFAULT;
|
|
drop table if exists t;
|
|
create table t(ascii_char char(10) character set ascii,gbk_char char(10) character set gbk collate gbk_bin,latin_char char(10) character set latin1,utf8mb4_char char(10) character set utf8mb4);
|
|
insert into t values ('a', 'a', 'a', 'a'), ('a', '啊', '€', 'ㅂ');
|
|
select collation(concat(ascii_char, gbk_char)) from t;
|
|
collation(concat(ascii_char, gbk_char))
|
|
gbk_bin
|
|
gbk_bin
|
|
select collation(concat(gbk_char, ascii_char)) from t;
|
|
collation(concat(gbk_char, ascii_char))
|
|
gbk_bin
|
|
gbk_bin
|
|
select collation(concat(utf8mb4_char, gbk_char)) from t;
|
|
collation(concat(utf8mb4_char, gbk_char))
|
|
utf8mb4_bin
|
|
utf8mb4_bin
|
|
select collation(concat(gbk_char, utf8mb4_char)) from t;
|
|
collation(concat(gbk_char, utf8mb4_char))
|
|
utf8mb4_bin
|
|
utf8mb4_bin
|
|
select collation(concat('啊', convert('啊' using gbk) collate gbk_bin));
|
|
collation(concat('啊', convert('啊' using gbk) collate gbk_bin))
|
|
gbk_bin
|
|
select collation(concat(_latin1 'a', convert('啊' using gbk) collate gbk_bin));
|
|
collation(concat(_latin1 'a', convert('啊' using gbk) collate gbk_bin))
|
|
gbk_bin
|
|
select collation(concat(latin_char, gbk_char)) from t;
|
|
Error 1267 (HY000): Illegal mix of collations (latin1_bin,IMPLICIT) and (gbk_bin,IMPLICIT) for operation 'concat'
|
|
select collation(concat(convert('€' using latin1), convert('啊' using gbk) collate gbk_bin));
|
|
Error 1267 (HY000): Illegal mix of collations (latin1_bin,IMPLICIT) and (gbk_bin,EXPLICIT) for operation 'concat'
|
|
select collation(concat(utf8mb4_char, gbk_char collate gbk_bin)) from t;
|
|
Error 1267 (HY000): Illegal mix of collations (utf8mb4_bin,IMPLICIT) and (gbk_bin,EXPLICIT) for operation 'concat'
|
|
select collation(concat('ㅂ', convert('啊' using gbk) collate gbk_bin));
|
|
Error 1267 (HY000): Illegal mix of collations (utf8mb4_bin,COERCIBLE) and (gbk_bin,EXPLICIT) for operation 'concat'
|
|
select collation(concat(ascii_char collate ascii_bin, gbk_char)) from t;
|
|
Error 1267 (HY000): Illegal mix of collations (ascii_bin,EXPLICIT) and (gbk_bin,IMPLICIT) for operation 'concat'
|
|
drop table if exists t;
|
|
create table t(a char(20) charset gbk, b char(20) charset gbk, primary key (a(2)));
|
|
insert into t values ('a', '中文'), ('中文', '中文'), ('一二三', '一二三'), ('b', '一二三');
|
|
select * from t;
|
|
a b
|
|
a 中文
|
|
b 一二三
|
|
一二三 一二三
|
|
中文 中文
|
|
drop table t;
|
|
create table t(a char(20) charset gbk, b char(20) charset gbk, unique index idx_a(a(2)));
|
|
insert into t values ('a', '中文'), ('中文', '中文'), ('一二三', '一二三'), ('b', '一二三');
|
|
select * from t;
|
|
a b
|
|
a 中文
|
|
b 一二三
|
|
一二三 一二三
|
|
中文 中文
|
|
select 'a' collate utf8_roman_ci;
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
select cast('a' as char) collate utf8_roman_ci;
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set names utf8 collate utf8_roman_ci;
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set session collation_server = 'utf8_roman_ci';
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set session collation_database = 'utf8_roman_ci';
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set session collation_connection = 'utf8_roman_ci';
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set global collation_server = 'utf8_roman_ci';
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set global collation_database = 'utf8_roman_ci';
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|
|
set global collation_connection = 'utf8_roman_ci';
|
|
Error 1273 (HY000): Unsupported collation when new collation is enabled: 'utf8_roman_ci'
|