You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by Weixin-Xu <gi...@git.apache.org> on 2018/11/28 03:11:28 UTC
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
GitHub user Weixin-Xu opened a pull request:
https://github.com/apache/trafodion/pull/1750
[TRAFODION-3238] ODBC can not connect to server when the local language is gbk
1. Set your current language used in non-unicode programs to GBK.
2. Create user name with chinese.
3. Test odbc.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Weixin-Xu/incubator-trafodion J3238
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1750.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 #1750
----
commit c914a3e09ba2db36078c871e5805c54fa2e59404
Author: Weixin-Xu <10...@...>
Date: 2018-11-28T03:08:47Z
ODBC can not connect to server when the local language is gbk
----
---
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Posted by Weixin-Xu <gi...@git.apache.org>.
Github user Weixin-Xu commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1750#discussion_r237327092
--- Diff: win-odbc64/security_dll/native/source/secpwd.cpp ---
@@ -217,8 +221,25 @@ SecPwd::SecPwd(const char *dir, const char* fileName,
if(stat(certDir,&st) != 0)
throw SecurityException(DIR_NOTFOUND, (char *)certDir);
- certFile = buildName(certDir, fileName, serverName, CER);
- activeCertFile = buildName(certDir, activeFileName, serverName, ACTIVE_CER);
+ if (lcid == 0x804) // if local charset is not utf8
--- End diff --
I will change "is not utf8" to "is gbk". Do you know how many character sets we need?
---
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1750#discussion_r237702542
--- Diff: win-odbc64/security_dll/native/source/secpwd.cpp ---
@@ -217,8 +221,25 @@ SecPwd::SecPwd(const char *dir, const char* fileName,
if(stat(certDir,&st) != 0)
throw SecurityException(DIR_NOTFOUND, (char *)certDir);
- certFile = buildName(certDir, fileName, serverName, CER);
- activeCertFile = buildName(certDir, activeFileName, serverName, ACTIVE_CER);
+ if (lcid == 0x804) // if local charset is not utf8
--- End diff --
No... I suppose we'll let the marketplace tell us.
---
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1750#discussion_r237304832
--- Diff: win-odbc64/security_dll/native/source/secpwd.cpp ---
@@ -217,8 +221,25 @@ SecPwd::SecPwd(const char *dir, const char* fileName,
if(stat(certDir,&st) != 0)
throw SecurityException(DIR_NOTFOUND, (char *)certDir);
- certFile = buildName(certDir, fileName, serverName, CER);
- activeCertFile = buildName(certDir, activeFileName, serverName, ACTIVE_CER);
+ if (lcid == 0x804) // if local charset is not utf8
+ {
+ serverNameGBKToUtf8 = (char *)malloc(MAX_SQL_IDENTIFIER_LEN + 1);
--- End diff --
You use malloc to allocate this storage but delete to free it. This behavior is undefined in general. It would be better to use free() to delete it, or to use new instead of malloc.
---
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1750#discussion_r237304599
--- Diff: win-odbc64/security_dll/native/source/secpwd.cpp ---
@@ -217,8 +221,25 @@ SecPwd::SecPwd(const char *dir, const char* fileName,
if(stat(certDir,&st) != 0)
throw SecurityException(DIR_NOTFOUND, (char *)certDir);
- certFile = buildName(certDir, fileName, serverName, CER);
- activeCertFile = buildName(certDir, activeFileName, serverName, ACTIVE_CER);
+ if (lcid == 0x804) // if local charset is not utf8
--- End diff --
Looking at https://msdn.microsoft.com/en-us/library/cc233965.aspx, it appears 0x804 = language tag zh-CN, with default sort order. Do we know that all other locales use UTF-8? (Perhaps the comment on this line should be, "if locale ID is zh-CN")
---
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/trafodion/pull/1750
---
[GitHub] trafodion pull request #1750: [TRAFODION-3238] ODBC can not connect to serve...
Posted by Weixin-Xu <gi...@git.apache.org>.
Github user Weixin-Xu commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1750#discussion_r237326263
--- Diff: win-odbc64/security_dll/native/source/secpwd.cpp ---
@@ -217,8 +221,25 @@ SecPwd::SecPwd(const char *dir, const char* fileName,
if(stat(certDir,&st) != 0)
throw SecurityException(DIR_NOTFOUND, (char *)certDir);
- certFile = buildName(certDir, fileName, serverName, CER);
- activeCertFile = buildName(certDir, activeFileName, serverName, ACTIVE_CER);
+ if (lcid == 0x804) // if local charset is not utf8
+ {
+ serverNameGBKToUtf8 = (char *)malloc(MAX_SQL_IDENTIFIER_LEN + 1);
--- End diff --
Thanks, I will modify it.
---