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

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

Github user ryzuo commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/853#discussion_r90182330
  
    --- Diff: core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdesc.cpp ---
    @@ -595,9 +597,19 @@ unsigned long CDescRec::setDescRec(short DescMode, 
SQLItemDesc_def *SQLItemDesc)
                break;
        case SQLTYPECODE_VARCHAR_WITH_LENGTH:
                if (m_SQLCharset == SQLCHARSETCODE_UCS2)
    -                   m_SQLOctetLength = SQLItemDesc->maxLen+4;
    +           {
    +                   if(SQLItemDesc->maxLen > 0x7fff)
    +                           m_SQLOctetLength = SQLItemDesc->maxLen+6;
    +                   else
    +                           m_SQLOctetLength = SQLItemDesc->maxLen+4;
    +           }
                else
    -                   m_SQLOctetLength = SQLItemDesc->maxLen+3;
    +           {
    +                   if(SQLItemDesc->maxLen > 0x7fff)
    --- End diff --
    
    ditto


> LP Bug: 1461677 - Insert small data into large varchar column(>32K) failed 
> with error 8402- string overflow
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-1262
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-1262
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: client-odbc-linux, client-odbc-windows
>            Reporter: JiepingZhang
>            Assignee: Zhang,Xiang
>            Priority: Critical
>             Fix For: 2.1-incubating
>
>
> Test scenario:
> Create table: CREATE TABLE ODBC32K.LargeColTbl ( C1 varchar (200000) NOT 
> NULL, C2 CHAR(200000));
> insert into ODBC32K.LargeColTbl values ('SaaaaaaaaaaaaaaaaE', 
> 'SbbbbbbbbbbbbbbbbbE');
> ODBC will return error below:
> Inserting data using SQLBindParameter, SQLPrepare, SQLExecute
> Function SQLExecute returned SQL_ERROR
> Diagnostics associated with statmement handle:
>         SQL Diag 1
>         Native Error: 4294958894
>         SQL State:    22001
>         Message:      [Trafodion ODBC Driver][Trafodion Database] SQL 
> ERROR:*** ERROR[8402] A string overflow occurred during the evaluation of a 
> character expression. [2015-06-03 17:36:41]
> PS: If try from ODBCTest, insert will be successful, seems this only fails 
> when done thru application.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to