Bug #101823 | MySQL JDBC driver incorrectly reports bigint as BigInteger in generated keys | ||
---|---|---|---|
Submitted: | 1 Dec 2020 17:47 | Modified: | 25 Nov 2022 16:14 |
Reporter: | Puf Puf | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 8.0.22, 8.0.12 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[1 Dec 2020 17:47]
Puf Puf
[2 Dec 2020 6:05]
MySQL Verification Team
Hello! Thank you for the report and test case. regards, Umesh
[25 Nov 2022 16:14]
Filipe Silva
Posted by developer: The information regarding generated keys is not directly related to the table primary key in the sense that it does not share the same metadata rules. MySQL protocol indicates what has the last insert-id of the executed query independently of how many ids were actually generated and this information is not directly linked to any column in particular (https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_basic_ok_packet.html), as such, Connector/J has no alternative other than using the most comprehensive data type in the generated keys result set. Also note that the spec does not make any assumptions regarding the columns or types to return in this result set (https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#getGeneratedKeys--) - for MySQL Connector/J it is BIGINT_UNSIGNED. Having said that, this report will be closed. Thanks.