Abnormal table_id in TiDB partitioned table

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB分区表table_id异常

| username: asd80703406

[Test Environment] TiDB
[TiDB Version] 6.5.4
[Reproduction Path]

CREATE TABLE employees (
    id INT NOT NULL,
    fname VARCHAR(30),
    lname VARCHAR(30),
    hired DATE NOT NULL DEFAULT '1970-01-01',
    separated DATE NOT NULL DEFAULT '9999-12-31',
    job_code INT,
    store_id INT
)
PARTITION BY HASH( YEAR(hired) )
PARTITIONS 4;

CREATE TABLE employees2 (
    id INT NOT NULL,
    fname VARCHAR(30),
    lname VARCHAR(30),
    hired DATE NOT NULL DEFAULT '1970-01-01',
    separated DATE NOT NULL DEFAULT '9999-12-31',
    job_code INT,
    store_id INT
)
PARTITION BY HASH( YEAR(hired) )
PARTITIONS 3;

select db_name,table_name,tidb_decode_key(START_KEY),tidb_decode_key(END_KEY) from information_schema.tikv_region_status where table_name = 'employees';

[Encountered Problem: Phenomenon and Impact]
Couldn’t figure it out, why does the table_id of the employees table include the table_id of employees2? Seeking guidance from experts.

| username: zhanggame1 | Original post link

tidb_decode_key(START_KEY) and tidb_decode_key(END_KEY) show that other tables are normal. The current version supports cross-table region merge.

| username: GreenGuan | Original post link

Because you are querying the tikv_region_status table, the relationship between regions and tables is one-to-many.

| username: DBAER | Original post link

It should be like this.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.