trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traflm <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #703: [TRAFODION-2208] function support: lo...
Date Thu, 15 Sep 2016 09:52:50 GMT
Github user traflm commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/703#discussion_r78926449
  
    --- Diff: core/sql/optimizer/SynthType.cpp ---
    @@ -1010,7 +1010,81 @@ const NAType *BuiltinFunction::synthesizeType()
     	    SQLChar(maxLength, typ1.supportsSQLnull());
           }
         break;
    + 
    +    case ITM_ISIPV4:
    +    case ITM_ISIPV6:
    +      {
    +        // type cast any params
    +        ValueId vid1 = child(0)->getValueId();
    +        SQLChar c1(ComSqlId::MAX_QUERY_ID_LEN);
    +        vid1.coerceType(c1, NA_CHARACTER_TYPE);
    +        //input type must be string
    +        const NAType &typ1 = child(0)->getValueId().getType();
    +
    +        if (typ1.getTypeQualifier() != NA_CHARACTER_TYPE)
    +          {
    +	    *CmpCommon::diags() << DgSqlCode(-4045) << DgString0("IS_IP");
    +	    return NULL;
    +          }
    +        retType = new HEAP
    +           SQLSmall(TRUE, FALSE);
    --- End diff --
    
    this return value according to MySQL is an integer either 0 or 1. So I use small int.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message