Affects Version/s: 10.9.1.0
Fix Version/s: None
1) A JDBC INSERT statement is executed, with Statement.RETURN_GENERATED_KEYS enabled, and
2) A call is then made to Statement.getGeneratedKeys, and
3) The table which was inserted into has NO generated columns,
then getGeneratedKeys() returns a ResultSet object with a single row in it.
This behavior seems incorrect; it seems that the correct behavior
would be to return a ResultSet object which has NO rows in it, so
that ResultSet.next() returns FALSE the first time it is called.
I have a very simple table:
No auto-generated fields. However when I do an insert, JDBC tells me there are auto-generated keys (rs.next() does not return false and a LONG value is returned):
This sounds like a bug to me. For comparison, PostgreSQL does not have the same behaviour.