Issue Details (XML | Word | Printable)

Key: JDBC-567
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

getGeneratedKeys execute methods should disallow empty or null arrays

Created: 08/Dec/18 09:37 AM   Updated: 28/Dec/18 08:08 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.2.12, Jaybird 2.2.13, Jaybird 3.0.0, Jaybird 3.0.1, Jaybird 3.0.2, Jaybird 3.0.3, Jaybird 2.2.14, Jaybird 3.0.4, Jaybird 3.0.5
Fix Version/s: Jaybird 4

 Description  « Hide
Although inconsistently documented, JDBC requires that the columnIndexes and columnNames array are non-null and non-empty for statements that are capable of generating keys. For example Statement.executeUpdate(String sql, int[] columnIndexes) in Java 11 specifies:

The driver will ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

    SQLException - if [..] the second argument supplied to this method is not an int array whose elements are valid column indexes

Jaybird currently allows this for generated keys statement and executes as if it is a non-generated keys method if the array is null or empty, or ignores the invalid column index if there are other columns present. Instead an exception should be thrown.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.