【 TiDB 使用环境】生产
【 TiDB 版本】
v5.2.2
【遇到的问题】
drainer日志报错:
[2022/04/19 11:10:20.617 +08:00] [ERROR] [executor.go:111] [“Exec fail, will rollback”] [query=“REPLACE INTO dbname
.table_name_20220418
(bindDate
,id
,lastLoginDat e
,oId
,type
,unionId
,uCode
,uId
) VALUES(?,?,?,?,?,?,?,?)”] [args="[“2022-04-15 09:49:55”,180024,“0000-00-00 00:00:00”,“oJBprwy7foiiE10QN1dRHmx26b_A”,1,“oJBprwy7foiiE1
0QN1dRHmx26b_A”,"",1980188]"] [error=“Error 1292: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘lastLoginDate’ at row 1”]
上、下游都为tidb,sql_mode都为默认
show variables like ‘sql_mode’;
±--------------±------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
±--------------±------------------------------------------------------------------------------------------------------------------------------------------+
| sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
±--------------±------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.08 sec)
【复现路径】做过哪些操作出现的问题
昨天是创建了table_name_20220418,然后
insert into table_name_20220418 select * from table_name;
CREATE TABLE table_name_20220418
(
id
bigint(20) NOT NULL AUTO_INCREMENT,
uId
bigint(20) NOT NULL,
uCode
varchar(50) NOT NULL,
oId
varchar(50) NOT NULL,
unionId
varchar(50) NOT NULL,
type
int(11) NOT NULL,
bindDate
datetime NOT NULL,
lastLoginDate
datetime NOT NULL,
PRIMARY KEY (id
) /*T![clustered_index] CLUSTERED */,
UNIQUE KEY oId
(oId
),
KEY uId_IDX
(uId
),
KEY uCode_IDX
(uCode
),
KEY unionId_IDX
(unionId
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
【问题现象及影响】
下游同步数据报错, 不再同步
【附件】
- 相关日志、配置文件、Grafana 监控(https://metricstool.pingcap.com/)
- TiUP Cluster Display 信息
- TiUP CLuster Edit config 信息
- TiDB-Overview 监控
- 对应模块的 Grafana 监控(如有 BR、TiDB-binlog、TiCDC 等)
- 对应模块日志(包含问题前后 1 小时日志)
若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。