当前位置: 首页 > news >正文

MySQL 8.0.32 union 语句中文查不到数据

关键字

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

http://www.lryc.cn/news/217453.html

相关文章:

  • FlinkCDC系列:通过skipped.operations参数选择性处理新增、更新、删除数据
  • 高压检测设备
  • Vue3问题:如何实现组件拖拽实时预览功能?
  • 基于jsp的采购管理系统的分析与实现
  • react配置二级路由
  • C++ 模板特化
  • Spring-createBean部分源码
  • 2015年亚太杯APMCM数学建模大赛C题识别网络中的错误连接求解全过程文档及程序
  • js:可选链运算符(?.)和空值合并运算符(??)
  • 【Java 进阶篇】Java ServletContext功能:获取文件服务器路径
  • Android startActivity流程
  • Qt实验室
  • diffusers-Load adapters
  • CVI 串口调试助手
  • 【蓝桥杯选拔赛真题48】python最小矩阵 青少年组蓝桥杯python 选拔赛STEMA比赛真题解析
  • 如何在家庭网络中开启 IPv6内网穿透
  • CodeWhisperer 的安装及体验
  • 【C/C++】虚析构和纯虚析构
  • 第四章 应用SysML基本特性集的汽车示例 P1|系统建模语言SysML实用指南学习
  • C语言 写一个简易音乐播放器
  • 面试题:有一个 List 对象集合,如何优雅地返回给前端?
  • DAY43 完全背包理论基础 + 518.零钱兑换II
  • unity 从UI上拖出3D物体,(2D转3D)
  • win10pycharm和anaconda安装和环境配置教程
  • [C++ 中]:6.类和对象下(static成员 + explicit +友元函数 + 内部类 + 编译器优化)
  • ONES Design UI 组件库环境搭建
  • 支付宝AI布局: 新产品助力小程序智能化,未来持续投入加速创新
  • taro全局配置页面路由和tabBar页面跳转
  • 【k8s】pod进阶
  • 【设计模式】第18节:行为型模式之“迭代器模式”