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

clustered index + new collation + union panic #20876

Closed
wjhuang2016 opened this issue Nov 5, 2020 · 4 comments · Fixed by #21379
Closed

clustered index + new collation + union panic #20876

wjhuang2016 opened this issue Nov 5, 2020 · 4 comments · Fixed by #21379
Assignees
Labels
severity/major sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> show create table t;

+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                  |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `a` char(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `b` char(20) COLLATE utf8mb4_general_ci NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY (`a`,`b`,`c`),
  KEY `idx` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select * from t;
+---+---+----+
| a | b | c  |
+---+---+----+
| # | C | 10 |
| $ | c | 20 |
| $ | c | 30 |
| a | a | 10 |
| A | A | 30 |
+---+---+----+
5 rows in set (0.00 sec)

mysql> select * from t where a="#" UNION select * from t where a="$";
ERROR 1105 (HY000): runtime error: index out of range [2] with length 2

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

Right result

3. What did you see instead (Required)

Panic

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added type/bug The issue is confirmed as a bug. severity/critical labels Nov 5, 2020
@wjhuang2016
Copy link
Member Author

UNION is not needed.

mysql> select * from t where a="#"
ERROR 1105 (HY000): runtime error: index out of range [2] with length 2

@SunRunAway SunRunAway added sig/transaction SIG:Transaction sig/sql-infra SIG: SQL Infra labels Nov 11, 2020
@wjhuang2016 wjhuang2016 added the sig/planner SIG: Planner label Nov 20, 2020
@qw4990
Copy link
Contributor

qw4990 commented Nov 20, 2020

@wjhuang2016 I cannot reproduce this problem now. Could you please confirm it again?

@lzmhhh123
Copy link
Contributor

Hi, clustered index related issues should be maintained the severity to major. It doesn't affect the release branch.

@ti-srebot
Copy link
Contributor

ti-srebot commented Dec 1, 2020

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

master

6. Fixed versions

master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Projects
None yet
5 participants