[CONJ-352] Wrong precision is returned for NUMERIC columns - 2 greater than it should be. Created: 2016-09-20  Updated: 2016-09-21  Resolved: 2016-09-21

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.2
Fix Version/s: 1.5.3

Type: Bug Priority: Major
Reporter: Yekaterina Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None

Attachments: HTML File env_java     File repro2.class     Java Source File repro2.java     Text File repro2.log    

 Description   

Wrong precision is returned for NUMERIC columns. The returned precision is 2 greater than it should be (see the attached java repro)

execute CREATE TABLE TESTNUM (N9X2 NUMERIC(9,2), N20X4 NUMERIC (20,4))

execute SELECT N9X2, N20X4 FROM TESTNUM

get resultset metadata

N9X2 precision is 11
N9X2 scale is 2

N20X4 precision is 22
N20X4 scale is 4



 Comments   
Comment by Diego Dupin [ 2016-09-21 ]

confirmed.

The problem concern DECIMAL type. Signed will have +2 precision, unsigned +1.

Comment by Diego Dupin [ 2016-09-21 ]

fixed in https://github.com/MariaDB/mariadb-connector-j/commit/26ed0fd511fdfafa0233e074f04fdd4ed81518e8

Generated at Thu Feb 08 03:15:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.