Bug #41657 | Type of "mediumint unsigned" in getGeneratedKeys is Long | ||
---|---|---|---|
Submitted: | 20 Dec 2008 15:17 | Modified: | 10 May 2016 15:49 |
Reporter: | Firstname Lastname | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S5 (Performance) |
Version: | 5.0.45-community-nt | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[20 Dec 2008 15:17]
Firstname Lastname
[20 Dec 2008 21:44]
Mark Matthews
The protocol doesn't inform the driver what type the generated key is, we only know that it can be as large as a BIGINT. I've assigned this to our documentation person, so a note can be added to the manual.
[6 Jan 2009 17:23]
Tony Bedford
If possible, can you provide a link to the page that is in error please. Thanks.
[12 Apr 2009 22:15]
james gamber
getGeneratedKeys works when executeUpdate("insert ..."). getGeneratedKeys does not work when executeUpdate( "call insertsp(...)") putting the insert inside the stored procedure breaks getGeneratedKeys. A valid resultset is returned by getGeneratedKeys with no rows. Driver 1.5.7 MySQL 5.1.32 work around-- do not use getGeneratedKeys inside stored proc put: insert test (name, address, city, state, zip) values(iname, iaddress, icity, istate, izip); if ROW_COUNT() > 0 then select LAST_INSERT_ID(); else select -1; end if; use standard result set processes note: by putting a select after and insert in a stored proc, executeUpdate does not return number of rows updated. Is that another bug?
[10 May 2016 15:49]
Daniel So
Edited the manual to have he following as the returned Java class for MEDIUMINT: "java.lang.Integer (regardless of whether it is UNSIGNED or not)"