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

panic when admin check table #56045

Closed
wjhuang2016 opened this issue Sep 12, 2024 · 1 comment · Fixed by #56060
Closed

panic when admin check table #56045

wjhuang2016 opened this issue Sep 12, 2024 · 1 comment · Fixed by #56060
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. impact/panic severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

wjhuang2016 commented Sep 12, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set global tidb_enable_global_index=1;
create table t ( col_1 json ,col_2 tinyint  unsigned not null default 57 , key idx_1 ( col_2 ,(cast(col_1 as CHAR(64) array)) ) ,unique key idx_2 ( (cast(col_1 as CHAR(64) array)) ) global ,primary key  ( col_2 )  /*T![clustered_index] clustered */ ) charset utf8 collate utf8_general_ci partition by hash ( col_2 ) partitions 5;

alter table t rename index idx_1 to idx_1_1;

admin check table t;

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

No panic

3. What did you see instead (Required)

mysql> admin check table t;
ERROR 1105 (HY000): runtime error: index out of range [1] with length 1

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added the type/bug The issue is confirmed as a bug. label Sep 12, 2024
@Defined2014 Defined2014 self-assigned this Sep 12, 2024
@Defined2014 Defined2014 added sig/sql-infra SIG: SQL Infra severity/moderate component/tablepartition This issue is related to Table Partition of TiDB. and removed component/tablepartition This issue is related to Table Partition of TiDB. labels Sep 12, 2024
@Defined2014 Defined2014 removed their assignment Sep 12, 2024
@Defined2014
Copy link
Contributor

It seems that it has nothing to do with the global index, and the following SQL will also panic.

CREATE TABLE `t1` (
  `col_1` json DEFAULT NULL,
  `col_2` tinyint(3) unsigned NOT NULL DEFAULT '57',
  PRIMARY KEY (`col_2`) /*T![clustered_index] CLUSTERED */,
  KEY `idx_1` (`col_2`,(cast(`col_1` as char(64) array))),
  UNIQUE KEY `idx_2` ((cast(`col_1` as char(64) array)))
);
alter table t1 rename index idx_1 to idx_1_1;
admin check  table t1;

@bb7133 bb7133 added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Sep 13, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in f956694 Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. impact/panic severity/moderate 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.

4 participants