使用otter同步mysql到tidb。今天对tidb进行升级之后遇到了这个问题,不知道是otter原因还是tidb原因。mysql表有个字段类型是bit(1)类型,使用otter增量同步到tidb的时候报错了,但是我拿这条异常数据去tidb里查询,发现这条数据已经写到tidb里面。而且直接拿这条数据插入tidb也是正常的。完整的错误日志如下:
pid:411 nid:111 exception:setl:com.alibaba.otter.node.etl.load.exception.LoadException: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into tidb_confluence.notifications(CONTENTID , LABELID , SPACEID , USERNAME , CREATOR , CREATIONDATE , LASTMODIFIER , LASTMODDATE , DIGEST , NETWORK , CONTENTTYPE , NOTIFICATIONID) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update CONTENTID=values(CONTENTID) , LABELID=values(LABELID) , SPACEID=values(SPACEID) , USERNAME=values(USERNAME) , CREATOR=values(CREATOR) , CREATIONDATE=values(CREATIONDATE) , LASTMODIFIER=values(LASTMODIFIER) , LASTMODDATE=values(LASTMODDATE) , DIGEST=values(DIGEST) , NETWORK=values(NETWORK) , CONTENTTYPE=values(CONTENTTYPE) , NOTIFICATIONID=values(NOTIFICATIONID)]; Data truncation: BIT value is out of range in '(1)'; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:650) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:642) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:570) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:487) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:279) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:165) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3974) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013) at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
... 21 more PairId: 1,051 , TableId: 1,781 , EventType : I , Time : 1554187790000 Consistency : , Mode : ---Pks EventColumn[index=0,columnType=-5,columnName=NOTIFICATIONID,columnValue=29465959,isNull=false,isKey=true,isUpdate=true] ---oldPks
---Columns EventColumn[index=1,columnType=-5,columnName=CONTENTID,columnValue=30338633,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=-5,columnName=LABELID,columnValue=,isNull=true,isKey=false,isUpdate=true] EventColumn[index=3,columnType=-5,columnName=SPACEID,columnValue=,isNull=true,isKey=false,isUpdate=true] EventColumn[index=4,columnType=12,columnName=USERNAME,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=12,columnName=CREATOR,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=93,columnName=CREATIONDATE,columnValue=2019-04-02 14:49:50,isNull=false,isKey=false,isUpdate=true] EventColumn[index=7,columnType=12,columnName=LASTMODIFIER,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=8,columnType=93,columnName=LASTMODDATE,columnValue=2019-04-02 14:49:50,isNull=false,isKey=false,isUpdate=true] EventColumn[index=9,columnType=-7,columnName=DIGEST,columnValue=0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=10,columnType=-7,columnName=NETWORK,columnValue=0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=11,columnType=12,columnName=CONTENTTYPE,columnValue=page,isNull=false,isKey=false,isUpdate=true] ---Sql insert into tidb_confluence.notifications(CONTENTID , LABELID , SPACEID , USERNAME , CREATOR , CREATIONDATE , LASTMODIFIER , LASTMODDATE , DIGEST , NETWORK , CONTENTTYPE , NOTIFICATIONID) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update CONTENTID=values(CONTENTID) , LABELID=values(LABELID) , SPACEID=values(SPACEID) , USERNAME=values(USERNAME) , CREATOR=values(CREATOR) , CREATIONDATE=values(CREATIONDATE) , LASTMODIFIER=values(LASTMODIFIER) , LASTMODDATE=values(LASTMODDATE) , DIGEST=values(DIGEST) , NETWORK=values(NETWORK) , CONTENTTYPE=values(CONTENTTYPE) , NOTIFICATIONID=values(NOTIFICATIONID)
Caused by: java.util.concurrent.ExecutionException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into tidb_confluence.notifications(CONTENTID , LABELID , SPACEID , USERNAME , CREATOR , CREATIONDATE , LASTMODIFIER , LASTMODDATE , DIGEST , NETWORK , CONTENTTYPE , NOTIFICATIONID) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update CONTENTID=values(CONTENTID) , LABELID=values(LABELID) , SPACEID=values(SPACEID) , USERNAME=values(USERNAME) , CREATOR=values(CREATOR) , CREATIONDATE=values(CREATIONDATE) , LASTMODIFIER=values(LASTMODIFIER) , LASTMODDATE=values(LASTMODDATE) , DIGEST=values(DIGEST) , NETWORK=values(NETWORK) , CONTENTTYPE=values(CONTENTTYPE) , NOTIFICATIONID=values(NOTIFICATIONID)]; Data truncation: BIT value is out of range in '(1)'; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:650) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:642) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:570) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:487) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:279) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:165) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3974) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013) at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
... 21 more PairId: 1,051 , TableId: 1,781 , EventType : I , Time : 1554187790000 Consistency : , Mode : ---Pks EventColumn[index=0,columnType=-5,columnName=NOTIFICATIONID,columnValue=29465959,isNull=false,isKey=true,isUpdate=true] ---oldPks
---Columns EventColumn[index=1,columnType=-5,columnName=CONTENTID,columnValue=30338633,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=-5,columnName=LABELID,columnValue=,isNull=true,isKey=false,isUpdate=true] EventColumn[index=3,columnType=-5,columnName=SPACEID,columnValue=,isNull=true,isKey=false,isUpdate=true] EventColumn[index=4,columnType=12,columnName=USERNAME,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=12,columnName=CREATOR,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=93,columnName=CREATIONDATE,columnValue=2019-04-02 14:49:50,isNull=false,isKey=false,isUpdate=true] EventColumn[index=7,columnType=12,columnName=LASTMODIFIER,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=8,columnType=93,columnName=LASTMODDATE,columnValue=2019-04-02 14:49:50,isNull=false,isKey=false,isUpdate=true] EventColumn[index=9,columnType=-7,columnName=DIGEST,columnValue=0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=10,columnType=-7,columnName=NETWORK,columnValue=0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=11,columnType=12,columnName=CONTENTTYPE,columnValue=page,isNull=false,isKey=false,isUpdate=true] ---Sql insert into tidb_confluence.notifications(CONTENTID , LABELID , SPACEID , USERNAME , CREATOR , CREATIONDATE , LASTMODIFIER , LASTMODDATE , DIGEST , NETWORK , CONTENTTYPE , NOTIFICATIONID) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update CONTENTID=values(CONTENTID) , LABELID=values(LABELID) , SPACEID=values(SPACEID) , USERNAME=values(USERNAME) , CREATOR=values(CREATOR) , CREATIONDATE=values(CREATIONDATE) , LASTMODIFIER=values(LASTMODIFIER) , LASTMODDATE=values(LASTMODDATE) , DIGEST=values(DIGEST) , NETWORK=values(NETWORK) , CONTENTTYPE=values(CONTENTTYPE) , NOTIFICATIONID=values(NOTIFICATIONID)
at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader.load(DataBatchLoader.java:107) at com.alibaba.otter.node.etl.load.loader.OtterLoaderFactory.load(OtterLoaderFactory.java:50) at com.alibaba.otter.node.etl.load.LoadTask$1.run(LoadTask.java:85) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: com.alibaba.otter.node.etl.load.exception.LoadException: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into tidb_confluence.notifications(CONTENTID , LABELID , SPACEID , USERNAME , CREATOR , CREATIONDATE , LASTMODIFIER , LASTMODDATE , DIGEST , NETWORK , CONTENTTYPE , NOTIFICATIONID) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update CONTENTID=values(CONTENTID) , LABELID=values(LABELID) , SPACEID=values(SPACEID) , USERNAME=values(USERNAME) , CREATOR=values(CREATOR) , CREATIONDATE=values(CREATIONDATE) , LASTMODIFIER=values(LASTMODIFIER) , LASTMODDATE=values(LASTMODDATE) , DIGEST=values(DIGEST) , NETWORK=values(NETWORK) , CONTENTTYPE=values(CONTENTTYPE) , NOTIFICATIONID=values(NOTIFICATIONID)]; Data truncation: BIT value is out of range in '(1)'; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker$2.doInTransaction(DbLoadAction.java:650) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.doCall(DbLoadAction.java:642) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$DbLoadWorker.call(DbLoadAction.java:570) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doTwoPhase(DbLoadAction.java:487) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.doLoad(DbLoadAction.java:279) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction.load(DbLoadAction.java:165) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$FastClassByCGLIB$$d932a4cb.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:618) at com.alibaba.otter.node.etl.load.loader.db.DbLoadAction$$EnhancerByCGLIB$$80fd23c2.load() at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:198) at com.alibaba.otter.node.etl.load.loader.db.DataBatchLoader$2.call(DataBatchLoader.java:189) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3974) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079) at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013) at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:818) at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:587)
... 21 more PairId: 1,051 , TableId: 1,781 , EventType : I , Time : 1554187790000 Consistency : , Mode : ---Pks EventColumn[index=0,columnType=-5,columnName=NOTIFICATIONID,columnValue=29465959,isNull=false,isKey=true,isUpdate=true] ---oldPks
---Columns EventColumn[index=1,columnType=-5,columnName=CONTENTID,columnValue=30338633,isNull=false,isKey=false,isUpdate=true] EventColumn[index=2,columnType=-5,columnName=LABELID,columnValue=,isNull=true,isKey=false,isUpdate=true] EventColumn[index=3,columnType=-5,columnName=SPACEID,columnValue=,isNull=true,isKey=false,isUpdate=true] EventColumn[index=4,columnType=12,columnName=USERNAME,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=5,columnType=12,columnName=CREATOR,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=6,columnType=93,columnName=CREATIONDATE,columnValue=2019-04-02 14:49:50,isNull=false,isKey=false,isUpdate=true] EventColumn[index=7,columnType=12,columnName=LASTMODIFIER,columnValue=4028f95e67d49ef60169468d873500b0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=8,columnType=93,columnName=LASTMODDATE,columnValue=2019-04-02 14:49:50,isNull=false,isKey=false,isUpdate=true] EventColumn[index=9,columnType=-7,columnName=DIGEST,columnValue=0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=10,columnType=-7,columnName=NETWORK,columnValue=0,isNull=false,isKey=false,isUpdate=true] EventColumn[index=11,columnType=12,columnName=CONTENTTYPE,columnValue=page,isNull=false,isKey=false,isUpdate=true] ---Sql insert into tidb_confluence.notifications(CONTENTID , LABELID , SPACEID , USERNAME , CREATOR , CREATIONDATE , LASTMODIFIER , LASTMODDATE , DIGEST , NETWORK , CONTENTTYPE , NOTIFICATIONID) values (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) on duplicate key update
原提问者GitHub用户linquan92
根据错误日志和您的描述,看起来这是一个数据类型转换的问题,可能是因为 MySQL 和 TiDB 在处理 BIT 类型时的实现略有不同导致的。您可以尝试使用最新版本的 otter,或者升级 TiDB 版本,这有可能修复这个问题。
另外,您可以尝试通过以下方式来规避这个问题:
如果可能的话,可以将源表中的 BIT 类型改为其他类型,例如 TINYINT 或 BOOLEAN 类型等。
可以尝试在 otter 中使用自定义转换器(Converter)来处理 BIT 类型。具体来说,可以在 Channel 配置文件中添加如下配置:
<converter class="com.alibaba.otter.node.etl.load.loader.db.common.conver.BitToIntConverter"
type="BIT"
target="java.lang.Integer"/>
然后,在表映射关系文件中,将需要处理的 BIT 类型字段的类型改为 INT 类型。
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)'
这个类型otter验证过同步到mysql是没问题的,反馈一下到tidb确认一下问题
原回答者GitHub用户agapple
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。