[elephant-cvs] CVS elephant/src/db-bdb
ieslick
ieslick at common-lisp.net
Mon Sep 4 04:56:50 UTC 2006
Update of /project/elephant/cvsroot/elephant/src/db-bdb
In directory clnet:/tmp/cvs-serv7921
Modified Files:
bdb-collections.lisp
Log Message:
Fixed add-index bug leading to incomplete indices
--- /project/elephant/cvsroot/elephant/src/db-bdb/bdb-collections.lisp 2006/06/19 00:47:24 1.8
+++ /project/elephant/cvsroot/elephant/src/db-bdb/bdb-collections.lisp 2006/09/04 04:56:50 1.9
@@ -134,14 +134,18 @@
(reset-buffer-stream primary-buf)
(reset-buffer-stream secondary-buf)))
(let ((key-fn (key-fn index))
- (last-key nil))
- (loop
+ (last-key nil)
+ (continue t))
+ (loop while continue
+ do
(with-transaction (:store-controller sc)
(with-btree-cursor (cursor bt)
(if last-key
(cursor-set cursor last-key)
(cursor-first cursor))
- (loop for i from 0 upto 1000 do
+ (loop for i from 0 upto 1000
+ while continue
+ do
(multiple-value-bind (valid? k v) (cursor-current cursor)
(unless valid? (return-from populate t))
(multiple-value-bind (index? skey) (funcall key-fn index k v)
@@ -150,7 +154,8 @@
(declare (ignore v))
(if valid?
(setf last-key k)
- (return-from populate t))))))))))))
+ (setf continue nil))))))))))))
+
(defmethod map-indices (fn (bt bdb-indexed-btree))
(maphash fn (indices-cache bt)))
More information about the Elephant-cvs
mailing list