You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2024/05/08 13:37:04 UTC
Re: [PR] IGNITE-21167 Sql. Jdbc. Raise a clearer error message when the tx control statement is used in non-autocommit mode [ignite-3]
zstan commented on code in PR #3700:
URL: https://github.com/apache/ignite-3/pull/3700#discussion_r1594047058
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcMultiStatementSelfTest.java:
##########
@@ -422,11 +408,18 @@ public void testAutoCommitFalse() throws Exception {
}
@Test
- @Disabled("https://issues.apache.org/jira/browse/IGNITE-21167")
- public void testAutoCommitFalseWithEmptyTx() throws Exception {
- String txErrMsg = "Transaction control statement cannot be executed within an external transaction";
+ @SuppressWarnings("ThrowableNotThrown")
+ public void testAutoCommitFalseTxControlStatementsNotSupported() throws Exception {
+ String txErrMsg = "Transaction control statements are not supported when autocommit mode is disabled";
conn.setAutoCommit(false);
- assertThrowsSqlException(txErrMsg, () -> stmt.execute("START TRANSACTION; SELECT 1; COMMIT;"));
+ assertThrowsSqlException(txErrMsg, () -> stmt.execute("START TRANSACTION; SELECT 1; COMMIT"));
+ assertThrowsSqlException(txErrMsg, () -> stmt.execute("COMMIT"));
+ assertThrowsSqlException(txErrMsg, () -> stmt.execute("START TRANSACTION"));
+
+ boolean res = stmt.execute("SELECT 1;COMMIT");
Review Comment:
seems we already have such a tests, it need to be merged or compound somehow
testAutoCommitFalseNonCompleted
--
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-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org