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 2021/07/23 03:27:01 UTC

[GitHub] [shardingsphere] menghaoranss commented on a change in pull request #11464: fix exception when sql without table

menghaoranss commented on a change in pull request #11464:
URL: https://github.com/apache/shardingsphere/pull/11464#discussion_r675285741



##########
File path: shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
##########
@@ -113,6 +113,9 @@ public SelectStatementContext(final Map<String, ShardingSphereMetaData> metaData
     private ShardingSphereSchema getSchema(final Map<String, ShardingSphereMetaData> metaDataMap, final String defaultSchemaName) {
         String schemaName = tablesContext.getSchemaName().orElse(defaultSchemaName);
         ShardingSphereMetaData metaData = metaDataMap.get(schemaName);
+        if (null == metaData && tablesContext.getTables().isEmpty()) {
+            return null;
+        }
         Preconditions.checkState(null != metaData, "Can not get meta data by schema mame `%s`.", schemaName);

Review comment:
       Unnecessary code




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