Issue Details (XML | Word | Printable)

Key: JDBC-389
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Wiesław Poszewiecki
Votes: 0
Watchers: 0

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

Rationalize the UPDATE ... RETURNING statement.executeQuery() behaviour

Created: 08/Apr/15 05:14 PM   Updated: 11/Apr/15 10:30 PM
Component/s: JDBC driver
Affects Version/s: Jaybird 2.2.7
Fix Version/s: None

 Description  « Hide
I am using Jaybird 2.2.7
I was trying to use
I used
ResultSet rset = statement.executeQuery();
I expected test to be false in the case that update
does not affect any rows.
This differs from the PostgresSQL behaviour which I think is correct.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 11/Apr/15 09:37 PM
I am not sure if I can fix this. UPDATE ... RETURNING ... and friends are treated as executable procedures in Firebird (and because of that it can only be used for singleton updates). The way these are executed always produces a row, even when nothing was updated and the row is empty (all null).

I initially thought to check the update count, but that is not possible because for example actual executable procedures (which are indiscernible from UPDATE ... RETURNING ...) might have a zero update count even though they produce a result.

I will check with the core developers if I am missing an option.

Wiesław Poszewiecki added a comment - 11/Apr/15 10:30 PM
For my particular purpose this may stay as it is.