You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by hz...@apache.org on 2018/08/27 20:01:04 UTC
[2/3] trafodion git commit: [TRAFODION-3177] Addressing review
comments.
[TRAFODION-3177] Addressing review comments.
Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/a1663836
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/a1663836
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/a1663836
Branch: refs/heads/master
Commit: a16638368cd7332434d56d1f837eb71c00469f21
Parents: 5ecb689
Author: Hans Zeller <hz...@apache.org>
Authored: Mon Aug 27 16:36:28 2018 +0000
Committer: Hans Zeller <hz...@apache.org>
Committed: Mon Aug 27 16:36:28 2018 +0000
----------------------------------------------------------------------
core/sql/sqludr/SqlUdrPredefLogReader.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafodion/blob/a1663836/core/sql/sqludr/SqlUdrPredefLogReader.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqludr/SqlUdrPredefLogReader.cpp b/core/sql/sqludr/SqlUdrPredefLogReader.cpp
index b5d9ab8..255e3ad 100644
--- a/core/sql/sqludr/SqlUdrPredefLogReader.cpp
+++ b/core/sql/sqludr/SqlUdrPredefLogReader.cpp
@@ -1367,14 +1367,22 @@ bool ReadCppEventsUDFInterface::validateEvent(const UDRInvocationInfo &info,
constStr.clear();
for(size_t j = 0; j < temp.size(); ++j)
constStr += (std::toupper(temp[j]));
- constStr.erase(constStr.find_last_not_of(" ")+1);
+ size_t trimPos = constStr.find_last_not_of(" ");
+ if (trimPos != std::string::npos)
+ constStr.erase(trimPos+1);
+ else
+ constStr = "";
// convert event value
temp = currField;
std::string eventStr;
for(size_t j = 0; j < temp.size(); ++j)
eventStr += (std::toupper(temp[j]));
- eventStr.erase(eventStr.find_last_not_of(" ")+1);
+ trimPos = eventStr.find_last_not_of(" ");
+ if (trimPos != std::string::npos)
+ eventStr.erase(trimPos+1);
+ else
+ eventStr = "";
switch (info.getComparisonPredicate(i).getOperator())
{