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

    https://github.com/apache/trafodion/pull/1658#discussion_r206722914
  
    --- Diff: core/sql/generator/GenPreCode.cpp ---
    @@ -7518,6 +7518,53 @@ ItemExpr * AggrMinMax::preCodeGen(Generator * 
generator)
       return this;
     } // AggrMinMax::preCodeGen()
     
    +ItemExpr *Overlaps::preCodeGen(Generator *generator)
    +{
    +  if (nodeIsPreCodeGenned())
    +    return getReplacementExpr();
    +
    +  for (Int32 i = 0; i < getArity(); ++i)
    +  {
    +    if (child(i)) 
    +    {
    +      const NAType &type = 
    +        child(i)->getValueId().getType();
    +      const DatetimeType *operand = (DatetimeType *)&type;
    +
    +      if (type.getTypeQualifier() == NA_DATETIME_TYPE
    +            && (operand->getPrecision() == SQLDTCODE_DATE))
    +      {
    +        child(i) = new (generator->wHeap()) 
    +          Cast(child(i), new (generator->wHeap()) 
    +              SQLTimestamp(generator->wHeap(), TRUE));
    +
    +        child(i)->bindNode(generator->getBindWA());
    +      }
    +
    +    }
    +  }
    +
    +  ItemExpr *newExpr = 
    +    generator->getExpGenerator()->createExprTree(
    --- End diff --
    
    @zellerh, just wanted to check the analysis. I would have thought 2 > 1 and 
not (2 >=3 and null >= 3) becomes 2 > 1 and not (true and null) which becomes 2 
> 1 and not (null) which becomes 2 > 1 and null which becomes true and null 
which becomes null. So I didn't follow why you thought this evaluates to TRUE. 
What error am I making?


---

Reply via email to