[ 
https://issues.apache.org/jira/browse/NIFI-5026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16418619#comment-16418619
 ] 

ASF subversion and git services commented on NIFI-5026:
-------------------------------------------------------

Commit fd31c161a25fe6009ce35c1e554d4eeb6ed320fd in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=fd31c16 ]

NIFI-5026: Refactored StandardPreparedQuery so that instead of a List of 
Strings that may or may not correspond to compiled expressions and a Map of 
String to Compiled Expression, the StandardPreparedQuery now just takes a List 
of Expression objects, and those Expressions can be evaluated to return the 
proper result

Signed-off-by: Pierre Villard <pierre.villard...@gmail.com>

This closes #2592.


> Expression Language Query.prepare function can sometimes ignore escape 
> sequence
> -------------------------------------------------------------------------------
>
>                 Key: NIFI-5026
>                 URL: https://issues.apache.org/jira/browse/NIFI-5026
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>             Fix For: 1.7.0
>
>
> As reported on the [dev@n.a.o|mailto:dev@n.a.o] mailing list:
>  
> Hi,
> It looks like I have stumbled upon a bug in substitution of evaluated 
> expressions.
> A test case:
> {code:java}
> String result = 
> org.apache.nifi.attribute.expression.language.Query.prepare("${foo}$${foo}").evaluateExpressions(Collections.singletonMap("foo",
>  "bar"), null);{code}
> Expected result:
> {code:java}
> bar${foo}{code}
> Observed result:
> {code:java}
> barbar{code}
> The issue exists in 1.5.0 and, as far as I can tell, in the master branch.The 
> cause is quite simple: Query.prepare(...) splits the input string into pieces 
> to be evaluated and substituted or to be copied literally, but it doesn't 
> keep track of which is which.That couldn't possibly work. If a piece to be 
> copied literally happens to be equal to one of the pieces to be substituted, 
> the things go wrong, as the test case demonstrates.
> Regards,Sergei.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to