Fri Aug 17, 2018 11:09 pm
Login Register Lost Password? Contact Us


ECLPlus not returning valid XML with Assert

Comments and questions related to the Enterprise Control Language

Tue Oct 31, 2017 11:33 am Change Time Zone

ECLPlus not returning valid XML with Assert

HPCC version 5.6.4, client tools 5.6.4... (Also with version 6.4.2)
I run this ECL:
Code: Select all
OUTPUT('Test 1 <>&');

ASSERT(1 = 2, 'Test 2 <>&');


If I run code with client tools ecl run, XML is ok.
/opt/HPCCSystems/5.6.4/clienttools/bin/ecl run --server 1.1.1.1 --port 8010 --username 'oscarfoley' --password ' ' -legacy thor testecl.ecl
Code: Select all
<Result>
<Exception><Code>100000</Code><Filename>testecl.ecl</Filename><Line>3</Line><Source>user</Source><Message>Test 2 &lt;&gt;&amp;</Message></Exception>
<Dataset name='Result 1'>
<Row><Result_1>Test 1 &lt;&gt;&amp;</Result_1></Row>
</Dataset>
</Result>


But if I get the very same work unit result with ecl plus, XML is invalid :o
eclplus server=10.53.57.69 action=view wuid=W20171030-184629 format=xml
Code: Select all
<Error><source>user</source><line>3</line><code>100000</code><message>Test 2 <>&</message></Error>
<Dataset name='Result 1'>
<Row><Result_1>Test 1 &lt;&gt;&amp;</Result_1></Row>
</Dataset>


XML retrieved by ECLPlus is invalid because:
1) ASSERT message <message>Test 2 <>&</message> does not escape XML special characters so XML is invalid. However OUTPUT Test1 is correctly escaped.
2) XML does not have root element. Everything should be surrounded by <Result></Result>
3) XML returned by ecl run and eclplus have different casing for ASSERT. XML is Case sensitive...
4) XML returned by ecl run and eclplus is different for ASSERT. They should be identical, shouldn't them? One uses <Exception> and the other <Error>
Code: Select all
<Exception><Code>100000</Code><Filename>testecl.ecl</Filename><Line>3</Line><Source>user</Source><Message>Test 2 &lt;&gt;&amp;</Message></Exception>

vs.

<Error><source>user</source><line>3</line><code>100000</code><message>Test 2 <>&</message></Error>
oscar.foley
 
Posts: 33
Joined: Mon Sep 12, 2016 10:27 am

Tue Oct 31, 2017 1:07 pm Change Time Zone

Oscar,

Excellent bug report! Now you can easily copy/paste your post into a JIRA ticket (https://track.hpccsystems.com) so the developers are absolutely aware of the issue and can monitor/track its progress through the system. :)

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1370
Joined: Wed Oct 26, 2011 7:40 pm

Wed Nov 01, 2017 4:44 pm Change Time Zone

oscar.foley
 
Posts: 33
Joined: Mon Sep 12, 2016 10:27 am


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest

cron