tristaZero commented on a change in pull request #10351:
URL: https://github.com/apache/shardingsphere/pull/10351#discussion_r634033162
##########
File path:
shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
##########
@@ -54,13 +54,18 @@
public Collection<ExecuteResult> execute(final
ExecutionGroupContext<RawSQLExecutionUnit> executionGroupContext,
final SQLStatementContext<?>
sqlStatementContext,
final RawSQLExecutorCallback
callback) throws SQLException {
- ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext);
- // TODO Load query header for first query
- List<ExecuteResult> results = execute(executionGroupContext,
(RawSQLExecutorCallback) null, callback);
- if (null == results || results.isEmpty() || null == results.get(0)) {
- return Collections.singleton(new UpdateResult(0, 0L));
+ try {
+ ExecuteProcessEngine.initialize(sqlStatementContext,
executionGroupContext);
+ // TODO Load query header for first query
+ List<ExecuteResult> results = execute(executionGroupContext,
(RawSQLExecutorCallback) null, callback);
+
ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
+ if (null == results || results.isEmpty() || null ==
results.get(0)) {
+ return Collections.singleton(new UpdateResult(0, 0L));
+ }
+ return results;
Review comment:
It will become better to merge these statements into one ternary
operator expression.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]