add '\0' after lobHandle
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/443e538c Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/443e538c Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/443e538c Branch: refs/heads/master Commit: 443e538ce9f046db7cb965046c169e5dbbf703b0 Parents: f70b19c Author: Weixin-Xu <[email protected]> Authored: Wed Jul 11 09:57:11 2018 +0800 Committer: Weixin-Xu <[email protected]> Committed: Wed Jul 11 09:57:11 2018 +0800 ---------------------------------------------------------------------- win-odbc64/odbcclient/drvr35/lob.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/443e538c/win-odbc64/odbcclient/drvr35/lob.cpp ---------------------------------------------------------------------- diff --git a/win-odbc64/odbcclient/drvr35/lob.cpp b/win-odbc64/odbcclient/drvr35/lob.cpp index 77f2a4b..44a93bf 100644 --- a/win-odbc64/odbcclient/drvr35/lob.cpp +++ b/win-odbc64/odbcclient/drvr35/lob.cpp @@ -54,8 +54,12 @@ namespace ODBC { CStmt *pStatement = (CStmt *)hstmt; IDL_long extractLen = length; + IDL_string lobHandleTemp = (IDL_string)malloc(lobHandleLen + 1); + memset(lobHandleTemp, 0, lobHandleLen + 1); + memcpy(lobHandleTemp, lobHandle, lobHandleLen); + if (pStatement->ExtractLob(1, - lobHandle, lobHandleLen, extractLen, data) != SQL_SUCCESS) + lobHandleTemp, lobHandleLen + 1, extractLen, data) != SQL_SUCCESS) { pStatement->Close(SQL_CLOSE); return false;
