miss record when where condition use right % #35366
Labels
affects-4.0
This bug affects 4.0.x versions.
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
affects-5.3
This bug affects 5.3.x versions.
affects-5.4
This bug affects 5.4.x versions.
duplicate
Issues or pull requests already exists.
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
-- table info
CREATE TABLE
cp_info
(id
bigint(20) unsigned NOT NULL AUTO_INCREMENT,name
varchar(32) COLLATE utf8_general_ci DEFAULT NULL,PRIMARY KEY (
id
) /*T![clustered_index] CLUSTERED */,KEY
idx_name
(name
)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1374818
MySQL [cp_center]> explain select * from cp_center.cp_info where name like '秦文政%';
+-------------+---------+------+---------------+---------------+
| id | estRows | task | access object | operator info |
+-------------+---------+------+---------------+---------------+
| TableDual_5 | 0.00 | root | | rows:0 |
+-------------+---------+------+---------------+---------------+
1 row in set (0.00 sec)
-- after drop name index
MySQL [cp_center]> select id, name from cp_center.cp_info where name like '秦文政%'\G
*************************** 1. row ***************************
id: 1310871
name: 秦文政
2. What did you expect to see? (Required)
MySQL [cp_center]> select id, name from cp_center.cp_info where name = '秦文政'\G
*************************** 1. row ***************************
id: 1310871
name: 秦文政
3. What did you see instead (Required)
MySQL [cp_center]> select id, name from cp_center.cp_info where name like '秦文政%'\G
Empty set (0.00 sec)
4. What is your TiDB version? (Required)
Release Version: v5.4.1
Edition: Community
Git Commit Hash: be48447
Git Branch: heads/refs/tags/v5.4.1
UTC Build Time: 2022-05-07 04:31:32
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: