[
https://issues.apache.org/jira/browse/TRAFODION-3177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16581575#comment-16581575
]
ASF GitHub Bot commented on TRAFODION-3177:
-------------------------------------------
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?
> Error when selecting count(*) from event_log_reader UDF
> -------------------------------------------------------
>
> Key: TRAFODION-3177
> URL: https://issues.apache.org/jira/browse/TRAFODION-3177
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-general
> Affects Versions: 2.1-incubating
> Reporter: Hans Zeller
> Assignee: Hans Zeller
> Priority: Major
> Fix For: 2.4
>
>
> When selecting no columns from the event_log_reader UDF, like in a select
> count( * ), I am getting the following error:
> {quote}>>prepare s from select count( * ) from udf(event_log_reader());
> *
> **
> *** ERROR[11252] Trying to access column number 11 but column list has only
> 10 elements (SQLSTATE 38900){quote}
> This is the same for both the predefined UDF or the one in schema "_LIBMGR_".
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)