Skip to content

Cannot use ingest way to add index for empty table #39641

@tangenta

Description

@tangenta

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Create a new cluster.

create table t (a int);
alter table t add index idx(a);
admin show ddl jobs 1;

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

+--------+-------------+------------+------------------------+--------------+-----------+----------+-----------+---------------------+---------------------+---------------------+--------+
| JOB_ID | DB_NAME     | TABLE_NAME | JOB_TYPE               | SCHEMA_STATE | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME         | START_TIME          | END_TIME            | STATE  |
+--------+-------------+------------+---------------------------+--------------+-----------+----------+-----------+---------------------+---------------------+---------------------+--------+
|     88 | addindexlit | t          | add index /* ingest */ | public       |        84 |       86 |         0 | 2022-12-05 23:43:20 | 2022-12-05 23:43:20 | 2022-12-05 23:43:21 | synced |
+--------+-------------+------------+------------------------+--------------+-----------+----------+-----------+---------------------+---------------------+---------------------+--------+

3. What did you see instead (Required)

+--------+-------------+------------+---------------------------+--------------+-----------+----------+-----------+---------------------+---------------------+---------------------+--------+
| JOB_ID | DB_NAME     | TABLE_NAME | JOB_TYPE                  | SCHEMA_STATE | SCHEMA_ID | TABLE_ID | ROW_COUNT | CREATE_TIME         | START_TIME          | END_TIME            | STATE  |
+--------+-------------+------------+---------------------------+--------------+-----------+----------+-----------+---------------------+---------------------+---------------------+--------+
|     88 | addindexlit | t          | add index /* txn-merge */ | public       |        84 |       86 |         0 | 2022-12-05 23:43:20 | 2022-12-05 23:43:20 | 2022-12-05 23:43:21 | synced |
+--------+-------------+------------+---------------------------+--------------+-----------+----------+-----------+---------------------+---------------------+---------------------+--------+

4. What is your TiDB version? (Required)

71863b4

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions