Re: Questions on getGeneratedKeys with on duplicate key update cause
Posted by: Filipe Silva
Date: March 17, 2022 04:19AM

In a sense you are right, but just by looking at the affected rows count you can't possibly know what happened exactly.

It think the original intent was to make that distinction, but it only works deterministically if you insert/update one row at a time.

In mysql client you see the affected rows plus an additional info message. All this information comes in the MySQL OK Packet, as "affected_rows" and "info". As you can see, the "info" data is a "human readable status information", which is fine to print in a mysql client but it's not good for connectors since they would have to parse the message and handle all sorts of corner cases, such as servers running in different languages, other types of "info" messages and so on. So, until there is no better alternative, the only solution is to return our best guess of what happened in the operation.

Options: ReplyQuote


Subject
Written By
Posted
Re: Questions on getGeneratedKeys with on duplicate key update cause
March 17, 2022 04:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.