TeslaCN opened a new issue #13141:
URL: https://github.com/apache/shardingsphere/issues/13141


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master - cda8c9b4026b94e4ca2437ab00d8fd3325b82f99
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   Proxy
   
   ### Expected behavior
   SQL preview result.
   
   ### Actual behavior
   
   MySQL Proxy
   ```
   [ERROR] 2021-10-19 17:34:12.268 [ShardingSphere-Command-0] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.IndexOutOfBoundsException: Index: 0
        at java.util.Collections$EmptyList.get(Collections.java:4456)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.getValue(ConditionValue.java:50)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.getValue(ConditionValue.java:41)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.<init>(ConditionValue.java:36)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.impl.ConditionValueCompareOperatorGenerator.generate(ConditionValueCompareOperatorGenerator.java:64)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValueGeneratorFactory.generate(ConditionValueGeneratorFactory.java:51)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditionValueMap(WhereClauseShardingConditionEngine.java:123)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:85)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:75)
        at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createShardingConditions(ShardingSQLRouter.java:66)
        at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:50)
        at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:44)
        at 
org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:62)
        at 
org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:52)
        at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54)
        at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46)
        at 
org.apache.shardingsphere.proxy.backend.text.distsql.ral.advanced.PreviewDistSQLBackendHandler.execute(PreviewDistSQLBackendHandler.java:84)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:57)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:99)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
        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)
   ```
   
   
   PostgreSQL Proxy
   ```
   [ERROR] 2021-10-19 17:35:16.747 [Connection-3-ThreadExecutor] 
o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   java.lang.IndexOutOfBoundsException: Index: 0
        at java.util.Collections$EmptyList.get(Collections.java:4456)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.getValue(ConditionValue.java:50)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.getValue(ConditionValue.java:41)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValue.<init>(ConditionValue.java:36)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.impl.ConditionValueCompareOperatorGenerator.generate(ConditionValueCompareOperatorGenerator.java:64)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.generator.ConditionValueGeneratorFactory.generate(ConditionValueGeneratorFactory.java:51)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditionValueMap(WhereClauseShardingConditionEngine.java:123)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:85)
        at 
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.WhereClauseShardingConditionEngine.createShardingConditions(WhereClauseShardingConditionEngine.java:75)
        at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createShardingConditions(ShardingSQLRouter.java:66)
        at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:50)
        at 
org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:44)
        at 
org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:62)
        at 
org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:52)
        at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54)
        at 
org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46)
        at 
org.apache.shardingsphere.proxy.backend.text.distsql.ral.advanced.PreviewDistSQLBackendHandler.execute(PreviewDistSQLBackendHandler.java:84)
        at 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.text.PostgreSQLComQueryExecutor.execute(PostgreSQLComQueryExecutor.java:71)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:99)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
        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)
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   Preview any SQL with placeholder.
   ```sql
   preview select * from t where id = ?
   ```
   


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