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

Gordon Sim commented on QPID-6717:
----------------------------------

I believe your test is wrong:

BOOST_CHECK(qb::Selector("1 NOT IN ('hello', 'there', 'polly')").eval(env)); 

Should always evaluate to false i.e. never match, because the types are not 
valid to be tested together.

"1 IN ('hello', 'there', 'polly')" should also evaluate to false though, so if 
that isn't the case then that would indeed be a problem.

Also, the list for the IN expression must only contain string literals, so I 
believe that selectors like "'hell' IN ('hello', 'there', 1 , true, (1-17))" 
are in fact syntactically invalid and should be rejected.

> selector can match incorrectly due to different type for values
> ---------------------------------------------------------------
>
>                 Key: QPID-6717
>                 URL: https://issues.apache.org/jira/browse/QPID-6717
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: qpid-cpp-0.34
>            Reporter: Gordon Sim
>            Assignee: Andrew Stitcher
>            Priority: Minor
>             Fix For: qpid-cpp-next
>
>
> E.g. a selector "x BETWEEN 1 AND 10" would match for a value of x="foo", 
> because of the way the logic is implemented for the between expression, or a 
> selector "x NOT IN ('a', 'b', 'c')" would match where x=1, though it should 
> not due to the type mismatch.
> From JMS spec: "Only like type values can be compared. One exception is that 
> it is valid to compare exact numeric values and approximate numeric values"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to