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/10/10 06:42:42 UTC

[GitHub] [shardingsphere] TeslaCN opened a new issue, #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master 4951c4c83147ff2b18b49f2834e51d5dda7382c8
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   MySQL Proxy
   
   ### Expected behavior
   
   No exception occurs when executing DistSQL.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ```
   jdbc:mysql://127.0.0.1:13306/sbtest?useServerPrepStmts=true&cachePrepStmts=true
   ```
   
   ```
   try (PreparedStatement preparedStatement = connection.prepareStatement("SHOW RESOURCES")) {
       try (ResultSet rs = preparedStatement.executeQuery()) {
       }
   }
   ```
   
   ### Actual behavior
   
   The query worked because MySQL JDBC driver request query directly as fallback after prepare statement failed.
   
   ![image](https://user-images.githubusercontent.com/20503072/136782845-88f96e86-6e78-4223-befa-fea17497a6b2.png)
   
   
   ```
   [ERROR] 2021-10-11 19:23:13.137 [ShardingSphere-Command-0] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
   com.google.common.util.concurrent.UncheckedExecutionException: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
   	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2051)
   	at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
   	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
   	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
   	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964)
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:48)
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:69)
   	at org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:58)
   	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.binary.prepare.MySQLComStmtPrepareExecutor.execute(MySQLComStmtPrepareExecutor.java:64)
   	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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
   	at java.base/java.lang.Thread.run(Thread.java:833)
   Caused by: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have an error in your SQL syntax
   	at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:68)
   	at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:49)
   	at org.apache.shardingsphere.sql.parser.api.SQLParserEngine.parse(SQLParserEngine.java:51)
   	at org.apache.shardingsphere.infra.parser.sql.SQLStatementParserExecutor.parse(SQLStatementParserExecutor.java:47)
   	at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:40)
   	at org.apache.shardingsphere.infra.parser.cache.SQLStatementCacheLoader.load(SQLStatementCacheLoader.java:29)
   	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)
   	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)
   	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
   	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
   	... 13 common frames omitted
   ```
   
   ### Reason analyze (If you can)
   
   
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.apache.org

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


[GitHub] [shardingsphere] github-actions[bot] closed issue #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy
URL: https://github.com/apache/shardingsphere/issues/12990


-- 
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] TeslaCN closed issue #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy
URL: https://github.com/apache/shardingsphere/issues/12990


-- 
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] github-actions[bot] commented on issue #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #12990:
URL: https://github.com/apache/shardingsphere/issues/12990#issuecomment-1272350712

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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] TeslaCN commented on issue #12990: Execute DistSQL using PreparedStatement cause SQLParsingException in MySQL Proxy

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

   DistSQL is not allowed to be executed by server prepared statement. Client would hide the error and retry by text protocol. So we need to fix nothing for this.


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