From ieslick at common-lisp.net Fri Oct 19 16:06:01 2007 From: ieslick at common-lisp.net (ieslick) Date: Fri, 19 Oct 2007 12:06:01 -0400 (EDT) Subject: [elephant-cvs] CVS elephant/src/db-bdb Message-ID: <20071019160601.991165E10F@common-lisp.net> Update of /project/elephant/cvsroot/elephant/src/db-bdb In directory clnet:/tmp/cvs-serv24934/src/db-bdb Modified Files: bdb-collections.lisp Log Message: Fixing collection comparison bugs --- /project/elephant/cvsroot/elephant/src/db-bdb/bdb-collections.lisp 2007/04/25 02:27:58 1.23 +++ /project/elephant/cvsroot/elephant/src/db-bdb/bdb-collections.lisp 2007/10/19 16:06:00 1.24 @@ -419,10 +419,11 @@ (multiple-value-bind (k v) (db-cursor-get-both-buffered (cursor-handle cursor) key-buf value-buf :get-both t) - (declare (ignore v)) (if k (progn (setf (cursor-initialized-p cursor) t) - (values t key value)) + (values t + (progn (buffer-read-oid k) (deserialize k sc)) + (deserialize v sc))) (setf (cursor-initialized-p cursor) nil)))))) (defmethod cursor-get-both-range ((cursor bdb-cursor) key value) @@ -436,7 +437,9 @@ key-buf value-buf :get-both-range t) (if k (progn (setf (cursor-initialized-p cursor) t) - (values t key (deserialize v sc))) + (values t + (progn (buffer-read-oid k) (deserialize k sc)) + (deserialize v sc))) (setf (cursor-initialized-p cursor) nil)))))) (defmethod cursor-delete ((cursor bdb-cursor)) @@ -590,9 +593,10 @@ (if k (progn (setf (cursor-initialized-p cursor) t) - (values t key (deserialize val sc) - (progn (buffer-read-oid pkey) - (deserialize pkey sc)))) + (values t + (progn (buffer-read-oid k) (deserialize k sc)) + (deserialize val sc) + (progn (buffer-read-oid pkey) (deserialize pkey sc)))) (setf (cursor-initialized-p cursor) nil)))))) (defmethod cursor-pset-range ((cursor bdb-secondary-cursor) key) @@ -624,7 +628,10 @@ (declare (ignore p)) (if k (progn (setf (cursor-initialized-p cursor) t) - (values t key (deserialize val sc) pkey)) + (values t + (progn (buffer-read-oid k) (deserialize k sc)) + (deserialize val sc) + pkey)) (setf (cursor-initialized-p cursor) nil)))))) (defmethod cursor-pget-both-range ((cursor bdb-secondary-cursor) key pkey) @@ -640,7 +647,9 @@ pkey-buf value-buf :get-both-range t) (if k (progn (setf (cursor-initialized-p cursor) t) - (values t key (deserialize val sc) + (values t + (progn (buffer-read-oid k) (deserialize k sc)) + (deserialize val sc) (progn (buffer-read-oid p) (deserialize p sc)))) (setf (cursor-initialized-p cursor) nil)))))) @@ -688,7 +697,8 @@ (db-cursor-move-buffered (cursor-handle cursor) key-buf value-buf :next-dup t) (if (and key (= (buffer-read-oid key) (cursor-oid cursor))) - (values t (deserialize key (get-con (cursor-btree cursor))) + (values t + (deserialize key (get-con (cursor-btree cursor))) (deserialize val (get-con (cursor-btree cursor)))) (setf (cursor-initialized-p cursor) nil)))))) From ieslick at common-lisp.net Fri Oct 19 16:06:01 2007 From: ieslick at common-lisp.net (ieslick) Date: Fri, 19 Oct 2007 12:06:01 -0400 (EDT) Subject: [elephant-cvs] CVS elephant/src/elephant Message-ID: <20071019160601.F1CA21B000@common-lisp.net> Update of /project/elephant/cvsroot/elephant/src/elephant In directory clnet:/tmp/cvs-serv24934/src/elephant Modified Files: collections.lisp Log Message: Fixing collection comparison bugs --- /project/elephant/cvsroot/elephant/src/elephant/collections.lisp 2007/07/10 21:03:23 1.33 +++ /project/elephant/cvsroot/elephant/src/elephant/collections.lisp 2007/10/19 16:06:01 1.34 @@ -400,13 +400,13 @@ (typecase a (number (<= a b)) (persistent (<= (oid a) (oid b))) - (string (string<= a b)) - (symbol (string<= (symbol-name a) (symbol-name b))) - (pathname (string<= (namestring a) (namestring b))) + (string (string-not-greaterp a b)) + (symbol (string-not-greaterp (symbol-name a) (symbol-name b))) + (pathname (string-not-greaterp (namestring a) (namestring b))) (t nil))))) (defun lisp-compare-equal (a b) - (equal a b)) + (equalp a b)) (defgeneric map-btree (fn btree &rest args &key start end value from-end collect &allow-other-keys) (:documentation "Map btree maps over a btree from the value start to the value of end. @@ -507,7 +507,7 @@ (if from-end (cursor-current cur) (cursor-pnext-nodup cur))) - (map-values () + (map-values () ;; Handle the next key value (multiple-value-bind (exists? skey val pkey) (value-increment)