[
https://issues.apache.org/jira/browse/TRAFODION-2375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15731267#comment-15731267
]
ASF GitHub Bot commented on TRAFODION-2375:
-------------------------------------------
Github user rwbzx commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/871#discussion_r91451478
--- Diff: win-odbc64/odbcclient/drvr35/cdiag.cpp ---
@@ -389,8 +389,8 @@ SQLRETURN CDiagRec::GetDiagRec(SQLSMALLINT
RecNumber,
translateLengthMax/2, (int
*)&translateLength, (char *)errorMsg)) != SQL_SUCCESS )
rc = SQL_SUCCESS_WITH_INFO; //ERROR;
- strLen = translateLength;
- ((wchar_t *)MessageText)[strLen] = L'\0' ;
+ ((wchar_t *)MessageText)[translateLength] = L'\0';
+ strLen = tmpStrLen;
--- End diff --
Yes indeed, the logic is added in latest commit. Thanks for the tips.
> 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)