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

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

Closed
tangenta opened this issue Dec 5, 2022 · 2 comments · Fixed by #39683
Closed

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

tangenta opened this issue Dec 5, 2022 · 2 comments · Fixed by #39683
Assignees
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@tangenta
Copy link
Contributor

tangenta commented Dec 5, 2022

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

@tangenta
Copy link
Contributor Author

tangenta commented Oct 9, 2023

Tables with empty partitions will also encounter this problem. Change the severity to major.

@ti-chi-bot ti-chi-bot bot added 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 Oct 9, 2023
@tangenta tangenta added the affects-6.5 This bug affects the 6.5.x(LTS) versions. label Oct 9, 2023
@tangenta tangenta removed 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-7.1 labels Oct 9, 2023
@zimulala
Copy link
Contributor

zimulala commented Apr 1, 2024

This problem will have the following error message (this information is convenient for troubleshooting related problems later) :
[reorg.go:236] ["[ddl] run reorg job done"] ["handled rows"=0] [error="other error: invalid data type: record key or index key expected, but got []"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. severity/major 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.

3 participants