DM migration of MySQL data to TiDB failed: execute statement failed: DELETE FROM XXX; "RawCause": "Error 1105 (HY000): runtime error: index out of range [1] with length 1"

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

Original topic: DM 迁移mysql数据到tidb 时 execute statement failed: DELETE FROM XXX; “RawCause”: “Error 1105 (HY000): runtime error: index out of range [1] with length 1”

| username: 郑旭东石家庄

[TiDB Usage Environment] Production Environment
[TiDB Version] V7.6
[Reproduction Path] Migrating MySQL data to TiDB through DM
[Encountered Problem:] During data synchronization, an error occurred: execute statement failed: DELETE FROM XXX; Error 1105 (HY000): runtime error: index out of range [1] with length 1
[Error Information:]
“errors”: [
{
“ErrCode”: 10006,
“ErrClass”: “database”,
“ErrScope”: “not-set”,
“ErrLevel”: “high”,
“Message”: “startLocation: [position: (mysql57-bin.000137, 787396581), gtid-set: 00000000-0000-0000-0000-000000000000:0], endLocation: [position: (mysql57-bin.000137, 788322038), gtid-set: 00000000-0000-0000-0000-000000000000:0]: execute statement failed: DELETE FROM shenbt.t_ab_bsd WHERE id = ? AND user_id = ? LIMIT 1”,
“RawCause”: “Error 1105 (HY000): runtime error: index out of range [1] with length 1”,
“Workaround”: “”
}
]

| username: WalterWj | Original post link

It should be a bug. Take down the explain player and go to the feedback section.

| username: Billmay表妹 | Original post link

Please post the reproduction steps~

Let’s see if it’s a known issue.

| username: 郑旭东石家庄 | Original post link

I’m a beginner, how do I use explain player?

| username: 郑旭东石家庄 | Original post link

I’m a newbie. What is the path to reproduce it?

| username: aytrack | Original post link

| username: Jayjlchen | Original post link

Why are you using version 7.6 in a production environment? It’s a DMR version.

| username: 郑旭东石家庄 | Original post link

Where is this file located?

At the same time, this issue occurs on partitioned tables.
Below is the MySQL syntax:
– zh_shenbao.t_sb_bsdt_zdylj definition

CREATE TABLE t_sb_bsdt_zdylj (
id varchar(60) NOT NULL,
user_id varchar(60) NOT NULL COMMENT ‘User ID’,
bsdt_id varchar(60) NOT NULL COMMENT ‘Map menu ID’,
parent_id varchar(60) DEFAULT NULL COMMENT ‘Parent menu ID’,
level int(2) NOT NULL COMMENT ‘Menu level’,
create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘Creation time’,
update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘Update time’,
del_flag varchar(10) NOT NULL DEFAULT ‘enable’ COMMENT ‘Deletion status: enable - not deleted; disable - deleted’,
PRIMARY KEY (id,user_id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT=‘Declaration - Custom map link’
/*!50100 PARTITION BY KEY (user_id)
(PARTITION p0 ENGINE = InnoDB,
PARTITION p1 ENGINE = InnoDB,
PARTITION p2 ENGINE = InnoDB,
PARTITION p3 ENGINE = InnoDB,
PARTITION p4 ENGINE = InnoDB,
PARTITION p5 ENGINE = InnoDB,
PARTITION p6 ENGINE = InnoDB) */;

Below is the TiDB automatically created syntax:

CREATE TABLE t_sb_bsdt_zdylj (
id varchar(60) NOT NULL COMMENT ‘Custom map link ID’,
user_id varchar(60) NOT NULL COMMENT ‘User ID’,
bsdt_id varchar(60) NOT NULL COMMENT ‘Map menu ID’,
parent_id varchar(60) DEFAULT NULL COMMENT ‘Parent menu ID’,
level int(2) NOT NULL COMMENT ‘Menu level’,
create_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘Creation time’,
update_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘Update time’,
del_flag varchar(10) NOT NULL DEFAULT ‘enable’ COMMENT ‘Deletion status: enable - not deleted; disable - deleted’,
PRIMARY KEY (id,user_id) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT=‘Declaration - Custom map link’
PARTITION BY KEY (user_id) PARTITIONS 7;

PARTITION p6 ENGINE = InnoDB) */;

| username: 郑旭东石家庄 | Original post link

This is the exported file.

| username: 郑旭东石家庄 | Original post link

The upstream is MySQL 5.7.25
The specific migration task is as follows:
name: “sb”
task-mode: “all”
target-database:
host: “192.168.55.23” # For example: 172.16.10.83
port: 4000
user: “migrate_data”
password: “xxxxxxxxxxxxxxxxxxx”
mysql-instances:

  • source-id: “mysql50132”
    block-allow-list: “ba-rule1”
    block-allow-list:
    ba-rule1:
    do-dbs: [“sb_geshui”, “zh_shenbao”]
| username: 有猫万事足 | Original post link

I have edited out the password for you. Be careful when surfing the internet.

| username: aytrack | Original post link

This is the same issue as Runtime error index out of range for Key partitioned table when partitioning column is not the first column. · Issue #50206 · pingcap/tidb · GitHub. When the column of the key partition is not in the first column, the query will report an error. It has been fixed in the current master. You can work around it by placing the user_id column as the first column when creating the table.

| username: Billmay表妹 | Original post link

This issue should have been fixed in version 7.5.1.

| username: 郑旭东石家庄 | Original post link

Where can I find the installation package for V7.5.1?

| username: Billmay表妹 | Original post link

image

| username: system | Original post link

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