[ 
https://issues.apache.org/jira/browse/TRAFODION-3259?focusedWorklogId=193146&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-193146
 ]

ASF GitHub Bot logged work on TRAFODION-3259:
---------------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Feb/19 01:57
            Start Date: 01/Feb/19 01:57
    Worklog Time Spent: 10m 
      Work Description: selvaganesang commented on pull request #1783: 
[TRAFODION-3259] Length of varchar exceeds 65536 insert data will fail
URL: https://github.com/apache/trafodion/pull/1783#discussion_r252911562
 
 

 ##########
 File path: core/sql/exp/exp_attrs.h
 ##########
 @@ -759,9 +763,10 @@ class SimpleType : public Attributes
   Int16 getScale()            {return scale_;}
   UInt16 getScaleAsUI()       {return (UInt16)scale_;}
 
-  Int32 getPrecision()        {return (UInt16)precision_;} // Treat as UInt16 
in case 0x8000 or bigger
+  Int32 getPrecision()
+  {return (UInt16)precision_ | ((UInt32)precision_high_ << 16);}
   inline void setPrecision(Int32 precision)
-                              {precision_ = (Int16)precision;}
+  {precision_ = (Int16)precision; precision_high_ = (Int16)((UInt32)precision 
>> 16);}
 
 Review comment:
   I would think it should be ok to change the precision to Int32 instead of 
keeping two different variables precision_ and precision_high_. Currently 
Trafodion doesn't support versioning. From this perspective, it is ok to change 
these structures which could be serialized across processes.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 193146)
    Time Spent: 1h 50m  (was: 1h 40m)

> When the length of the varchar exceeds 65536, insert into data will fail
> ------------------------------------------------------------------------
>
>                 Key: TRAFODION-3259
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3259
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>    Affects Versions: any
>            Reporter: junluwei
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> | |Steps To Reproduce:
> 1. create table:
>  CREATE TABLE WJL21(C1 VARCHAR(65537 CHARS) CHARACTER SET UTF8)
>  2. execute "insert into" sql
>  insert into wjl21 values('qwerasd123af#$asfdadf......') 
>  the length of the values is 65537
>  3. the fail of information is:
>  org.trafodion.jdbc.t4.TrafT4Exception: *** ERROR[8402] A string overflow 
> occurred during the evaluation of a character expression. [2019-01-21 
> 14:09:01]
>      at 
> org.trafodion.jdbc.t4.TrafT4Messages.throwSQLException(TrafT4Messages.java:211)
>      at 
> org.trafodion.jdbc.t4.InterfaceStatement.execute(InterfaceStatement.java:1477)
>      at 
> org.trafodion.jdbc.t4.TrafT4PreparedStatement.execute(TrafT4PreparedStatement.java:2288)
>      at 
> org.trafodion.jdbc.t4.TrafT4PreparedStatement.executeUpdate64(TrafT4PreparedStatement.java:429)
>      at 
> org.trafodion.jdbc.t4.TrafT4PreparedStatement.executeUpdate(TrafT4PreparedStatement.java:375)|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to