You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Expected: No rows returned, actual rows are returned
select * from V where ( ( (1=1) or (1 in (select 1 from V)) ) and 1=2 )
Steps to reproduce the problem
The following query run from the OrientDB UI is returning rows, even though “and 1=2" should always be false:
select * from V where ( ( (1=1) or (1 in (select 1 from V)) ) and 1=2 )
But if I simply change the order of the "or" condition, then the query correctly honors the "and" condition and returns no rows:
select * from V where ( ( (1 in (select 1 from V)) or (1=1) ) and 1=2 )
It looks like a OrientDB query parsing bug where if you have an “in” after an “or” condition, then the rest of the query is ignored. Note that you can reproduce the problem by using any class, not just V.
The text was updated successfully, but these errors were encountered:
I tried to read through the code myself for parsing. Unfortunately, it's pretty complex. Looks like there is a tree construct used for parsing. I am still trying to research why the "or" condition can short-circuit further evaluation.
I can confirm, next 3.0 is not affected by this problem.
Unfortunately the solution cannot be ported back because of some intrinsic differences in the query engines, but for sure we will address it in 2.2 (soon, I hope, but it's a tricky issue)
OrientDB Version, operating system, or hardware.
Operating System
Expected behavior and actual behavior
//Expected: No rows returned, actual rows are returned
select * from V where ( ( (1=1) or (1 in (select 1 from V)) ) and 1=2 )
Steps to reproduce the problem
The following query run from the OrientDB UI is returning rows, even though “and 1=2" should always be false:
select * from V where ( ( (1=1) or (1 in (select 1 from V)) ) and 1=2 )
But if I simply change the order of the "or" condition, then the query correctly honors the "and" condition and returns no rows:
select * from V where ( ( (1 in (select 1 from V)) or (1=1) ) and 1=2 )
It looks like a OrientDB query parsing bug where if you have an “in” after an “or” condition, then the rest of the query is ignored. Note that you can reproduce the problem by using any class, not just V.
The text was updated successfully, but these errors were encountered: