Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ ScratchPad.java
src/main/resources/ext-js/*.js
src/main/java/io/vertx/java/**/*.java
*.swp
generated/
bin/
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ public class CodePoint {
*/
public static final int QRYCLSIMP = 0x215D;

/**
* Query Blocking Factor (0x215F is also recognized as QRYOPTVAL)
*/
public static final int QRYBLKFCT = 0x215F;

/**
* Query Scroll Orientation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,15 @@ private void parseOPNQRYRM(boolean isOPNQRYreply) {
ddmLength = adjustDdmLength(ddmLength, length);
peekCP = peekCodePoint();
}

if (peekCP == CodePoint.QRYBLKFCT) {
// @MJS added
foundInPass = true;
length = peekedLength_;
parseFastQRYBLKFCT();
ddmLength = adjustDdmLength(ddmLength, length);
peekCP = peekCodePoint();
}


if (!foundInPass) {
Expand Down Expand Up @@ -2328,6 +2337,12 @@ private int parseFastQRYATTISOL() {
matchCodePoint(CodePoint.QRYATTISOL);
return readUnsignedShort();
}

private int parseFastQRYBLKFCT() {
//@MJS added
matchCodePoint(CodePoint.QRYBLKFCT);
return readFastInt();
}

private int parseFastQRYATTSNS() {
matchCodePoint(CodePoint.QRYATTSNS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@
@RunWith(VertxUnitRunner.class)
public class QueryVariationsTest extends DB2TestBase {

@Test
public void testFetchFirst(TestContext ctx) {
connect(ctx.asyncAssertSuccess(conn -> {
conn.query("select message from immutable order by id fetch first 1 rows only").execute(
ctx.asyncAssertSuccess(rowSet -> {
ctx.assertEquals(1, rowSet.size());
ctx.assertEquals(Arrays.asList("MESSAGE"), rowSet.columnsNames());
RowIterator<Row> rows = rowSet.iterator();
ctx.assertTrue(rows.hasNext());
Row row = rows.next();
ctx.assertEquals("fortune: No such file or directory", row.getString(0));
ctx.assertFalse(rows.hasNext());
conn.close();
}));
}));
}

@Test
public void testRenamedColumns(TestContext ctx) {
connect(ctx.asyncAssertSuccess(conn -> {
Expand Down