Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,17 @@ public void testInferDataTypeLazy42P18(TestContext ctx) {
}));
}

@Test
public void testCloseLazyPreparedStatementNotExecuted42P18(TestContext ctx) {
PgConnection.connect(vertx, options()).onComplete(ctx.asyncAssertSuccess(conn -> {
conn
.prepare("SELECT CONCAT('HELLO', $1)")
.compose(PreparedStatement::close)
.eventually(() -> conn.close())
.onComplete(ctx.asyncAssertSuccess());
}));
}

@Test
public void testInferDataTypeFailure42P18(TestContext ctx) {
PgConnection.connect(vertx, options()).onComplete(ctx.asyncAssertSuccess(conn -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ protected void close(Promise<Void> promise) {
promise.fail(ar.cause());
}
});
} else {
// Never executed, so never prepared: nothing to close, and it must not be prepared afterwards
future = context.failedFuture("Prepared statement closed");
promise.complete();
}
}
@Override
Expand Down