-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query Bug: False positive results #319
Comments
These queries do not seem to make sense.
So This is a pathological case, and I would consider this undefined behavior. Of course, we could check for this and make the handling of these more robust. But it would be an enhancement, not a bug fix. |
This query is part of a larger query which is generated by a higher level query language so it's definitely an edge case The full query is a bit harder to follow so I just posted the simplest case I could find which produced similar behavior This is the full query, but it won't reproduce on this test data [:find
(pull ?Evidence [:block/string :node/title :block/uid])
(pull ?Evidence [:block/uid])
:where
[?gLLeASJNc-ParentPage :block/uid "test"]
[?gLLeASJNc-SPage :node/title "Opposed By"]
[?gLLeASJNc-ParentPage :block/uid ?gLLeASJNc-v6ruZRoob-uid]
[?v6ruZRoob :block/uid ?gLLeASJNc-v6ruZRoob-uid]
[?gLLeASJNc-SBlock :block/refs ?gLLeASJNc-SPage]
[?gLLeASJNc-SBlock :block/children ?gLLeASJNc-Block]
[?gLLeASJNc-Block :block/refs ?gLLeASJNc-Page]
[?gLLeASJNc-Page :node/title ?gLLeASJNc-Page-Title]
[?gLLeASJNc-Page :block/uid ?gLLeASJNc-Evidence-uid]
[?Evidence :block/uid ?gLLeASJNc-Evidence-uid]
[?gLLeASJNc-PBlock :block/refs ?gLLeASJNc-ParentPage]
[?gLLeASJNc-PBlock :block/children ?gLLeASJNc-SBlock]
[(re-pattern "^\[\[EVD\]\] - (.*?) - (.*?)$") ?gLLeASJNc-EVD---regex]
[(re-find ?gLLeASJNc-EVD---regex ?gLLeASJNc-Page-Title)]
] I can observe the same behavior with a non unique identity as well like this, to me it seems to have to do with the non unifying clauses. (dl/q
'[:find ?SBlock
:where
[?ParentPage :block/refs 1]
[?SPage :node/title "Opposed By"]
[?ParentPage :block/refs ?some-uid]
[?SBlock :block/refs ?SPage]
]
@conn) Anyway, if this is expected I can try to detect it in my code |
It is an edge case that I have not considered, so it needs to be detected and handled properly. The next release should have a fix. |
The following query produces results when I would expect it to produce none. (I'm on 0.9.20)
If I swap the clause order it does return what I would expect
A similar issue happens if I remove the
:block/refs
clause, but this time it returns a nil idThanks in advance for looking into this!
The text was updated successfully, but these errors were encountered: