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

Open
Ryan-Git opened this issue Jul 18, 2024 · 2 comments
Open

Batch Point Get doesn't use converted datum #54746

Ryan-Git opened this issue Jul 18, 2024 · 2 comments
Assignees
Labels
affects-6.1 affects-6.5 affects-7.1 affects-7.5 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.

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.1 affects-6.5 affects-7.1 affects-7.5 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
Development

No branches or pull requests

3 participants