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

The statement: select ... where _tidb_rowid in (...) returns an wrong result #45889

Closed
lcwangchao opened this issue Aug 8, 2023 · 1 comment · Fixed by #45891
Closed

The statement: select ... where _tidb_rowid in (...) returns an wrong result #45889

lcwangchao opened this issue Aug 8, 2023 · 1 comment · Fixed by #45891
Labels
affects-7.3 severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@lcwangchao
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

TiDB root@127.0.0.1:test> create table tp(a int) partition by list(a) (partition p0 values in (0, 1), partition p1 values in (2, 3));
Query OK, 0 rows affected

TiDB root@127.0.0.1:test> insert into tp values (0),(0),(1),(1),(2),(2),(3),(3);
Query OK, 8 rows affected


TiDB root@127.0.0.1:test> select _tidb_rowid, a from tp order by _tidb_rowid;
+-------------+---+
| _tidb_rowid | a |
+-------------+---+
| 1           | 0 |
| 2           | 0 |
| 3           | 1 |
| 4           | 1 |
| 5           | 2 |
| 6           | 2 |
| 7           | 3 |
| 8           | 3 |
+-------------+---+

TiDB root@127.0.0.1:test> select _tidb_rowid, a from tp where _tidb_rowid in (7, 8);
+-------------+---+
| _tidb_rowid | a |
+-------------+---+
+-------------+---+

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

TiDB root@127.0.0.1:test> select _tidb_rowid, a from tp where _tidb_rowid in (7, 8);
+-------------+---+
| _tidb_rowid | a |
+-------------+---+
| 7           | 3 |
| 8           | 3 |
+-------------+---+

3. What did you see instead (Required)

TiDB root@127.0.0.1:test> select _tidb_rowid, a from tp where _tidb_rowid in (7, 8);
+-------------+---+
| _tidb_rowid | a |
+-------------+---+
+-------------+---+

4. What is your TiDB version? (Required)

master and 7.3

@lcwangchao lcwangchao added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/major labels Aug 8, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Aug 8, 2023
@lcwangchao lcwangchao added affects-7.3 and removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Aug 8, 2023
@lcwangchao
Copy link
Collaborator Author

Seems this bug is introduced by PR: #45646

@ti-chi-bot ti-chi-bot bot added may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Aug 8, 2023
@aytrack aytrack removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.3 severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants