trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: TRAFODION-1457 Issues related to...
Date Mon, 17 Aug 2015 22:32:13 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/60#discussion_r37244951
  
    --- Diff: core/sql/optimizer/BindItemExpr.cpp ---
    @@ -10298,23 +10298,23 @@ NABoolean ZZZBinderFunction::isPadWithSpace (ExprValueId&
padExpr, CharInfo::Cha
       if ((padExpr->castToItemExpr()->getOperatorType() == ITM_CONSTANT) &&
           (!((ConstValue *)padExpr->castToItemExpr())->getText().isNull()))
       {
    -     NAWString padString(
    -       ((ConstValue *)padExpr->castToItemExpr())->getConstWStr());
    +     NAString padString(
    +       ((ConstValue *)padExpr->castToItemExpr())->getConstStr(FALSE));
          Int32 i = 0;
          NABoolean foundSingleQuote = FALSE;
    -     for (const NAWchar *s = padString.data(); *s; s++)
    +     for (const char *s = padString.data(); *s; s++)
          {
    -       i++;  // 0x0027 is the single quote character '
    -       if ((!foundSingleQuote)&&(*s != 0x0027)) // loop through 
    +       i++;  // 0x27 is the single quote character '
    +       if ((!foundSingleQuote)&&(*s != 0x27)) // loop through 
              continue;  // the prefix _UCS2 or _ISO88591
            else if ((!foundSingleQuote))
            {
             foundSingleQuote = TRUE; // found the leading single quote.
             continue;
            }
    -       if ((i == (padString.length())) && (*s == 0x0027)) // trailing single
quote
    +       if ((i == (padString.length())) && (*s == 0x27)) // trailing single quote
              continue;
    -       if (*s != 0x0020) // 0x0020 is the single space character ' '
    +       if (*s != 0x20) // 0x20 is the single space character ' '
    --- End diff --
    
    Again, slightly more portable to code *s != ' ' 


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