[
https://issues.apache.org/jira/browse/TRAFODION-3262?focusedWorklogId=188671&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-188671
]
ASF GitHub Bot logged work on TRAFODION-3262:
---------------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jan/19 07:30
Start Date: 23/Jan/19 07:30
Worklog Time Spent: 10m
Work Description: SuJinpei commented on pull request #1777:
[TRAFODION-3262] Insert float to numeric(19,0) lost precision for some case.
URL: https://github.com/apache/trafodion/pull/1777
**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 GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 188671)
Time Spent: 10m
Remaining Estimate: 0h
> Insert float to numeric(19,0) lost precision for some case.
> -----------------------------------------------------------
>
> Key: TRAFODION-3262
> URL: https://issues.apache.org/jira/browse/TRAFODION-3262
> Project: Apache Trafodion
> Issue Type: Bug
> Components: client-odbc-linux, client-odbc-windows
> Affects Versions: 2.2.0
> Reporter: 苏锦佩
> Priority: Critical
> Time Spent: 10m
> Remaining Estimate: 0h
>
> For example,the ddl of table is "create table tb(c1 numeric(18,0), c2
> numeric(19,0))".Insert the same value 12345678 by SQL_C_FLOAT,the values of
> C1 and C2 are inconsistent when querying the table.C1:12345678,C2:12345700。
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)