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/05/19 08:56:15 UTC
[GitHub] [shardingsphere] TeslaCN commented on a diff in pull request #17611: Fix the exception when specifying schema when JDBC connects to Proxy
TeslaCN commented on code in PR #17611:
URL: https://github.com/apache/shardingsphere/pull/17611#discussion_r876798582
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/MySQLAdminExecutorCreator.java:
##########
@@ -159,14 +159,12 @@ private boolean isQuerySpecialSchema(final SelectStatement sqlStatement, final S
private DatabaseAdminExecutor mockExecutor(final String schemaName, final SelectStatement sqlStatement, final String sql) {
boolean isNotUseSchema = !Optional.ofNullable(schemaName).isPresent() && sqlStatement.getFrom() == null;
+ if (!hasDatabases() || !hasResources()) {
+ return new NoResourceShowExecutor(sqlStatement);
+ }
+ String driverType = ProxyContext.getInstance().getContextManager().getMetaDataContexts().getProps().getValue(ConfigurationPropertyKey.PROXY_BACKEND_DRIVER_TYPE);
Review Comment:
Getting driver type can be moved into `if (isNotUseSchema)` block to reduce unnecessary overhead since `isNotUseSchema` is not always `true`.
--
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