配置dm时, 有"short_error": "[types:1067]Invalid default value for 错误

【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】 5.0.3
【复现路径】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】
【附件:截图/日志/监控】

mysql和 tidb的 字段都是 time123 timestamp NOT NULL DEFAULT ‘1970-01-01 08:00:01’

mysql版本 5.6 的

配置dm时, 有报错如下:

"result": false,
"msg": "[code=26005:class=dm-master:scope=internal:level=medium], Message: fail to check synchronization configuration with type: check was failed, please see detail
    detail: {
            "results": [
                    {
                            "id": 32,
                            "name": "sharding table `xxx`.`xxx` consistency checking",
                            "desc": "check consistency of sharding table structures",
                            "state": "fail",
                            "errors": [
                                    {
                                            "severity": "fail",
                                            "short_error": "[types:1067]Invalid default value for 'time123'"
                                    }
                            ],
                            "extra": "instance source_xxx on sharding `xxx`.`xxx`"
                    }
            ],
            "summary": {
                    "passed": false,
                    "total": 33,
                    "successful": 32,
                    "failed": 1,
                    "warning": 0
            }
    }"

没觉得哪里不兼容啊,你可以把报错的语句拿出来看下是哪里不兼容

通过tidb dashboard日志搜索功能,搜索command dispatched failed关键字

mysql> create table t2 (dt timestamp NOT NULL DEFAULT ‘1970-01-01 08:00:01’);
Query OK, 0 rows affected (0.54 sec)
执行没有问题(注意,检查一下单引号是否为中文字符,这也会引起异常),检查一下其它相邻的字段什么的,有可能其它错误影响的

1 个赞

都是sharding table了,为啥不提前建表呢。

这种分片的表聚合,不提前建表,相互的主键会冲突吧?
就算主键已经不会冲突了,分片表不做写热点改造也会有写热点的吧。

看起来没有啥问题,升下版本