-
Notifications
You must be signed in to change notification settings - Fork 209
Closed
Description
Queries using fetch first 1 rows only
doesn't seem to work.
Query example:
select message from immutable order by id fetch first 1 rows only
Version
vertx-db2-client
versions 3.9.5
and 4.0.2
.
Context
Exception:
[2021-02-13 09:33:58] FINE io.vertx.db2client.impl.codec.DB2Decoder <<< DECODE io.vertx.db2client.impl.codec.InitialHandshakeCommandCodec@6bf9ad5d (432 bytes)
[2021-02-13 09:33:58] FINE io.vertx.db2client.impl.codec.DB2Encoder >>> ENCODE SimpleQueryCommandCodec@fe7e38d sql=select message from immutable order by id fetch first 1 rows only, section=null
[2021-02-13 09:33:58] FINE io.vertx.db2client.impl.codec.DB2Decoder <<< DECODE SimpleQueryCommandCodec@fe7e38d sql=select message from immutable order by id fetch first 1 rows only, section=io.vertx.db2client.impl.drda.Section@677ec5e7{packageName=SYSSH200, sectionNumber=1, cursorName=SQL_CURSH200C} (472 bytes)
[2021-02-13 09:33:58] FINE io.vertx.db2client.impl.drda.Section release Releasing section: io.vertx.db2client.impl.drda.Section@677ec5e7{packageName=SYSSH200, sectionNumber=1, cursorName=SQL_CURSH200C}
[2021-02-13 09:33:58] SEVERE io.vertx.db2client.impl.codec.DB2Decoder FATAL: Error parsing buffer at index 258 / 0x102
For command SimpleQueryCommandCodec@fe7e38d sql=select message from immutable order by id fetch first 1 rows only, section=io.vertx.db2client.impl.drda.Section@677ec5e7{packageName=SYSSH200, sectionNumber=1, cursorName=SQL_CURSH200C}
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 00 d6 d0 43 00 01 00 d0 24 11 00 00 00 00 00 30 |...C....$......0|
|00000010| 30 30 30 30 53 51 4c 31 31 30 35 30 00 00 00 00 |0000SQL11050....|
|00000020| 00 00 00 00 00 01 00 00 00 07 00 00 00 21 ff ff |.............!..|
|00000030| ff 00 00 00 00 20 20 20 20 20 20 20 20 20 20 20 |..... |
|00000040| 00 12 56 45 52 54 58 20 20 20 20 20 20 20 20 20 |..VERTX |
|00000050| 20 20 20 20 00 00 00 00 ff 00 01 00 00 00 00 00 | ............|
|00000060| 00 00 55 00 00 00 00 00 00 00 00 00 01 00 00 00 |..U.............|
|00000070| 00 00 00 08 00 00 00 00 00 00 c0 01 04 b8 00 00 |................|
|00000080| 00 00 07 4d 45 53 53 41 47 45 00 00 00 00 00 00 |...MESSAGE......|
|00000090| 00 00 00 00 ff 00 00 00 00 00 00 00 00 00 00 05 |................|
|000000a0| 56 45 52 54 58 00 09 49 4d 4d 55 54 41 42 4c 45 |VERTX..IMMUTABLE|
|000000b0| 00 00 00 09 49 4d 4d 55 54 41 42 4c 45 00 00 00 |....IMMUTABLE...|
|000000c0| 08 56 45 52 54 58 20 20 20 00 00 00 07 4d 45 53 |.VERTX ....MES|
|000000d0| 53 41 47 45 00 00 00 34 d0 52 00 02 00 2e 22 05 |SAGE...4.R....".|
|000000e0| 00 06 11 49 00 00 00 06 21 02 24 17 00 05 21 1f |...I....!.$...!.|
|000000f0| f1 00 05 21 50 01 00 0c 21 5b 00 00 00 00 00 00 |...!P...![......|
|00000100| 00 00 00 08 21 5f 00 00 00 01 00 1f d0 53 00 02 |....!_.......S..|
|00000110| 00 19 24 1a 06 76 d0 3e 08 00 09 71 e0 54 00 01 |..$..v.>...q.T..|
|00000120| d0 00 01 06 71 f0 e0 00 00 00 30 d0 53 00 02 00 |....q.....0.S...|
|00000130| 2a 24 1b ff 00 00 22 66 6f 72 74 75 6e 65 3a 20 |*$...."fortune: |
|00000140| 4e 6f 20 73 75 63 68 20 66 69 6c 65 20 6f 72 20 |No such file or |
|00000150| 64 69 72 65 63 74 6f 72 79 00 26 d0 52 00 02 00 |directory.&.R...|
|00000160| 20 22 0b 00 06 11 49 00 04 00 16 21 10 e5 c5 d9 | "....I....!....|
|00000170| e3 e7 40 40 40 40 40 40 40 40 40 40 40 40 40 00 |..@@@@@@@@@@@@@.|
|00000180| 59 d0 03 00 02 00 53 24 08 00 64 00 00 00 30 32 |Y.....S$..d...02|
|00000190| 30 30 30 53 51 4c 52 49 30 31 46 00 01 00 04 80 |000SQLRI01F.....|
|000001a0| 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|000001b0| 00 00 00 00 20 20 20 20 20 20 20 20 20 20 20 00 |.... .|
|000001c0| 12 56 45 52 54 58 20 20 20 20 20 20 20 20 20 20 |.VERTX |
|000001d0| 20 20 20 00 00 00 00 ff | ..... |
+--------+-------------------------------------------------+----------------+
java.lang.IllegalStateException: Found unknown codepoint: 0x215f / 8543
at io.vertx.db2client.impl.drda.DRDAResponse.throwUnknownCodepoint(DRDAResponse.java:847)
at io.vertx.db2client.impl.drda.DRDAQueryResponse.parseOPNQRYRM(DRDAQueryResponse.java:2224)
at io.vertx.db2client.impl.drda.DRDAQueryResponse.parseBeginOpenQuery(DRDAQueryResponse.java:163)
at io.vertx.db2client.impl.drda.DRDAQueryResponse.readBeginOpenQuery(DRDAQueryResponse.java:128)
at io.vertx.db2client.impl.codec.SimpleQueryCommandCodec.decodeQuery(SimpleQueryCommandCodec.java:76)
at io.vertx.db2client.impl.codec.QueryCommandBaseCodec.decodePayload(QueryCommandBaseCodec.java:69)
at io.vertx.db2client.impl.codec.DB2Decoder.decodePayload(DB2Decoder.java:80)
at io.vertx.db2client.impl.codec.DB2Decoder.decode(DB2Decoder.java:53)
Do you have a reproducer?
DavideD@e1d5ceb
Or, add this test to QueryVariationsTest
:
@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();
}));
}));
}
``
gavinking