FlyingZC commented on code in PR #19834:
URL: https://github.com/apache/shardingsphere/pull/19834#discussion_r936710660


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/ProxyBackendHandlerFactory.java:
##########
@@ -106,16 +107,14 @@ public static ProxyBackendHandler newInstance(final 
DatabaseType databaseType, f
         
databaseType.handleRollbackOnly(connectionSession.getTransactionStatus().isRollbackOnly(),
 sqlStatement);
         checkUnsupportedSQLStatement(sqlStatement);
         if (sqlStatement instanceof DistSQLStatement) {
-            if (connectionSession.getTransactionStatus().isInTransaction() && 
!(sqlStatement instanceof RQLStatement || sqlStatement instanceof 
QueryableRALStatement)) {
-                throw new UnsupportedOperationException("Non-query dist sql is 
not supported within a transaction");
-            }
+            checkUnsupportedDistSQLStatementInTransaction(sqlStatement, 
connectionSession);
             return DistSQLBackendHandlerFactory.newInstance((DistSQLStatement) 
sqlStatement, connectionSession);
         }
         SQLStatementContext<?> sqlStatementContext = 
SQLStatementContextFactory.newInstance(ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaData().getDatabases(),
                 sqlStatement, connectionSession.getDefaultDatabaseName());
         return newInstance(databaseType, new LogicSQL(sqlStatementContext, 
sql, Collections.emptyList()), connectionSession, false);
     }
-    
+

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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to