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

query partition table with global unique index get wrong result #21732

Closed
crazycs520 opened this issue Dec 14, 2020 · 4 comments · Fixed by #22478 or #41197
Closed

query partition table with global unique index get wrong result #21732

crazycs520 opened this issue Dec 14, 2020 · 4 comments · Fixed by #22478 or #41197
Assignees
Labels
component/tablepartition This issue is related to Table Partition of TiDB. sig/execution SIG execution type/enhancement The issue or PR belongs to an enhancement.

Comments

@crazycs520
Copy link
Contributor

crazycs520 commented Dec 14, 2020

Development Task

Related issue: #18032

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

TiDB config:

enable-global-index=true
create table t (a int, b int GENERATED ALWAYS AS (3*a-2*a) VIRTUAL) partition by hash(b) partitions 2;
alter table t add unique index idx (a);
insert into t (a) values  (1),(2),(3);
select * from t ignore index (idx);
select * from t use index (idx);

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

test> select * from t use index (idx);
+---+---+
| a | b |
+---+---+
| 2 | 2 |
| 1 | 1 |
| 3 | 3 |
+---+---+

3. What did you see instead (Required)

test> select * from t use index (idx);
+---+---+
| a | b |
+---+---+
0 rows in set
Time: 0.014s

4. What is your TiDB version? (Required)

test> select tidb_version();
+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-1812-gd33b81b1e                    |
| Edition: Community                                                |
| Git Commit Hash: d33b81b1ee69bd60a56e45f87774e76014720a6e         |
| Git Branch: master                                                |
| UTC Build Time: 2020-12-14 12:59:19                               |
| GoVersion: go1.14.4                                               |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+
@crazycs520 crazycs520 added the type/bug The issue is confirmed as a bug. label Dec 14, 2020
@crazycs520
Copy link
Contributor Author

@tiancaiamao PTAL

@ichn-hu
Copy link
Contributor

ichn-hu commented Dec 15, 2020

/assign @tiancaiamao

@tiancaiamao
Copy link
Contributor

tiancaiamao commented Dec 16, 2020

I've removed the severity/critical label as the global index is not a released feature yet.

And I've changed the issue template to 'development task' instead of 'bug report'

@mjonss
Copy link
Contributor

mjonss commented Feb 14, 2022

/component tablepartition

@ti-chi-bot ti-chi-bot added the component/tablepartition This issue is related to Table Partition of TiDB. label Feb 14, 2022
@hawkingrei hawkingrei added the type/enhancement The issue or PR belongs to an enhancement. label Sep 28, 2022
ti-chi-bot pushed a commit that referenced this issue Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. sig/execution SIG execution type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
7 participants