<< Back to previous view

[LOGIC-65] fix for corrupted rel indexes if retracting duplicate tuples Created: 30/Oct/12  Updated: 28/Jul/13  Resolved: 30/Oct/12

Status: Closed
Project: core.logic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Jeff Dik Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File 0001-fix-for-corrupted-rel-indexes-if-retracting-duplicat.patch    
Patch: Code and Test

 Description   

If a duplicate tuple is retracted from a rel, the rel indexes get corrupted, resulting in a NullPointerException when the following query is run:

(defrel rel2 ^:index e ^:index a ^:index v)
(facts rel2 [[:e1 :a1 :v1]
             [:e1 :a2 :v2]])
(retractions rel2 [[:e1 :a1 :v1]
                   [:e1 :a1 :v1]
                   [:e1 :a2 :v2]])

(deftest rel2-dup-retractions
  (is (= (run* [out]
               (fresh [e a v]
                      (rel2 e :a1 :v1)
                      (rel2 e a v)
                      (== [e a v] out))))
      '()))


 Comments   
Comment by David Nolen [ 30/Oct/12 6:37 PM ]

fixed, http://github.com/clojure/core.logic/commit/715aebfbfc95f4332d98539583fd664b92e4810f

Generated at Sun Apr 20 11:10:44 CDT 2014 using JIRA 4.4#649-r158309.