wsm12138 opened a new issue, #17988:
URL: https://github.com/apache/shardingsphere/issues/17988

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.1.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   No Error
   ### Actual behavior
   ```
   [ERROR] 2022-05-27 10:34:28.591 [epollEventLoopGroup-3-12] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur:
   com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for 
column 'id' at row 1
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
        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:2491)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2449)
        at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:939)
        at 
com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)
        at 
com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.impl.ProxyStatementExecutorCallback.execute(ProxyStatementExecutorCallback.java:40)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:73)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:66)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.callback.ProxyJDBCExecutorCallback.executeSQL(ProxyJDBCExecutorCallback.java:44)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:85)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback.execute(JDBCExecutorCallback.java:64)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.syncExecute(ExecutorEngine.java:101)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.parallelExecute(ExecutorEngine.java:97)
        at 
org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine.execute(ExecutorEngine.java:82)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor.execute(JDBCExecutor.java:65)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.ProxyJDBCExecutor.execute(ProxyJDBCExecutor.java:71)
        at 
org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.useDriverToExecute(ProxySQLExecutor.java:164)
        at 
org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:125)
        at 
org.apache.shardingsphere.proxy.backend.communication.ProxySQLExecutor.execute(ProxySQLExecutor.java:119)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:139)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:73)
        at 
org.apache.shardingsphere.proxy.backend.text.data.impl.SchemaAssignedDatabaseBackendHandler.execute(SchemaAssignedDatabaseBackendHandler.java:56)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:97)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:100)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
        at 
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
        at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)
   ```
   ### Reason analyze (If you can)
   1. MySQL can prepare data with no error
   2. try to change `sql_mode` ,it can't be solved
   3. change jdbc dirver from 8.x -> 5.x it can't be solved
   4. I don't want to change the table structure
   ```
   CREATE TABLE `sbtest1` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `k` int(11) NOT NULL DEFAULT '0',
     `c` char(255) NOT NULL DEFAULT '',
     `pad` char(60) NOT NULL DEFAULT '',
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
   ```
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   use sharding
   ```
   schemaName: proxy_sysbench_four
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://10.16.9.12:3306/proxy_sysbench_four?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 600
       minPoolSize: 1
     ds_1:
       url: 
jdbc:mysql://10.16.9.62:3306/proxy_sysbench_four?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 600
       minPoolSize: 1
     ds_2:
       url: 
jdbc:mysql://10.16.9.192:3306/proxy_sysbench_four?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 600
       minPoolSize: 1
     ds_3:
       url: 
jdbc:mysql://10.16.9.120:3306/proxy_sysbench_four?useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=8192&prepStmtCacheSqlLimit=8000
       username: root
       password: 
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 600
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       sbtest1:
         actualDataNodes: ds_${0..3}.sbtest1_${0..9}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: mod_ten
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
   
     defaultDatabaseStrategy:
       standard:
         shardingColumn: id
         shardingAlgorithmName: mod_four
   
     shardingAlgorithms:
       mod_four:
         type: MOD
         props:
           sharding-count: 4
       mod_ten:
         type: MOD
         props:
           sharding-count: 10
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   ```
   ### Example codes for reproduce this issue (such as a github link).
   ```
   sysbench oltp_point_select --mysql-host=10.16.9.224 --mysql-port=3333 
--mysql-user=root --mysql-password='' --mysql-db=proxy_sysbench_four 
--db-driver=mysql --tables=1 --table-size=40000000 --report-interval=5 
--threads=200 --time=60 --mysql-ignore-errors='' prepare
   ```
   https://github.com/apache/shardingsphere/issues/1453


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to