You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/20 07:01:00 UTC

[jira] [Commented] (TRAFODION-2750) Using function strtod is not enough to convert C_CHAR to DOUBLE

    [ https://issues.apache.org/jira/browse/TRAFODION-2750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16172836#comment-16172836 ] 

ASF GitHub Bot commented on TRAFODION-2750:
-------------------------------------------

GitHub user Weixin-Xu opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1241

    [TRAFODION-2750] Using function strtod is not enough to convert C_CHAR to DOUBLE

    client app with odbc driver :
    DDL : "CREATE TABLE DOUBLE_TEST(A DOUBLE PRECISION)"
    buffer =   "-2.22507e-308"
    Bind SQL_C_CHAR to SQL_DOUBLE
    return :
    State: 22003
    Native Error: 0
    Error: [Trafodion ODBC Driver] NUMERIC VALUE OUT OF RANGE. Incorrect Format or Data. Row: 1 Column: 1
    
    unit test for driver code :
    char buffer[] = "-2.22507e-308";
    double db;
    errno = 0;
    db = strtod(buffer,NULL);
    return :
    db = -0.000000
    errno = 34

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Weixin-Xu/incubator-trafodion master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1241.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1241
    
----
commit 693a3ceda4c818caf3735dffd763a616b533d2af
Author: Weixin-Xu <xw...@weixin-1.novalocal>
Date:   2017-09-20T06:24:42Z

    strtod is not enough to convert char to double with numbers like "-2.22507e-308"

----


> Using function strtod is not enough to convert C_CHAR to DOUBLE
> ---------------------------------------------------------------
>
>                 Key: TRAFODION-2750
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2750
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: client-odbc-linux
>    Affects Versions: 2.2-incubating, 2.3-incubating
>         Environment: centos6.7
>            Reporter: XuWeixin
>             Fix For: 2.2-incubating
>
>
> client app with odbc driver :
> insert c_char "-2.22507e-308";  to double
> State: 22003
>    Native Error: 0
>    Error: [Trafodion ODBC Driver] NUMERIC VALUE OUT OF RANGE. Incorrect Format or Data. Row: 1 Column: 1
> unit test for driver code :
> char buffer[] = "-2.22507e-308";
> double db;
> errno = 0;
> db = strtod(buffer,NULL);
> return db = -0.000000
>           errno = 34



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)