You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zuohl (via GitHub)" <gi...@apache.org> on 2023/06/18 14:31:47 UTC

[GitHub] [shardingsphere] zuohl opened a new pull request, #26419: Update ProxyBackendHandlerFactory.java

zuohl opened a new pull request, #26419:
URL: https://github.com/apache/shardingsphere/pull/26419

   Solve the error of java.lang.NullPointerException: Cannot invoke "String.toLowerCase()" because "databaseName" is null
   when executing sql like : SHOW VARIABLES LIKE 'lower_case_%'
   
   Fixes #ISSUSE_ID.
   
   Changes proposed in this pull request:
     -
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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] zhaojinchao95 merged pull request #26419: fix proxy java.lang.NullPointerException

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 merged PR #26419:
URL: https://github.com/apache/shardingsphere/pull/26419


-- 
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] zhaojinchao95 commented on a diff in pull request #26419: fix proxy java.lang.NullPointerException

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on code in PR #26419:
URL: https://github.com/apache/shardingsphere/pull/26419#discussion_r1233320432


##########
kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngine.java:
##########
@@ -191,6 +191,9 @@ private ExecutionPlanCacheKey buildCacheKey(final SQLFederationExecutorContext f
     private void registerTableScanExecutor(final Schema sqlFederationSchema, final DriverExecutionPrepareEngine<JDBCExecutionUnit, Connection> prepareEngine,
                                            final JDBCExecutorCallback<? extends ExecuteResult> callback, final SQLFederationExecutorContext federationContext,
                                            final OptimizerContext optimizerContext) {
+        if (sqlFederationSchema == null) {

Review Comment:
   Please change to `null == sqlFederationSchema`



-- 
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] zuohl commented on a diff in pull request #26419: fix proxy java.lang.NullPointerException

Posted by "zuohl (via GitHub)" <gi...@apache.org>.
zuohl commented on code in PR #26419:
URL: https://github.com/apache/shardingsphere/pull/26419#discussion_r1233321193


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java:
##########
@@ -156,6 +156,9 @@ public static ProxyBackendHandler newInstance(final DatabaseType databaseType, f
         String databaseName = sqlStatementContext.getTablesContext().getDatabaseName().isPresent()
                 ? sqlStatementContext.getTablesContext().getDatabaseName().get()
                 : connectionSession.getDatabaseName();
+        if (databaseName == null) {

Review Comment:
   ok



-- 
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] zhaojinchao95 commented on a diff in pull request #26419: fix proxy java.lang.NullPointerException

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on code in PR #26419:
URL: https://github.com/apache/shardingsphere/pull/26419#discussion_r1233320391


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java:
##########
@@ -156,6 +156,9 @@ public static ProxyBackendHandler newInstance(final DatabaseType databaseType, f
         String databaseName = sqlStatementContext.getTablesContext().getDatabaseName().isPresent()
                 ? sqlStatementContext.getTablesContext().getDatabaseName().get()
                 : connectionSession.getDatabaseName();
+        if (databaseName == null) {

Review Comment:
   Please change to `null == databaseName`



-- 
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] zuohl commented on pull request #26419: Update ProxyBackendHandlerFactory.java

Posted by "zuohl (via GitHub)" <gi...@apache.org>.
zuohl commented on PR #26419:
URL: https://github.com/apache/shardingsphere/pull/26419#issuecomment-1596170751

   Fixes #26420


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