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

Wrong result when IndexMerge is used with virtual column #30354

Closed
guo-shaoge opened this issue Dec 2, 2021 · 1 comment
Closed

Wrong result when IndexMerge is used with virtual column #30354

guo-shaoge opened this issue Dec 2, 2021 · 1 comment
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@guo-shaoge
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1;
create table t1(c1 int, c2 int, c3 int as (c1 + c2), key(c1), key(c2), key(c3));
insert into t1(c1, c2) values(1, 1);
select /*+ use_index_merge(t1) */ * from t1 where c1 < -10 or c2 < 10 and reverse(c3) = '2';  

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

mysql> select * from t1 where c1 < -10 or c2 < 10 and reverse(c3) = '2';
+------+------+------+
| c1   | c2   | c3   |
+------+------+------+
|    1 |    1 |    2 |
+------+------+------+
1 row in set (0.01 sec)

3. What did you see instead (Required)

mysql> select /*+ use_index_merge(t1) */ * from t1 where c1 < -10 or c2 < 10 and reverse(c3) = '2';
Empty set (0.01 sec)

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
                          |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.4.0-alpha-241-g7a8c7f89ce
Edition: Community
Git Commit Hash: 7a8c7f89cebe0e5596415a6106b1345cec9cfa27
Git Branch: master
UTC Build Time: 2021-11-28 02:32:15
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@guo-shaoge guo-shaoge added the type/bug The issue is confirmed as a bug. label Dec 2, 2021
@guo-shaoge guo-shaoge self-assigned this Dec 2, 2021
@guo-shaoge
Copy link
Collaborator Author

guo-shaoge commented Dec 23, 2021

fixed in #30341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants