Bug #82156 | Integer data type COLUMN_SIZE and getPrecision() values are different | ||
---|---|---|---|
Submitted: | 7 Jul 2016 21:39 | Modified: | 24 Mar 21:58 |
Reporter: | Lisa Cabrera | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 5.1.39 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[7 Jul 2016 21:39]
Lisa Cabrera
[11 Jul 2016 5:47]
Chiranjeevi Battula
Hello Lisa Cabrera, Thank you for the bug report and test case. Verified this behavior on MySQL Connector / J 5.1.39. Thanks, Chiranjeevi.
[11 Jul 2016 5:47]
Chiranjeevi Battula
run: Name=col_int Type=4 Precision=5 Scale=0 ColumnClassName=java.lang.Integer ColumnType=4 COLUMN_NAME=col_int DATA_TYPE=4 COLUMN_SIZE=10 DECIMAL_DIGITS=0 TYPE_NAME=INT BUILD SUCCESSFUL (total time: 0 seconds)
[12 Jul 2016 21:36]
Filipe Silva
Just to note that the fix will make ResultSetMetaData.getPrecision(int column) return the same value as from DBMD.getColumns()->COLUMN_SIZE and not the opposite. This is so because both methods should return the maximum precision for the type and not its display size, as explained in other bug reports, such as Bug#64069 and Bug#38171.
[13 Jul 2016 1:13]
Lisa Cabrera
That makes sense. Also see related defect Bug#82206.
[22 Jul 2023 14:47]
Ritika Verma
Is this bug solved?
[24 Mar 21:58]
Filipe Silva
Fixed in Connector/J 8.0.19 by Bug#97413.