You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/03/11 03:03:32 UTC

[GitHub] [shardingsphere] jinpengSun opened a new issue #15984: Data truncation: Out of range value for column

jinpengSun opened a new issue #15984:
URL: https://github.com/apache/shardingsphere/issues/15984


   ## Bug Report
   Use  ShardingSphere-Proxy and Sharding-Scaling to synchronize MySQL data, and report an error when incrementally synchronizing data: Data truncation: Out of range value for column xx
   
   
   ### Which version of ShardingSphere did you use?
   version 4.1.1  Sharding-Scaling
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   project use ShardingSphere-Proxy
   
   ### Expected behavior
   incrementally synchronizing success
   
   ### Actual behavior
   incrementally synchronizing fail
   
   ### Reason analyze (If you can)
   MySQL column type smallint(6)
   MySQL column data value -1
   incrementally synchronizing fail 
   exception:
   org.apache.shardingsphere.shardingscaling.core.exception.SyncTaskExecuteException: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncation: Out of range value for column 't1_c' at row 1
   	at org.apache.shardingsphere.shardingscaling.core.execute.executor.writer.AbstractJDBCWriter.write(AbstractJDBCWriter.java:90)
   	at org.apache.shardingsphere.shardingscaling.core.execute.executor.writer.AbstractJDBCWriter.run(AbstractJDBCWriter.java:72)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
   	at java.util.concurrent.FutureTask.run(FutureTask.java)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   Reading source code discovery:
   class: org.apache.shardingsphere.database.protocol.mysql.payload.MySQLPacketPayload
   method:
   public int readInt2() {
           return byteBuf.readShortLE() & 0xffff;
       }
   When &0ffff the byteBuf.readShortLE() value of method execution is - 1, 65535 will be obtained, and an exception will occur: Data truncation: Out of range value。
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] zjcnb commented on issue #15984: Data truncation: Out of range value for column

Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #15984:
URL: https://github.com/apache/shardingsphere/issues/15984#issuecomment-1066500542


   @jinpengSun Hello, `4.1.1` version are old, can you try to upgrade to the latest version?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz closed issue #15984: Data truncation: Out of range value for column

Posted by GitBox <gi...@apache.org>.
sandynz closed issue #15984:
URL: https://github.com/apache/shardingsphere/issues/15984


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on issue #15984: Data truncation: Out of range value for column

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #15984:
URL: https://github.com/apache/shardingsphere/issues/15984#issuecomment-1073187721


   Hi @jinpengSun , there's similar issue #10314, it has been fixed in 5.x version. You could try latest version, e.g. `5.1.0`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org