Bug #41157 Modify PreparedStatement to include timestamp column in RETURN_GENERATED_KEYS
Submitted: 1 Dec 2008 19:38 Modified: 2 Dec 2008 8:06
Reporter: JM Marchand Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: generated_keys, timestamp
Triage: Triaged: D5 (Feature request)

[1 Dec 2008 19:38] JM Marchand
Description:
There is no way to retrieve the auto-generated 'timestamp' column through a JDBC Statement on insert/update. Getting the MySQL timestamp column the same way the primary key is returned with the parameter RETURN_GENERATED_KEYS would be beneficial to avoid having to query the server again with LAST_INSERT_ID().

How to repeat:
Create a table with a 'timestamp' column type and execute an insert/update PreparedStatement.

Suggested fix:
Include a column named GENERATED_TIMESTAMP in the result set of PreparedStatement.getGeneratedKeys() containing the first timestamp column of the table.
[1 Dec 2008 19:41] Mark Matthews
The driver would have to do the same query you'd do by hand....There is nothing special in the protocol that gives us this data.
[2 Dec 2008 8:00] Tonci Grgin
JM, we are discussing your last private comment.
[2 Dec 2008 8:06] Valeriy Kravchuk
This report looks like a reasonable feature request for MySQL server/protocol extension.