3

Mysql query returns mismatched records, such as the query field character='兀' but matches out, 尢, ⺎, ⺐?

I update my mysql from 5.7 to 8.0,in 5.7,this problem is more common

drop  database if exists `chinese_sort`;
create database `chinese_sort` default  charset utf8mb4;

use `chinese_sort`;
create table `chinese_character_dict_standard_version`(
                                                        `id` bigint primary key auto_increment,
                                                        `character` char(1) not null comment '字',
                                                        `chinese_pinyin` varchar(50) default '' comment '拼音',
                                                        `stroke_num` tinyint not null default 0 comment '笔画数',
                                                        `four_corner_num` varchar(5) default '' comment '四角号码',
                                                        `unicode` varchar(12) not null comment 'unicode码',
                                                        `utf16` varchar(12) not null comment 'utf16码'
);
insert into chinese_character_dict_standard_version(`character`, unicode, utf16)
values('尢','5c22','\u5c22'),
      ('⼪','2f2a','\u2f2a'),
      ('⺎','2e8e','\u2e8e'),
      ('⺐','2e90','\u2e90');
SET NAMES utf8mb4 collate utf8mb4_unicode_ci;
select * from chinese_character_dict_standard_version
where `character` ='⺎';

I expect the output of the select statement to be '兀', but the actual output is 兀', '尢', '⺎', '⺐'

Robert Columbia
  • 6,012
  • 14
  • 28
  • 36
StringTek
  • 31
  • 2

0 Answers0