Bug #116732 Fetching VECTOR value fails with Cursor Fetch
Submitted: 20 Nov 2024 14:24 Modified: 20 Nov 2024 15:02
Reporter: Tomas Hellström Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:9.1.0 OS:Any (Both Windows and MacOS)
Assigned to: CPU Architecture:Any

[20 Nov 2024 14:24] Tomas Hellström
Description:
Attempting to fetch VECTOR values from a JDBC ResultSet, this only succeeds if Cursor Fetch is disabled. If enabled, the following error is thrown as an SQLException:

Unknown type '242' in column '2' of '5' in binary-encoded result set.

How to repeat:
Create a table containing a VECTOR column and at least one row of valid data.

Use the JDBC driver to select the row. With cursor fetch disabled, methods like ResultSet.getObject(int) or ResultSet.getBinaryStream(int) will work as expected.

When repeating the same with cursor fetch enabled, the same methods will throw an SQLException with the above error message.
[20 Nov 2024 14:35] MySQL Verification Team
Hi Mr. Hellstrom,

Thank you for your bug report.

However, let us inform you that this is a forum for reports with fully repeatable test cases. Each of these test cases should consist of the set of SQL statements that always lead to the problem that you report. In your case, you should supply the Java code that does not work.

Can't repeat.
[20 Nov 2024 14:36] MySQL Verification Team
Hi Mr. Hellstrom,

Please, also take a look at the bottom of this documentation page:

https://dev.mysql.com/doc/connector-j/en/connector-j-reference-type-conversions.html

You will clearly notice that fetching vector types is fully supported, but only for some releases of MySQL and MySQL connectors.

Unsupported.
[20 Nov 2024 15:02] Tomas Hellström
I have submitted a small example program that exhibits this behavior.

If "useCursorFetch" is changed to false, or "statement.setFetchSize(1)" is commented out, the fetch succeeds.

Since this works properly when cursor fetch is disabled, but fails when enabled, it suggests that this is an implementation issue rather than a question of whether it's supported.
[20 Nov 2024 15:24] MySQL Verification Team
Hi Mr. Hellstrom,

Have you read the bottom of this page, as we have instructed you ????

https://dev.mysql.com/doc/connector-j/en/connector-j-reference-type-conversions.html
[20 Nov 2024 15:52] MySQL Verification Team
Hi Mr. Hellstrom,

Our Connector/J expert will take a look at your test case.

Only it will take a day or two until that person finds available time for your test case.

Hence, please, just have some patience .......

In the end, you will get your response ......