tonsky / datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Eclipse Public License 1.0
5.45k stars 304 forks source link

Bugfixes for sum-rel and shortcircuited or/or-join branches #460

Closed galdre closed 7 months ago

galdre commented 7 months ago

My previous PR inadvertently broke or/or-join when a branch shortcircuits due to being empty. (Sorry!)

If one branch of an or or or-join short-circuited, the resulting Relation would not have the expected attrs, resulting in Can’t sum relations with different attrs being raised.

This fixes the bug and adds regression tests. Fixing that also exposed an extant bug in same-keys? which is now fixed.

tonsky commented 7 months ago

I though of that but hoped we already have tests. Good catch!