Skip to content

Commit

Permalink
[misc] correcting test for maxscale
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Nov 7, 2022
1 parent daa3b6e commit de514c8
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -830,7 +830,7 @@ private void testMoveToInsertRow(Connection con) throws SQLException {
Statement stmt = con.createStatement();
stmt.execute("DROP TABLE IF EXISTS testMoveToInsertRow");
stmt.execute("CREATE TABLE testMoveToInsertRow(t2 text, t1 text, id int primary key)");

stmt.execute("START TRANSACTION"); // if MAXSCALE ensure using WRITER
try (PreparedStatement preparedStatement =
con.prepareStatement(
"select id, t1, t2 from testMoveToInsertRow",
Expand Down Expand Up @@ -872,8 +872,12 @@ private void testMoveToInsertRow(Connection con) throws SQLException {
assertEquals(3, rs.getInt("id"));
assertEquals("other-t1-value", rs.getString("t1"));
assertNull(rs.getString("t2"));
} finally {
con.commit();
}

stmt = sharedConn.createStatement();
stmt.execute("START TRANSACTION"); // if MAXSCALE ensure using WRITER
try (PreparedStatement preparedStatement =
sharedConn.prepareStatement(
"select id, t1, t2 from testMoveToInsertRow",
Expand Down Expand Up @@ -913,6 +917,8 @@ private void testMoveToInsertRow(Connection con) throws SQLException {
assertTrue(rs.next());
assertEquals(5, rs.getInt("id"));
assertEquals("t1-5", rs.getString("t1"));
} finally {
sharedConn.rollback();
}
}

Expand Down

0 comments on commit de514c8

Please sign in to comment.