Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1682#discussion_r210397770
--- Diff: core/sql/sqludr/SqlUdrPredefLogReader.cpp ---
@@ -1311,17 +1362,19 @@ bool ReadCppEventsUDFInterface::validateEvent(const
UDRInvocationInfo &info,
// All other comparisons are assumed to be string compares
else
{
- // convert predicate value
+ // convert and trim predicate value
temp = constStr;
constStr.clear();
for(size_t j = 0; j < temp.size(); ++j)
constStr += (std::toupper(temp[j]));
+ constStr.erase(constStr.find_last_not_of(" ")+1);
--- End diff --
What happens when find_last_not_of returns string::npos? (that is, when
there are no trailing blanks?) It seems string::npos is defined as -1
(unsigned), so adding 1 to it would get zero and we'd do erase(0) which erases
the whole string?
---