You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by GitBox <gi...@apache.org> on 2019/03/28 03:33:37 UTC

[GitHub] [trafodion] SuJinpei opened a new pull request #1818: [TRAFODION-3262] Insert float to numeric(19, 0) lost precision for some case

SuJinpei opened a new pull request #1818: [TRAFODION-3262] Insert float to numeric(19,0) lost precision for some case
URL: https://github.com/apache/trafodion/pull/1818
 
 
   root cause: when the target numeric type's precision is bigger than 18, the source float or double data will first be converted to char string which will call the double_to_char function, then transfer to the server. original double_to_char only keep 'precision' significant digits. In this case, the caller provides the precision with 6 for float datatype, so last 2 digits' precision lost.
   solution: now, the 'precision' parameter means the number of digits after the decimal point which is the caller really meant to do. To prevent precision lost, the conversion will fail if the caller doesn't provide enough space to receive the result.
   verify: no new issue was found by running coast to verify the fix.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services