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

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

Github user Weixin-Xu commented on a diff in the pull request:

    
https://github.com/apache/incubator-trafodion/pull/1311#discussion_r156836851
  
    --- Diff: win-odbc64/odbcclient/drvr35/sqltocconv.cpp ---
    @@ -36,6 +36,34 @@
     
     #define MAXCHARLEN 32768 //32K
     
    +// for server2008 when using function pow() then throws 
STATUS_ILLEGAL_INSTRUCTION
    +__int64 pow(int base, short scale)
    +{
    +   DWORD dwVersion = 0;
    +   DWORD dwBuild = 0;
    +
    +   dwVersion = GetVersion();
    +
    +   // Get the build number.
    +
    +   if (dwVersion < 0x80000000)
    +           dwBuild = (DWORD)(HIWORD(dwVersion));
    +
    +   __int64 retValue = 1;
    +   if (dwBuild == 7600)
    +   {
    +           scale = scale > 18 ? 18 : scale;
    +           for (int i = 0; i < scale; i++)
    +                   retValue = retValue * 10;
    --- End diff --
    
    For the function used only in sqltocconv.cpp, server always gives a scale 
less than 19.
    The function is only used to figure up the fractional length of numeric 
whose precision is not more than 18.
    Actually, it need not to be compared with 18.


> For Server 2008, function pow() in driver ODBC throws 
> STATUS_ILLEGAL_INSTRUCTION
> --------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2818
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2818
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: client-odbc-windows
>    Affects Versions: any
>         Environment: Server 2008 R2
>            Reporter: XuWeixin
>            Assignee: XuWeixin
>             Fix For: any
>
>
> SQL_NUMERIC to SQL_C_CHAR
> ***ERROR: SQLGetData: Expected: SQL_SUCCESS Actual: SQL_ERROR
>    State: HY000
>    Native Error: 29
>    Error: [TRAF][Trafodion ODBC Driver] General error.EXCEPTION: UNKNOWN - 
> Exception Code = c000001d



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

Reply via email to