MySQL 全角半角 尾部空格

测试SQL

1
2
3
4
5
6
7
8
9
SELECT
@@character_set_client,
@@character_set_server,
@@collation_connection,
@@collation_server,
'a ' = 'a',
'a,' = 'a,',
'a ' = BINARY 'a',
'a,' = BINARY 'a,';

运行结果

character_set_client character_set_server collation_connection collation_server ‘a ‘ = ‘a’ ‘a,’ = ‘a,’ ‘a ‘ = BINARY ‘a’ ‘a,’ = BINARY ‘a,’
utf8 latin1 utf8_general_ci latin1_swedish_ci 1 0 0 0
utf8mb4 utf8mb4 utf8mb4_general_ci utf8mb4_general_ci 1 0 0 0
utf8mb4 latin1 utf8mb4_general_ci latin1_swedish_ci 1 0 0 0
utf8mb4 utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci 0 1 0 0
utf8mb4 utf8mb4 utf8mb4_general_ci utf8mb4_unicode_ci 1 0 0 0
latin1 utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci 0 0 0 0
utf8 utf8mb4 utf8_general_ci utf8mb4_0900_ai_ci 1 0 0 0

Note: MySQL5 没有utf8mb4_0900_ai_ci