@Test public void testBlobOverLimit() throws Exception { TestUtils.assertMemoryLeak(() -> { final CountDownLatch haltLatch = new CountDownLatch(1); final AtomicBoolean running = new AtomicBoolean(true); try { startBasicServer(NetworkFacadeImpl.INSTANCE, new DefaultPGWireConfiguration() { @Override public int getMaxBlobSizeOnQuery() { return 150; } }, haltLatch, running ); Properties properties = new Properties(); properties.setProperty("user", "admin"); properties.setProperty("password", "quest"); final Connection connection = DriverManager.getConnection("jdbc:postgresql: Statement statement = connection.createStatement(); try { statement.executeQuery( "select " + "rnd_str(4,4,4) s, " + "rnd_int(0, 256, 4) i, " + "rnd_double(4) d, " + "timestamp_sequence(0,10000) t, " + "rnd_float(4) f, " + "rnd_short() _short, " + "rnd_long(0, 10000000, 5) l, " + "rnd_timestamp(to_timestamp('2015','yyyy'),to_timestamp('2016','yyyy'),2) ts2, " + "rnd_byte(0,127) bb, " + "rnd_boolean() b, " + "rnd_symbol(4,4,4,2), " + "rnd_date(to_date('2015', 'yyyy'), to_date('2016', 'yyyy'), 2)," + "rnd_bin(1024,2048,2) " + "from long_sequence(50)"); Assert.fail(); } catch (PSQLException e) { Assert.assertEquals("blob is too large [blobSize=1903, max=150, columnIndex=12]", e.getServerErrorMessage().getMessage()); } connection.close(); } finally { running.set(false); haltLatch.await(); } }); }
@Override public void close() { Misc.free(compiler); }
PGJobContext implements Closeable { @Override public void close() { Misc.free(compiler); } }
PGJobContext implements Closeable { @Override public void close() { Misc.free(compiler); } PGJobContext(PGWireConfiguration configuration, CairoEngine engine, MessageBus messageBus, FunctionFactoryCache functionFactoryCache); }
PGJobContext implements Closeable { @Override public void close() { Misc.free(compiler); } PGJobContext(PGWireConfiguration configuration, CairoEngine engine, MessageBus messageBus, FunctionFactoryCache functionFactoryCache); @Override void close(); void handleClientOperation(PGConnectionContext context); }
PGJobContext implements Closeable { @Override public void close() { Misc.free(compiler); } PGJobContext(PGWireConfiguration configuration, CairoEngine engine, MessageBus messageBus, FunctionFactoryCache functionFactoryCache); @Override void close(); void handleClientOperation(PGConnectionContext context); static final int PG_VARCHAR; static final int PG_TIMESTAMP; static final int PG_TIMESTAMPZ; static final int PG_FLOAT8; static final int PG_FLOAT4; static final int PG_INT4; static final int PG_INT2; static final int PG_INT8; static final int PG_NUMERIC; static final int PG_BOOL; static final int PG_CHAR; static final int PG_DATE; static final int PG_BYTEA; static final int PG_UNSPECIFIED; }