已解决
MySQL 8.0.32 union 语句中文查不到数据
来自网友在路上 184884提问 提问时间:2023-11-04 23:58:48阅读次数: 84
最佳答案 问答题库848位专家为你答疑解惑
关键字
MySQL union 语句,中文查不到数据
问题描述
MySQL 8.0.32 union 语句,中文查不到数据
解决问题思路
1、Create a table `test` with two fields, such as id and name
mysql>create table test ( id int unsigned auto_increment key, name varchar(50))ENGINE=INNODB;
2、Insert data into the table. The name field is Chinese characters, such as "姜志福"
mysql>insert into test(id,name) values(1,'姜志福');
3、Use the union statement to query, such as:
select * from (
select * from test
union all
select * from test
)a where id = 1 and name = '姜志福'
最终排查为这是MySQL BUG
https://bugs.mysql.com/bug.php?id=110005临时解决可以关闭 derived_condition_pushdown 特性
set optimizer_switch='derived_condition_pushdown=off';
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-32.htmlA condition pushdown into a UNION of queries having LIKE clauses did not preserve the correct character set, leading to an (erroneous) empty result.
We solve this problem in two parts:
By refactoring resolution of LIKE expressions, in which character set determination and propagation were previously performed in two separate blocks of the code that were not always consistent with one another.
By adding, in the internal parse_expression() function, a character set prefix to any literal character string that is cloned.
(Bug #107787, Bug #34359297, Bug #34589153)https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-33.htmlWhen cloning a condition to push down to a derived table, characters in strings representing conditions were converted to utfmb4 correctly only for values less than 128 (the ASCII subset), and code points outside the ASCII subset were converted to invalid characters, causing the resulting character strings to become invalid. For derived tables without UNION, this led to problems when a column name from the derived table used characters outside the ASCII subset, and was used in the WHERE condition. For derived tables with UNION, it created problems when a character outside the ASCII subset was present in a WHERE condition.
We fix these issues by initializing the string used for representing the condition in such cases to the connection character set. (Bug #109699, Bug #34996488)
问题总结
MySQL 8.0.32 存在UNION语句 中文查不到数据的BUG
查看全文
99%的人还看了
相似问题
- 黄金比例设计软件Goldie App mac中文版介绍
- 多协议数据库管理软件 Navicat Premium 16 mac中文版功能
- 媒体格式转换软件Permute 3 mac中文版软件特点
- 图片降噪软件 Topaz DeNoise AI mac中文版功能
- 图数据库Neo4J 中文分词查询及全文检索(建立全文索引)
- 打印工具HandyPrint Pro Mac中文版软件特点
- Android开发:(AndroidStudio模拟器)如何将模拟器语言设置为中文 模拟器输入法更改为中文输入 键盘输入中文
- kali中文输入法
- 文件传输客户端 SecureFX mac中文版支持多种协议
- linux 安装中文字体
猜你感兴趣
版权申明
本文"MySQL 8.0.32 union 语句中文查不到数据":http://eshow365.cn/6-32250-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!
- 上一篇: 分享者 - 携程旅游创作者搬砖项目图文教程
- 下一篇: C++可以使用负数作为下标索引