Skip to content

panic or wrong results when db or index name contains : when reading from slow_query table #39940

@time-and-fate

Description

@time-and-fate

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Case 1:

use test;
create table t(a int, b int, c int, index `i: a`(a));
insert into t value(1,1,1);
select sleep(1) from t where a = 1;
select index_names from information_schema.slow_query;

Case 2:

create database `a: b`;
use `a: b`;
create table t(a int, b int);
insert into t value ();
select sleep(1) from t;
select * from information_schema.slow_query;

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

Return correct results.

3. What did you see instead (Required)

Case 1:

+-------------+
| index_names |
+-------------+
|             |
| [t          |
+-------------+

Case 2:

ERROR 1105 (HY000): runtime error: slice bounds out of range [4:3]

4. What is your TiDB version? (Required)

nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions