Skip to content

sync json null failed #12438

@giant-panda666

Description

@giant-panda666

What did you do?

  1. create table in MySQL
CREATE TABLE `t0` (
  `id` bigint(20) unsigned NOT NULL COMMENT '主键',
  `position` json NOT NULL COMMENT '标记位置',
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

use t0 to replace real table here, but bug is still the same.
2. create dm sync task sync t0 to TiDB with mode all
3. insert data into t0

insert into t0 values(1, cast('null' as json));

What did you expect to see?

data inserted in MySQL is synced to TiDB

What did you see instead?

i got error: Error 3140 (22032): Invalid JSON text: The document is empty

Versions of the cluster

DM version (run dmctl -V or dm-worker -V or dm-master -V):

v8.5.0

Upstream MySQL/MariaDB server version:

MySQL 5.7

Downstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

v7.5.1

How did you deploy DM: tiup or manually?

TiDB Operator

Other interesting information (system version, hardware config, etc):

>
>

current status of DM cluster (execute query-status <task-name> in dmctl)

"errors": [
                            {
                                "ErrCode": 10006,
                                "ErrClass": "database",
                                "ErrScope": "not-set",
                                "ErrLevel": "high",
                                "Message": "startLocation: [position: (mysql-bin|000001.000787, 905342), gtid-set: 64db65da-36f3-11f0-978b-9c63c0933e6c:1-3699301], endLocation: [position: (mysql-bin|000001.000787, 905788), gtid-set: 64db65da-36f3-11f0-978b-9c63c0933e6c:1-3699301]: execute statement failed: REPLACE INTO `cactus`.`marks` (`id`,`user_id`,`spu_id`,`spu_type_id`,`meta`,`post_id`,`created_at`,`updated_at`,`deleted_at`,`hobby_id`,`extra`,`mark_at`,`related_id`,`mark_type`,`position`,`post_attachment_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
                                "RawCause": "Error 3140 (22032): Invalid JSON text: The document is empty",
                                "Workaround": ""
                            }
                        ],

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions