Skip to content

Commit

Permalink
Add test for rollback behavior of catalogs with materialized views
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Dec 19, 2024
1 parent 207978e commit eb9193b
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1312,4 +1312,31 @@ public void testMaterializedViewFromView() throws SQLException {
}
}


@Test
public void testMaterializedViewRollback() throws SQLException {
try ( JdbcConnection polyphenyDbConnection = new JdbcConnection( false ) ) {
Connection connection = polyphenyDbConnection.getConnection();
try ( Statement statement = connection.createStatement() ) {
statement.executeUpdate( VIEW_TEST_EMP_TABLE_SQL );

try {
statement.executeUpdate( "CREATE MATERIALIZED VIEW viewTestEmp AS SELECT * FROM viewTestEmpTable" );
statement.executeUpdate( "CREATE MATERIALIZED VIEW viewTestEmp1 AS SELECT * FROM viewTestEmpTable" );
statement.executeUpdate( VIEW_TEST_EMP_TABLE_DATA_SQL );

// Force a rollback of the catalog
connection.rollback();

// Drop the materialized views
statement.executeUpdate( "DROP MATERIALIZED VIEW viewTestEmp" );
statement.executeUpdate( "DROP MATERIALIZED VIEW viewTestEmp1" );
} finally {
statement.executeUpdate( "DROP TABLE viewTestEmpTable" );
dropTables( statement );
}
}
}
}

}

0 comments on commit eb9193b

Please sign in to comment.