Mysql查询返回不匹配的记录,例如查询字段character ='伍'但匹配,尤,⺎,⺐?
我在5.7中将mysql从5.7更新为8.0,这个问题更常见
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` ='⺎';
我希望select语句的输出为'伍',但实际输出为伍','尤','⺎','⺐'