[elephant-devel] bug in map-inverted-index

Ian Eslick eslick at media.mit.edu
Mon May 12 18:34:52 UTC 2008


map-index was missing a check for a valid key after the first value  
query.  I've patched, verified and pushed a fix along with the test  
case to elephant-unstable.

Thank you for finding this!

Ian

On May 12, 2008, at 2:24 PM, Ian Eslick wrote:

> That test was great.  I reproduced this on my Mac under Allegro with  
> BDB 4.6.  Will let you know what I find...  I also added the test to  
> testindexing.lisp.
>
> On May 12, 2008, at 2:08 PM, Ryszard Szopa wrote:
>
>> Hey,
>>
>> map-inverted-index shows some strange behavior. When you pass it
>> `start' and `end' arguments and there are no objects that satisfy the
>> range, it maps over the first object greater than end. I haven't have
>> time to investigate it thoroughly, but I have written a 5am unit-test
>> (you are using this test framework, aren't you?).
>>
>> (defpclass foo ()
>> ((str :type string
>> 	:initarg :str
>> 	:reader str-of
>> 	:index t)))
>>
>> (test map-inverted-index-1
>> (with-open-store (`(:bdb "/tmp/store/"))
>>   (drop-instances (get-instances-by-class 'foo))
>>   (loop :for st :in '("a" "b" "c" "d" "g" "ga" "gb" "gc" "z")
>> 	  :do (make-instance 'foo :str st))
>>   (is (null (map-inverted-index (lambda (x y)
>> 				    (declare (ignore y))
>> 				    x) 'foo 'str :start "f" :end "fz" :collect t)))))
>>
>> This was on Ubuntu Hardy Heron, with BerkeleyDB 4.5 from Ubuntu
>> packages, SBCL 1.0.15 and the newest unstable branch of Elephant  
>> (I've
>> just made darcs pull). Funny enough, a friend of mine who is using a
>> Macintosh is not getting this bug (he also uses unstable but I'm not
>> sure whether it is the newest version).
>>
>> -- 
>> http://szopa.tasak.gda.pl/
>> _______________________________________________
>> elephant-devel site list
>> elephant-devel at common-lisp.net
>> http://common-lisp.net/mailman/listinfo/elephant-devel
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel




More information about the elephant-devel mailing list