use of org.h2.test.unit.TestCache in project h2database by h2database.
the class TestView method testCache.
private void testCache() throws SQLException {
deleteDb("view");
Connection conn = getConnection("view");
Statement stat = conn.createStatement();
stat.execute("SET @X 8");
stat.execute("CREATE VIEW V AS SELECT * FROM (SELECT @X)");
ResultSet rs;
rs = stat.executeQuery("SELECT * FROM V");
rs.next();
assertEquals(8, rs.getInt(1));
stat.execute("SET @X 5");
rs = stat.executeQuery("SELECT * FROM V");
rs.next();
assertEquals(5, rs.getInt(1));
conn.close();
}
Aggregations