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 2020/02/24 10:57:52 UTC

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #4444: #4255, column definition information for mysql_stmt_prepare

terrymanu commented on a change in pull request #4444: #4255, column definition information for mysql_stmt_prepare
URL: https://github.com/apache/incubator-shardingsphere/pull/4444#discussion_r383199511
 
 

 ##########
 File path: sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
 ##########
 @@ -48,26 +49,33 @@ public MySQLComStmtPrepareExecutor(final MySQLComStmtPreparePacket packet, final
         logicSchema = backendConnection.getLogicSchema();
     }
     
+    private int getColumnsCount(final SQLStatement sqlStatement) {
+        if (sqlStatement instanceof SelectStatement) {
+            return ((SelectStatement) sqlStatement).getProjections().getProjections().size();
+        }
+        return 0;
 
 Review comment:
   Replace if else return and assign statement with ternary operator in priority

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services