[ https://issues.apache.org/jira/browse/TRAFODION-2099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15373065#comment-15373065 ]
ASF GitHub Bot commented on TRAFODION-2099: ------------------------------------------- Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/590#discussion_r70461463 --- Diff: core/sql/common/str.cpp --- @@ -997,19 +997,40 @@ Lng32 str_decode(void *tgt, Lng32 tgtMaxLen, const char *src, Lng32 srcLen) return length; } -// Strips leading and trailing blanks. src will contain a NULL after the +// Strips leading and/or trailing blanks. src will contain a NULL after the // end of the first non-blank character.The length of the "stripped" string -// is returned in len - -void str_strip_blanks(char *src , Lng32 &len) +// is returned in len. +// Returns pointer to the start of string after leading blanks. +char * str_strip_blanks(char *src , Lng32 &len, + NABoolean stripLeading, + NABoolean stripTrailing + ) { + if (! src) + return NULL; + len = str_len(src)-1; - while ((len >= 0) && (src[len] == ' ')) - len--; + if (len <= 0) + return src; --- End diff -- Hmmm... Isn't len a reference parameter? Therefore it is an output as well as an input. Perhaps it should be pass by value instead? Let's take another example. Suppose the input string is ' ' (that is, one blank). The code as written would calculate len = 0 at line 1012, then the 'if' at line 1013 is true, and we return src without stripping a blank. Seems like we should return the empty string instead? > add support for boolean datatype > -------------------------------- > > Key: TRAFODION-2099 > URL: https://issues.apache.org/jira/browse/TRAFODION-2099 > Project: Apache Trafodion > Issue Type: Improvement > Reporter: Anoop Sharma > Assignee: Anoop Sharma > Priority: Minor > > This jira is for an enhancement to add support for > boolean as a trafodion datatype in following cases: > -- As a column datatype > -- As part of hive column > -- In a CAST statement > -- As an input param -- This message was sent by Atlassian JIRA (v6.3.4#6332)