Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch Point Get doesn't use converted datum #54746

Closed
Ryan-Git opened this issue Jul 18, 2024 · 2 comments · Fixed by #59325
Closed

Batch Point Get doesn't use converted datum #54746

Ryan-Git opened this issue Jul 18, 2024 · 2 comments · Fixed by #59325
Assignees
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@Ryan-Git
Copy link
Contributor

Ryan-Git commented Jul 18, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t` (`tenant_id` bigint(20) NOT NULL DEFAULT '0',`order_id` bigint(20) NOT NULL DEFAULT '0',UNIQUE KEY `uk_ten_ord` (`order_id`, `tenant_id`))  PARTITION BY HASH(`tenant_id`) PARTITIONS 32;

INSERT INTO t(tenant_id, order_id) VALUES (123, 456);

DELETE FROM t where (tenant_id, order_id) in (('123','456'));

2. What did you expect to see? (Required)

affected rows 1

3. What did you see instead (Required)

affected rows 0

4. What is your TiDB version? (Required)

up to 7.5.0, master the same I think

in #26713, cases of ValueExpr and ParamMarkerExpr are handled(use converted int datum instead of origin string one), but the RowExpr is left unchanged, which causes this problem.

Is it intentional?

@Ryan-Git Ryan-Git added the type/bug The issue is confirmed as a bug. label Jul 18, 2024
@Defined2014
Copy link
Contributor

It's been fixed by #49161 and only affects v7.5.x and previous version.

@Defined2014 Defined2014 added sig/sql-infra SIG: SQL Infra component/tablepartition This issue is related to Table Partition of TiDB. severity/major labels Jul 19, 2024
@Defined2014 Defined2014 added affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 labels Jul 19, 2024
@mjonss mjonss self-assigned this Jul 19, 2024
@Ryan-Git
Copy link
Contributor Author

Ryan-Git commented Jul 24, 2024

It's been fixed by #49161 and only affects v7.5.x and previous version.

u mean plan cache re-evaluates it? It seems the value still uses innerX.Datum instead of dval on main. https://github.com/mjonss/tidb/blame/cc616f9ba19d9c8a9dc31ae9b95fe54077069454/pkg/planner/core/point_get_plan.go#L1124

ti-chi-bot bot pushed a commit that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants