Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: tidb5.4版本like查询数据结果不对
TiDB version 5.4.0 / 5.4.2
SQL query using LIKE with one character ‘阿%’ returns no results, but using LIKE with two characters ‘阿莫%’ displays results normally.
[Image]
[Image]
Does it mean that the result from 5.4.0 is correct, and the result from 5.4.2 is incorrect?
No, it’s not. None of the 5.4.X versions are working properly.
To add, I tried searching with ‘阿%’ and ‘阿莫%’ and the former also couldn’t retrieve results.
See if the situation is similar to this post.
Could you show the table structure definition (including collation)?
Version 6.1 tested successfully
In version 5.7.25-TiDB-v5.4.0, setting the table character set to utf8 and collation to utf8_general_ci did not result in any anomalies.
It is most likely due to character set issues. You can check out this document:
Tested in version 5.4.0, it is indeed the case. Marking it down.
This topic was automatically closed 1 minute after the last reply. No new replies are allowed.