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


##########
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:
   <img width="900" alt="image" 
src="https://user-images.githubusercontent.com/19788130/182631921-747c8a97-44e3-40a1-9bb8-59cc70a40590.png";>
   
   The content of this line is the same as before, the modification of this 
line you see comes from my first commit.



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