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 2017/05/02 10:21:38 UTC
[GitHub] incubator-trafodion pull request #1078: [TRAFODION-2602] memory out of bound...
GitHub user Weixin-Xu opened a pull request:
https://github.com/apache/incubator-trafodion/pull/1078
[TRAFODION-2602] memory out of bound when fetch LONGVARCHAR UCS2
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Weixin-Xu/incubator-trafodion master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/1078.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 #1078
----
commit a8d197a66f9cbaa8d253e252cd1b857b48074955
Author: Weixin Xu <we...@esgyn.cn>
Date: 2017-05-02T10:18:49Z
[TRAFODION-2536] memory out of bound when fetch LONGVARCHAR UCS2 column with a TIMESTAMP_STRUCT
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1078: [TRAFODION-2602] memory out of bound...
Posted by xwq <gi...@git.apache.org>.
Github user xwq commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1078#discussion_r114922009
--- Diff: core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp ---
@@ -1555,6 +1555,7 @@ unsigned long ODBC::ConvertSQLToC(SQLINTEGER ODBCAppVersion,
return IDS_22_003;
}
srcLength = TransStringLength + 1;
+ DataLen = sizeof(DATE_STRUCT);
--- End diff --
Hi Dave, thanks for review. The case here is application bind a DATE_STRUCT to LONGVARCHAR, and the charset is UCS2. In the code, we reuse the variable "DataLen" to represent the length of the data from server side, since the charset is UCS2, so the length is 2 times of the DATE_STRUCT. After converting the data. DataLen will be used to represent the length of DATE_STRUCT which user binded.
BYW, this code was removed from the early commit which for VARHCAR (> 32K) support. but this line should not be removed. That's why we need this change.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1078: [TRAFODION-2602] memory out of bound...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-trafodion/pull/1078
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request #1078: [TRAFODION-2602] memory out of bound...
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1078#discussion_r114609693
--- Diff: core/conn/unixodbc/odbc/odbcclient/unixcli/cli/sqltocconv.cpp ---
@@ -1555,6 +1555,7 @@ unsigned long ODBC::ConvertSQLToC(SQLINTEGER ODBCAppVersion,
return IDS_22_003;
}
srcLength = TransStringLength + 1;
+ DataLen = sizeof(DATE_STRUCT);
--- End diff --
I don't understand why this code change is correct. It looks like we are converting between a variety of C numeric types and ODBC varchar types. Why would DATE enter into it?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---