xtern commented on code in PR #5264:
URL: https://github.com/apache/ignite-3/pull/5264#discussion_r1969430391
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>>
processNext() {
});
}
});
+ } catch (TxControlInsideExternalTxNotSupportedException txEx) {
Review Comment:
It looks like this fixes the problem with handling
`TxControlInsideExternalTxNotSupportedException` (but we still need to open a
ticket to think about what to do with similar cases, for example select ..;
insert .. 1/0).
If it is decided that this fix is suitable (for me it looks good), I would
recommend changing the test so that it immediately fails if the behavior
changes.
e.g. instead of "SELECT 1; COMMIT"
read several pages, something like that
```java
boolean res = stmt.execute("SELECT x FROM TABLE(SYSTEM_RANGE(0,
10000));COMMIT");
assertTrue(res);
assertNotNull(stmt.getResultSet());
try (ResultSet rs = stmt.getResultSet()) {
while (rs.next()) {
// no-op.
}
}
```
what do you think?
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/fsm/MultiStatementHandler.java:
##########
@@ -239,6 +240,16 @@ CompletableFuture<AsyncSqlCursor<InternalSqlRow>>
processNext() {
});
}
});
+ } catch (TxControlInsideExternalTxNotSupportedException txEx) {
+ scriptTxContext.onError(txEx);
+
+ cursorFuture.completeExceptionally(txEx);
+
+ scriptStatement.cursorFuture.completeExceptionally(new
SqlException(
Review Comment:
Isn't `cursorFuture` the same thing as the `scriptStatement.cursorFuture`?
--
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]