You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/03 11:36:02 UTC

[jira] [Commented] (TRAFODION-2702) [ODBC] The SQL type is set to CHAR (n) CHARACTER SET USC2, SQLGetData to read data multiple times returns the wrong length value

    [ https://issues.apache.org/jira/browse/TRAFODION-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112596#comment-16112596 ] 

ASF GitHub Bot commented on TRAFODION-2702:
-------------------------------------------

GitHub user CoderSong2015 opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1197

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

    The offset will record the number of the chars returned,which have been translated from ucs2 to SQL_C_CHAR. When the function is called again to get the remaining chars, it  use the length of string without translation and the offset translated to calculate the number of the remaining chars.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/CoderSong2015/incubator-trafodion forUCS2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1197.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 #1197
    
----
commit cdee98c4390006dd14b98288fc334184548283c5
Author: CoderSong2015 <40...@qq.com>
Date:   2017-08-03T11:05:30Z

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

----


> [ODBC] The SQL type is set to CHAR (n) CHARACTER SET USC2, SQLGetData to read data multiple times returns the wrong length value
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2702
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2702
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: client-odbc-linux
>    Affects Versions: 2.2-incubating, 2.3-incubating
>         Environment: CentOS
>            Reporter: haolin.song
>             Fix For: 2.2-incubating, 2.3-incubating
>
>
>  The SQL type is set to 'CHAR (N)' CHARACTER SET USC2, SQLGetData will read data multiple times when the length of buffer is less than the length of the data but returns wrong size of length.
>         "CREATE TABLE TB_DEBUG(C1 CHAR(20)  CHARACTER SET UCS2)"
> 	"INSERT INTO TB_DEBUG VALUES (_UCS2'0123456789abcdefghij')"
> 	"select * from TB_DEBUG"
>          SQLFetch(hstmt);
>  	while (retcode != SQL_NO_DATA_FOUND) 
>        ...
> 		retcode = SQLGetData(hstmt,(SWORD)(1),SQL_C_CHAR,UCS2Output,11,&len);
>        ...
> the SQLGetData will return 5 times and the len is 20,31,21,11,1



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)