korlov42 commented on code in PR #5143:
URL: https://github.com/apache/ignite-3/pull/5143#discussion_r1939492225


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -141,14 +143,31 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>> 
processNext() {
                                 new 
IteratorToDataCursorAdapter<>(Collections.emptyIterator()),
                                 nextCurFut
                         ));
+            } else if (parsedResult.queryType() == SqlQueryType.DDL) {
+                List<ParsedResultWithNextCursorFuture> ddlBatch = new 
ArrayList<>();
+
+                do {
+                    ddlBatch.add(new 
ParsedResultWithNextCursorFuture(scriptStatement.parsedResult, 
scriptStatement.nextStatementFuture));
+
+                    ScriptStatement statement = statements.peek();
+                    if (statement == null || 
statement.parsedResult.queryType() != SqlQueryType.DDL) {
+                        break;
+                    }
+
+                    scriptStatement = statement;
+
+                    statements.poll();
+                } while (true);
+
+                fut = query.executor.executeChildBatch(query, scriptTxContext, 
statementNum, ddlBatch);
             } else {
                 scriptTxContext.registerCursorFuture(parsedResult.queryType(), 
cursorFuture);
 
                 fut = query.executor.executeChildQuery(query, scriptTxContext, 
statementNum, parsedResult, params, nextCurFut);
             }
 
             boolean implicitTx = scriptTxContext.explicitTx() == null;
-
+            ScriptStatement lastProcessedStatement = scriptStatement;

Review Comment:
   replaced, thanks for suggestion



-- 
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-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to