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

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

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

    
https://github.com/apache/incubator-trafodion/pull/1022#discussion_r108307111
  
    --- Diff: core/sql/optimizer/BindItemExpr.cpp ---
    @@ -6173,7 +6173,35 @@ ItemExpr *Assign::bindNode(BindWA *bindWA)
         } // QSTUFF
     
       } // isUserSpecified
    +  NABuiltInTypeEnum sourceType =  
child(1)->castToItemExpr()->getValueId().getType().getTypeQualifier() ;
    +  NABuiltInTypeEnum targetType =  
child(0)->castToItemExpr()->getValueId().getType().getTypeQualifier() ;
    +  if ((sourceType == NA_CHARACTER_TYPE) && (targetType == NA_LOB_TYPE))
    +    {
    +      ValueId vid1 = child(1)->castToItemExpr()->getValueId();  
    +      // Add a stringToLob node
    +      ItemExpr *newChild =  new (bindWA->wHeap()) LOBinsert( 
vid1.getItemExpr(), NULL, LOBoper::STRING_, FALSE);    
    +      newChild->bindNode(bindWA);
    +      if (bindWA->errStatus())
    +   return boundExpr; 
    +      setChild(1, newChild);
    +    }
    +  /* if ((sourceType == NA_UNKNOWN_TYPE) && (targetType = NA_LOB_TYPE))
    --- End diff --
    
    No I will remove the commented out code. I had initilaly tried to do this 
cast in the binder but it was not the right place. The type coercion needed to 
be done in the ::doSynthType() method.


> Enhance stringtolob builtin function to take varchar/char columns as parameter
> ------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2516
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2516
>             Project: Apache Trafodion
>          Issue Type: Improvement
>          Components: sql-exe
>            Reporter: Sandhya Sundaresan
>            Assignee: Sandhya Sundaresan
>
> Today the stringtolob built in function that converts a string to a LOB type 
> before inserrting into a lob column takes a string literal as input. Need to 
> enhance it to take a char column or a varchar column as input too. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to