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

executor: global index point get meets err for clustered index table #49995

Closed
L-maple opened this issue Jan 3, 2024 · 2 comments · Fixed by #53254
Closed

executor: global index point get meets err for clustered index table #49995

L-maple opened this issue Jan 3, 2024 · 2 comments · Fixed by #53254
Assignees
Labels
feature/developing the related feature is in development severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@L-maple
Copy link
Contributor

L-maple commented Jan 3, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set tidb_enable_global_index=true;
create table pt (
    a int, b int, c int, d int default 0, 
    primary key (a, b) clustered, 
    unique key uidx(c)) partition by range(a) ( 
        PARTITION p0 VALUES LESS THAN (3), 
        PARTITION p1 VALUES LESS THAN (6), 
        PARTITION p2 VALUES LESS THAN (9), 
        PARTITION p3 VALUES LESS THAN (20) 
);
insert into pt(a,b,c) values(1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5), (6,6,6), (7,7,7), (8,8,8), (9,9,9), (10,10,10);
analyze table pt;
select c from pt where c = 1;
select * from pt where c in (1,2,3);

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

for point get: 1,1,1;
for batch point get: 1,1,1;2,2,2;3,3,3;

3. What did you see instead (Required)

image

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.6.0-alpha-629-g89fc4403f3
Edition: Community
Git Commit Hash: 89fc440
Git Branch: local/fix_global_index_under_clustered_index
UTC Build Time: 2024-01-03 02:59:45
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+--------------------------------------------------------

@L-maple L-maple added the type/bug This issue is a bug. label Jan 3, 2024
@L-maple L-maple changed the title executor: enhance global index for clustered index table executor: global index meets err for clustered index table Jan 3, 2024
@L-maple L-maple changed the title executor: global index meets err for clustered index table executor: global index point get meets err for clustered index table Jan 3, 2024
@Defined2014 Defined2014 added the feature/developing the related feature is in development label Jan 3, 2024
@jebter jebter added the sig/sql-infra SIG: SQL Infra label Jan 3, 2024
@Defined2014
Copy link
Contributor

Add one more test cases

CREATE TABLE `t` (
  `a` year(4) primary key,
  `b` int(11) DEFAULT NULL,
  UNIQUE KEY `idx1` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY HASH (`a`) PARTITIONS 5;

insert into t values (2001, 2), (2002, 3), (2003, 4), (2004, 5);

begin;
insert into t values (2005, 1);
select b from t partition(p0) use index(idx1);
select b from t partition(p0) use index();

@Defined2014 Defined2014 self-assigned this May 14, 2024
@Defined2014
Copy link
Contributor

Because the PR has not been updated for two weeks, I assigned it to myself first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/developing the related feature is in development severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
3 participants