Search in sources :

Example 6 with CairoException

use of io.questdb.cairo.CairoException in project questdb by bluestreak01.

the class TypeManagerTest method testIllegalParameterForGetTypeAdapter.

private void testIllegalParameterForGetTypeAdapter(int columnType) {
    TextConfiguration textConfiguration = new DefaultTextConfiguration();
    TypeManager typeManager = new TypeManager(textConfiguration, utf8Sink);
    try {
        typeManager.getTypeAdapter(columnType);
        Assert.fail();
    } catch (CairoException e) {
        TestUtils.assertContains(e.getFlyweightMessage(), "no adapter for type");
    }
}
Also used : DefaultTextConfiguration(io.questdb.cutlass.text.DefaultTextConfiguration) CairoException(io.questdb.cairo.CairoException) TextConfiguration(io.questdb.cutlass.text.TextConfiguration) DefaultTextConfiguration(io.questdb.cutlass.text.DefaultTextConfiguration)

Example 7 with CairoException

use of io.questdb.cairo.CairoException in project questdb by bluestreak01.

the class DropTableTest method testDropBusyReader.

@Test
public void testDropBusyReader() throws Exception {
    assertMemoryLeak(() -> {
        CompiledQuery cc = compiler.compile("create table 'large table' (a int)", sqlExecutionContext);
        Assert.assertEquals(CompiledQuery.CREATE_TABLE, cc.getType());
        try (RecordCursorFactory factory = compiler.compile("'large table'", sqlExecutionContext).getRecordCursorFactory()) {
            try (RecordCursor ignored = factory.getCursor(sqlExecutionContext)) {
                compiler.compile("drop table 'large table'", sqlExecutionContext);
            }
        } catch (CairoException e) {
            TestUtils.assertContains(e.getFlyweightMessage(), "Could not lock");
        }
    });
}
Also used : RecordCursorFactory(io.questdb.cairo.sql.RecordCursorFactory) RecordCursor(io.questdb.cairo.sql.RecordCursor) CairoException(io.questdb.cairo.CairoException) Test(org.junit.Test)

Aggregations

CairoException (io.questdb.cairo.CairoException)7 Test (org.junit.Test)5 RecordCursorFactory (io.questdb.cairo.sql.RecordCursorFactory)2 MemoryARW (io.questdb.cairo.vm.api.MemoryARW)2 AbstractCairoTest (io.questdb.cairo.AbstractCairoTest)1 CairoError (io.questdb.cairo.CairoError)1 EntryUnavailableException (io.questdb.cairo.EntryUnavailableException)1 TableWriter (io.questdb.cairo.TableWriter)1 ReaderOutOfDateException (io.questdb.cairo.sql.ReaderOutOfDateException)1 RecordCursor (io.questdb.cairo.sql.RecordCursor)1 DefaultTextConfiguration (io.questdb.cutlass.text.DefaultTextConfiguration)1 TextConfiguration (io.questdb.cutlass.text.TextConfiguration)1 PeerDisconnectedException (io.questdb.network.PeerDisconnectedException)1 PeerIsSlowToReadException (io.questdb.network.PeerIsSlowToReadException)1 Path (io.questdb.std.str.Path)1