Skip to content

Commit

Permalink
Merge pull request #12283 from shamser/issue21492
Browse files Browse the repository at this point in the history
HPCC-21492 Report an error if embed : activity has an unsupported return type

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday committed Mar 15, 2019
2 parents fcaaf87 + 51c019f commit 2b03eef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ecl/hql/hqlgram2.cpp
Expand Up @@ -918,6 +918,12 @@ IHqlExpression * HqlGram::processEmbedBody(const attribute & errpos, IHqlExpress
if (!type)
type.setown(makeVoidType());

if (type->getTypeCode()!=type_table && type->getTypeCode()!=type_groupedtable && type->getTypeCode()!=type_void)
{
if (attribs && queryAttributeInList(activityAtom,attribs))
reportError(ERR_EMBEDERROR, errpos, "Embedded activity only supports dataset return type or action");
}

if (type->getTypeCode() == type_record)
type.setown(makeRowType(LINK(type)));

Expand Down
8 changes: 8 additions & 0 deletions ecl/regress/embedactivity2err.ecl
@@ -0,0 +1,8 @@
rec := { string f1; };

UNSIGNED4 myfunc(STREAMED DATASET(rec) recs) := EMBED(C++: activity)
#body
return 0
ENDEMBED;

myfunc(DATASET([{'f1'}], rec));

0 comments on commit 2b03eef

Please sign in to comment.