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

Split table index on non-int clustered index should not be allowed #47350

Closed
pcqz opened this issue Sep 28, 2023 · 1 comment · Fixed by #47412
Closed

Split table index on non-int clustered index should not be allowed #47350

pcqz opened this issue Sep 28, 2023 · 1 comment · Fixed by #47412
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. found/gs found by gs severity/major type/bug The issue is confirmed as a bug.

Comments

@pcqz
Copy link

pcqz commented Sep 28, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> CREATE TABLE `test` (`id` varchar(10) NOT NULL, primary key (`id`) /*T![clustered_index] CLUSTERED */ );
Query OK, 0 rows affected (0.08 sec)

mysql> split table test index `primary` between (0) and (1000) regions 2;
+--------------------+----------------------+
| TOTAL_SPLIT_REGION | SCATTER_FINISH_RATIO |
+--------------------+----------------------+
|                  2 |                    1 |
+--------------------+----------------------+
1 row in set (0.21 sec)

mysql> show table test regions;
+-----------+------------------------------+------------------------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+------------------------+------------------+
| REGION_ID | START_KEY                    | END_KEY                      | LEADER_ID | LEADER_STORE_ID | PEERS | SCATTERING | WRITTEN_BYTES | READ_BYTES | APPROXIMATE_SIZE(MB) | APPROXIMATE_KEYS | SCHEDULING_CONSTRAINTS | SCHEDULING_STATE |
+-----------+------------------------------+------------------------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+------------------------+------------------+
|        14 | t_110_i_2_                   | t_281474976710649_           |        15 |               1 | 15    |          0 |           217 |          0 |                    1 |                0 |                        |                  |
|       664 | t_110_                       | t_110_i_1_013098181800000000 |       665 |               1 | 665   |          0 |             0 |          0 |                    1 |                0 |                        |                  |
|       666 | t_110_i_1_013098181800000000 | t_110_i_2_                   |       667 |               1 | 667   |          0 |             0 |          0 |                    1 |                0 |                        |                  |
+-----------+------------------------------+------------------------------+-----------+-----------------+-------+------------+---------------+------------+----------------------+------------------+------------------------+------------------+
3 rows in set (0.01 sec)

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

The error "ERROR 1176 (42000): Key 'primary' doesn't exist in table 'test'" should be reported like int type clustered index.

3. What did you see instead (Required)

Split table index is executed without error.

4. What is your TiDB version? (Required)

v7.1.1

@pcqz pcqz added the type/bug The issue is confirmed as a bug. label Sep 28, 2023
@pcqz
Copy link
Author

pcqz commented Sep 28, 2023

/found gs

@ti-chi-bot ti-chi-bot bot added the found/gs found by gs label Sep 28, 2023
@seiya-annie seiya-annie added component/ddl This issue is related to DDL of TiDB. severity/major labels Oct 7, 2023
@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 7, 2023
@tangenta tangenta added affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Oct 7, 2023
@ti-chi-bot ti-chi-bot bot removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. found/gs found by gs severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants