[
https://issues.apache.org/jira/browse/TRAFODION-2816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16272055#comment-16272055
]
ASF GitHub Bot commented on TRAFODION-2816:
-------------------------------------------
Github user Weixin-Xu commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1310#discussion_r153973241
--- Diff: core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.cpp ---
@@ -1092,6 +1092,106 @@ bool ctoi64(char* string, __int64& out, bool*
truncation)
free (buff);
return true;
}
+unsigned __int64 _atoui64( const char *s )
+{
+ unsigned __int64 n = 0;
+ char* t = (char*)s;
+ char c;
+
+ while(*t != 0)
+ {
+ c = *t++;
+ if (c < '0' || c > '9') continue;
--- End diff --
The function ctoui64() and _atoui64() is imitative written with function
ctoi64() and _atoi64().
The junk characters have been truncated in function ctoui64() which uses
_atoui64().
And I have run an extensive private test suite for this change.
> ODBC data convert function split
> --------------------------------
>
> Key: TRAFODION-2816
> URL: https://issues.apache.org/jira/browse/TRAFODION-2816
> Project: Apache Trafodion
> Issue Type: Bug
> Components: client-odbc-linux, client-odbc-windows
> Affects Versions: 2.3-incubating
> Reporter: Weiqing Xu
> Assignee: XuWeixin
>
> Now, the data convert function in ODBC is very long , and very hard to
> maintenance, we need to refactor it with some short function.
> 1. split one long function to little functions to make it more easy to
> maintain.
> 2. support convert very long CHAR/VARCHAR to others struct like timestamp.
> 3. Don't modify SQLDataType for SQL_NUMERIC any more. Use FSDataType to
> decide the real data format.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)