0

I met a problem when migrate data ( by TiDB DM) from mysql I have a table in mysql which have a enum columns:

`xxx` enum('offer','payment') NOT NULL DEFAULT 'offer',

I create a migration task, the dump and load progress were complete, but I met this error in sync progress:

"ErrCode": 10006,
                            "ErrClass": "database",
                            "ErrScope": "not-set",
                            "ErrLevel": "high",
                            "Message": "startLocation: [position: (, 0), gtid-set: ], endLocation: [position: (xxx-bin|000001.000035, 522223249), gtid-set: ]: execute statement failed: UPDATE `ti_xxx`.`api_logs` SET `l_id` = ?, `a_id` = ?, `l_datetime` = ?, `l_api` = ?, `l_request` = ?, `l_response_status` = ?, `l_response` = ?, `l_status` = ?, `l_currency` = ?, `l_type` = ?, `cl_id` = ?, `l_test` = ?, `l_parent_id` = ?, `l_attempt` = ?, `l_cl_type` = ?, `l_parameters` = ?, `l_api_type` = ?, `l_group_status` = ?, `l_group_attempt` = ? WHERE `l_id` = ? LIMIT 1",
                            "RawCause": "Error 1105: item 2 is not in enum [offer payment]",
                            "Workaround": ""
  • TiDB version: 5.7.25-TiDB-v5.2.0 TiDB Server
  • DM version: v2.0.6
  • DM task configuration:
    name: "xxx-api_logs"
    task-mode: "all"
    routes:
      xxx:
        schema-pattern: "xxx"
        target-schema: "ti_xxx"
    target-database:
      host: "127.0.0.1"
      port: 30306
      user: "root"
      password: "<removed>"
    
    
    mysql-instances:
    - source-id: "dba5-xxx"
      block-allow-list: "xxx"
      route-rules: ["xxx"]
    
    block-allow-list:
      xxx:
        do-tables:
        - db-name: "xxx"
          tbl-name: "api_logs"

on TiDB side, I tested some operations with enum column, they works:

mysql> CREATE TABLE t1 (
-> a enum('offer','payment') NOT NULL DEFAULT 'offer'
-> );
Query OK, 0 rows affected (0.27 sec)
mysql> INSERT INTO t1 VALUES ('payment');
Query OK, 1 row affected (0.03 sec)
mysql> INSERT INTO t1 VALUES (2);
Query OK, 1 row affected (0.00 sec)
mysql> select * from t1;
+---------+
| a       |
+---------+
| payment |
| payment |
+---------+
2 rows in set (0.01 sec)
mysql> update t1 set a=1 where a=2;
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2  Changed: 2  Warnings: 0
mysql> select * from t1;
+-------+
| a     |
+-------+
| offer |
| offer |
+-------+
2 rows in set (0.00 sec)

I use a worker which was enabled relay, I parsed relay log and it contains a valid index values

...
###   @15=2
...

pls suggest me some ways to troubleshoot, Thanks so much

Quyen Le
  • 1
  • 2
  • Currently I resolve the problem by enabe safe-mode in task configuration. But it would decrease the performance – Quyen Le Sep 13 '21 at 05:01
  • 1
    Someone said that we should check this [tidb issue](https://github.com/pingcap/tidb/pull/27752) but I tested with reproduce steps, i have no any error with them – Quyen Le Sep 13 '21 at 05:04

0 Answers0