xtern commented on code in PR #2846:
URL: https://github.com/apache/ignite-3/pull/2846#discussion_r1409481737
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItSqlMultiStatementTest.java:
##########
@@ -138,131 +132,73 @@ void
queryWithIncorrectNumberOfDynamicParametersFailsWithValidationError() {
assertThrowsSqlException(STMT_VALIDATION_ERR, expectedMessage, () ->
runScript(sql, null, 0, 1, 2, 3, 4, 5));
}
- @Test
- void transactionControlStatementDoesNotCreateCursor() {
- assertThat(runScript("START TRANSACTION; COMMIT"), nullValue());
-
- AsyncSqlCursor<List<Object>> cursor = runScript(
- "START TRANSACTION;"
- + "SELECT 1;"
- + "COMMIT"
- );
-
- assertNotNull(cursor);
- validateSingleResult(cursor, 1);
-
- assertFalse(cursor.hasNextResult());
- }
-
@Test
void scriptStopsExecutionOnError() {
// Runtime error.
- AsyncSqlCursor<List<Object>> cursor = runScript(
- "CREATE TABLE test (id INT PRIMARY KEY);"
- + "SELECT 2/0;" // Runtime error.
- + "INSERT INTO test VALUES (0)"
- );
- assertNotNull(cursor);
- assertTrue(cursor.hasNextResult());
-
- CompletableFuture<AsyncSqlCursor<List<Object>>> curFut0 =
cursor.nextResult();
- assertThrowsSqlException(RUNTIME_ERR, "/ by zero", () ->
await(curFut0));
+ {
+ AsyncSqlCursor<List<Object>> cursor = runScript(
+ "CREATE TABLE test (id INT PRIMARY KEY);"
+ + "SELECT 2/0;" // Runtime error.
+ + "INSERT INTO test VALUES (0)"
+ );
+ assertTrue(cursor.hasNextResult());
Review Comment:
```
fetchAllCursors(runScript(
"CREATE TABLE test1 (id INT PRIMARY KEY);"
+ "SELECT 2/0;" // Runtime error.
));
```
tries to fetch ALL cursors and throws the first exception.
You don't need it if you want check only the second cursor result.
```
AsyncSqlCursor<List<Object>> cursor = runScript(
"CREATE TABLE test1 (id INT PRIMARY KEY);"
+ "SELECT 2/0;" // Runtime error.
);
validateSingleResult(cursor, true);
```
works fine
--
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]