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 @@ -66,6 +66,13 @@ public void testStreamQuery(TestContext ctx) {
super.testStreamQuery(ctx);
}

@Test
@Ignore("Fetch command not supported by ProxySQL")
@Override
public void testStreamQueryWithoutEndHandler(TestContext ctx) {
super.testStreamQueryWithoutEndHandler(ctx);
}

@Test
@Ignore("Fetch command not supported by ProxySQL")
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ private void checkPending() {
cursor.close();
Handler<Void> eh = endHandler;
handler = v -> {
eh.handle(null);
if (eh != null) {
eh.handle(null);
}
synchronized (RowStreamImpl.this) {
cursor = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,25 @@ public void testStreamQuery(TestContext ctx) {
});
}

@Test
public void testStreamQueryWithoutEndHandler(TestContext ctx) {
vertx.exceptionHandler(ctx::fail);
Async async = ctx.async();
testCursor(ctx, conn -> {
conn.prepare("SELECT * FROM immutable").onComplete(ctx.asyncAssertSuccess(ps -> {
RowStream<Row> stream = ps.createStream(4, Tuple.tuple());
AtomicInteger rows = new AtomicInteger();
stream.exceptionHandler(ctx::fail);
stream.handler(row -> {
if (rows.incrementAndGet() == 12) {
// The stream ends after the last row: give it time to do so without an end handler
vertx.setTimer(100, id -> async.complete());
}
});
}));
});
}

@Test
public void testStreamQueryNoResults(TestContext ctx) {
Async async = ctx.async();
Expand Down