@Test public void testPreparedStatement() throws Exception { TestUtils.assertMemoryLeak(() -> { final CountDownLatch haltLatch = new CountDownLatch(1); final AtomicBoolean running = new AtomicBoolean(true); try { startBasicServer( NetworkFacadeImpl.INSTANCE, new DefaultPGWireConfiguration(), haltLatch, running ); Properties properties = new Properties(); properties.setProperty("user", "admin"); properties.setProperty("password", "quest"); properties.setProperty("sslmode", "disable"); properties.setProperty("binaryTransfer", "false"); final Connection connection = DriverManager.getConnection("jdbc:postgresql: PreparedStatement statement = connection.prepareStatement("select 1,2,3 from long_sequence(1)"); Statement statement1 = connection.createStatement(); final String expected = "1[INTEGER],2[INTEGER],3[INTEGER]\n" + "1,2,3\n"; StringSink sink = new StringSink(); for (int i = 0; i < 10; i++) { sink.clear(); ResultSet rs = statement.executeQuery(); statement1.executeQuery("select 1 from long_sequence(2)"); assertResultSet(expected, sink, rs); rs.close(); } 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; }