trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsharma00 <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: Fixes to JIRAs 1793,1807,1808. D...
Date Fri, 05 Feb 2016 20:35:43 GMT
Github user anoopsharma00 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/310#discussion_r52069261
  
    --- Diff: core/sql/common/DateTimeType.cpp ---
    @@ -1399,18 +1403,69 @@ NABoolean SQLMPDatetime::isCompatible(const NAType& other,
UInt32 * flags) const
     //  DatetimeValue : A datetime value
     //
     // ***********************************************************************
    -
     DatetimeValue::DatetimeValue
     ( const char* strValue
     , rec_datetime_field startField
     , rec_datetime_field endField
     , UInt32& fractionPrecision   /* IN - OUT */
    +, NABoolean useOldConstructor
     )
     : value_(NULL)
     , valueLen_(0)
     , startField_(startField)
     , endField_  (endField)
     {
    +  if (useOldConstructor)
    +    {
    +      oldConstructor(strValue, startField, endField, fractionPrecision);
    +      return;
    +    }
    +
    +  char dstValue[101];
    +
    +  ComDiagsArea *diags = NULL;
    +
    +  Lng32 trueFP = 6;
    +  ULng32 flags = 0;
    +  flags |= CONV_NO_HADOOP_DATE_FIX;
    +  short rc = 
    +    ExpDatetime::convAsciiToDatetime((char*)strValue, strlen(strValue), 
    +                                     dstValue, 100,
    +                                     startField, endField, 
    +                                     ExpDatetime::DATETIME_FORMAT_NONE,
    +                                     trueFP,
    +                                     NULL, &diags, flags);
    +  if (rc)
    +    return;
    --- End diff --
    
    That return is for error paths. The Datetime value being constructed will be invalid and
    not be used. isValid() method will return true.
    But we can initialize fractionPrecision to zero on entry to this method.


---
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