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

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

GitHub user rwbzx opened a pull request:

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

    [TRAFODION-2375]ODBC:SQLGetDiagRec return wrong msg length when data 
truncate

    Acoording to ODBC reference, in function SQLGetDiagRec,  param 
_TextLengthPtr_  should point to a buffer in which to return the total number 
of characters, but it returns number of truncated characters when param 
_BufferLength_ is smaller than character number of error message text.
    Thus, modifications are made relating to win/unix odbc driver code as 
following:
    Unix ODBC: if truncation occurs, return SQL_SUCCESS_WITH_INFO, and set 
variable strLen as total number of error message text whenever data is 
truncated.
    Windows ODBC: set variable strLen as total number of error message text 
whenever data is truncated.

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

    $ git pull https://github.com/rwbzx/incubator-trafodion TRAFODION-2375

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

    https://github.com/apache/incubator-trafodion/pull/871.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 #871
    
----
commit 8c465fdf282f8083f5066ccfa095ce157a3790b3
Author: rwbzx <[email protected]>
Date:   2016-12-07T06:46:32Z

    [TRAFODION-2375]SQLGetDiagRec return wrong msg len
    win/unix ODBC:SQLGetDiagRec return wrong len value when data truncate

----


> SQLGetDiagRec API didn't return correct text length
> ---------------------------------------------------
>
>                 Key: TRAFODION-2375
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2375
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: client-odbc-windows
>    Affects Versions: 2.2-incubating
>         Environment: Distro Version: HDP2.4, Trafodion Version: R22, OS: Win10
>            Reporter: 苏锦佩
>            Assignee: Zhang,Xiang
>
> SQLRETURN SQLGetDiagRec(
>      SQLSMALLINT HandleType,
>      SQLHANDLE Handle,
>      SQLSMALLINT RecNumber,
>      SQLCHAR * SQLState,
>      SQLINTEGER * NativeErrorPtr,
>      SQLCHAR * MessageText,
>      SQLSMALLINT BufferLength,
>      SQLSMALLINT * TextLengthPtr);
> Acoording to API reference, TextLengthPtr should return total number of 
> characters available, but it return number of truncated characters when 
> BufferLength is not enough to receive all MessageText; 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to