You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2017/08/17 17:04:45 UTC

[1/2] incubator-trafodion git commit: [TRAFODION-2702]Fix wrong offset when the charset type is ucs2 in SQLTOC

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master f32278f05 -> 6a105c3d2


[TRAFODION-2702]Fix wrong offset when the charset type is ucs2 in SQLTOC


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/cdee98c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/cdee98c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/cdee98c4

Branch: refs/heads/master
Commit: cdee98c4390006dd14b98288fc334184548283c5
Parents: d86a0ba
Author: CoderSong2015 <40...@qq.com>
Authored: Thu Aug 3 11:05:30 2017 +0000
Committer: CoderSong2015 <40...@qq.com>
Committed: Thu Aug 3 11:05:30 2017 +0000

----------------------------------------------------------------------
 core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cdee98c4/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp
----------------------------------------------------------------------
diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp
index b1fdcb9..c5c430d 100644
--- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp
+++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp
@@ -421,7 +421,7 @@ unsigned long ODBC::ConvertSQLToC(SQLINTEGER	ODBCAppVersion,
                 break;
             }
 		case SQL_WCHAR:
-			charlength = srcLength-1;
+			charlength = srcLength - 1;
 			if (charlength == 0)
 			{
 				if (targetStrLenPtr != NULL)
@@ -3557,7 +3557,10 @@ unsigned long ODBC::ConvertSQLToC(SQLINTEGER	ODBCAppVersion,
 			{
 				if(CDataType == SQL_C_CHAR)
 				{
-					DataLen = charlength-Offset;
+			                if(srcCharSet == SQLCHARSETCODE_UCS2)
+					    DataLen = charlength / 2 - Offset;
+					else
+					    DataLen = charlength  - Offset;
 					if (DataLen >= targetLength)
 					{
 						DataLenTruncated = DataLen;


[2/2] incubator-trafodion git commit: Merge [TRAFODION-2702] PR 1197 Fix issue with UCS2 in conversion logic

Posted by db...@apache.org.
Merge [TRAFODION-2702] PR 1197 Fix issue with UCS2 in conversion logic


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/6a105c3d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/6a105c3d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/6a105c3d

Branch: refs/heads/master
Commit: 6a105c3d2084649df6e11d0ffeb83e65b4829abd
Parents: f32278f cdee98c
Author: Dave Birdsall <db...@apache.org>
Authored: Thu Aug 17 17:03:57 2017 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Thu Aug 17 17:03:57 2017 +0000

----------------------------------------------------------------------
 core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6a105c3d/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp
----------------------------------------------------------------------