replikativ/datahike

[Bug]: not-join variables not respected

Opened this issue · 2 comments

zoren commented

What version of Datahike are you using?

0.4.0

What version of Java are you using?

11.0.11

What operating system are you using?

macOS

What database EDN configuration are you using?

I'm using a vector of facts as input.

Describe the bug

With the query given below I get #{[:leo] [:sussi]}, but with Datascript and Datomic I get #{[:sussi]}. And I think that is what one should expect. ?release is not in the list of not-join variable so it should not be bound to the parameter.

What is the expected behaviour?

I would expect to get #{[:sussi]} instead.

How can the behaviour be reproduced?

 (q
  '[:in $ ?release
    :where [$ ?artist :artist/name]
    ($ not-join [?artist]
       [?release :release/artists ?artist]
       [?release :release/year 1970])
    :find ?artist]
  [[:sussi :artist/name "Sussi"]
   [1 :release/artists :sussi]
   [1 :release/year 1969]
   [:leo :artist/name "Leo"]
   [2 :release/artists :leo]
   [2 :release/year 1970]]
  1)

Thanks for reporting that @zoren. What additional features do you use? Like keep-history?, attribute-refs?and what kind of backend?

zoren commented

Thanks for reporting that @zoren. What additional features do you use? Like keep-history?, attribute-refs?and what kind of backend?

I don't use any additional features. I'm not using a backend just providing facts in-line.