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

[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.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
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.