use of io.questdb.cairo.sql.ReaderOutOfDateException in project questdb by bluestreak01.
the class TruncateTest method testDropColumnWithCachedPlan.
private void testDropColumnWithCachedPlan() throws Exception {
assertMemoryLeak(() -> {
compiler.compile("create table y as (" + "select timestamp_sequence(0, 1000000000) timestamp," + " rnd_symbol('a','b',null) symbol1 " + " from long_sequence(10)" + ") timestamp (timestamp)", sqlExecutionContext);
try (RecordCursorFactory factory = compiler.compile("select * from y", sqlExecutionContext).getRecordCursorFactory()) {
try (RecordCursor cursor = factory.getCursor(sqlExecutionContext)) {
sink.clear();
TestUtils.printCursor(cursor, factory.getMetadata(), true, sink, printer);
}
compiler.compile("alter table y drop column symbol1", sqlExecutionContext);
try (RecordCursor cursor = factory.getCursor(sqlExecutionContext)) {
TestUtils.printCursor(cursor, factory.getMetadata(), true, sink, printer);
Assert.fail();
} catch (ReaderOutOfDateException e) {
TestUtils.assertContains(e.getFlyweightMessage(), "cannot be used because table schema has changed [table='y']");
}
}
});
}
Aggregations