Hello,
during the analysis of a bug in our program we found an issue with a query that does not return the expected entity. We have attached the corresponding database.
The query is:
 SELECT dep FROM UsedInDependency AS dep
 WHERE dep.sheet.uid == '317j'
 AND dep.source.row.q + dep.source.row.offsetEntry.offset >= 1
 AND dep.source.row.q + dep.source.row.offsetEntry.offset <= 1
 AND dep.target.row.q + dep.target.row.offsetEntry.offset > 1  
We expect it to find entity 318E, however, the query returns the entity with UID: 318F. However, the returned entity does not fulfill the provided conditions:
 source.row.q = 2
 source.row.offsetEntry.offset = 1  
 dep.target.row.q = 2
 dep.target.row.offsetEntry.offset = 1  
Can you please investigate this issue or let us know, what we did wrong?
 For now, we can use the following workaround that returns the intended result:
 SELECT dep FROM UsedInDependency AS dep
 WHERE dep.sheet.uid == '317j'
 AND dep.source.row.q + dep.source.row.offsetEntry.offset BETWEEN 1 AND 1
 AND dep.target.row.q + dep.target.row.offsetEntry.offset > 1
 
    
Thanks,
The BTC-ES team
