开发者社区> 问答> 正文

Data truncation: BIT value is out of range in '(1)

使用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

展开
收起
古拉古拉 2023-06-14 21:44:37 61 0
2 条回答
写回答
取消 提交回答
  • 根据错误日志和您的描述,看起来这是一个数据类型转换的问题,可能是因为 MySQL 和 TiDB 在处理 BIT 类型时的实现略有不同导致的。您可以尝试使用最新版本的 otter,或者升级 TiDB 版本,这有可能修复这个问题。

    另外,您可以尝试通过以下方式来规避这个问题:

    1. 如果可能的话,可以将源表中的 BIT 类型改为其他类型,例如 TINYINT 或 BOOLEAN 类型等。

    2. 可以尝试在 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 类型。

    2023-06-15 10:11:34
    赞同 展开评论 打赏
  • Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: BIT value is out of range in '(1)'

    这个类型otter验证过同步到mysql是没问题的,反馈一下到tidb确认一下问题

    原回答者GitHub用户agapple

    2023-06-14 22:25:09
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载