Copilot commented on code in PR #37391:
URL: https://github.com/apache/shardingsphere/pull/37391#discussion_r2620350554


##########
proxy/backend/dialect/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/factory/withoutfrom/MySQLSelectWithoutFromAdminExecutorFactory.java:
##########
@@ -93,9 +93,17 @@ private static Optional<DatabaseAdminExecutor> 
mockExecutor(final SelectStatemen
             return Optional.of(new NoResourceShowExecutor(sqlStatement));
         }
         boolean isUseDatabase = null != databaseName || 
sqlStatement.getFrom().isPresent();
+        if (!isUseDatabase && isMultiExpressionSelect(sqlStatement)) {
+            return Optional.empty();
+        }
         return isUseDatabase ? Optional.empty() : Optional.of(new 
UnicastResourceShowExecutor(sqlStatement, sql));
     }
     
+    private static boolean isMultiExpressionSelect(final SelectStatement 
sqlStatement) {

Review Comment:
   The method name `isMultiExpressionSelect` is ambiguous as it only checks if 
there are multiple projections, not specifically expressions. Consider renaming 
to `hasMultipleProjections` to more accurately reflect what the method 
validates.
   ```suggestion
           if (!isUseDatabase && hasMultipleProjections(sqlStatement)) {
               return Optional.empty();
           }
           return isUseDatabase ? Optional.empty() : Optional.of(new 
UnicastResourceShowExecutor(sqlStatement, sql));
       }
       
       private static boolean hasMultipleProjections(final SelectStatement 
sqlStatement) {
   ```



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