Update of /project/elephant/cvsroot/elephant/src/db-clsql In directory clnet:/tmp/cvs-serv6425/src/db-clsql
Modified Files: sql-collections.lisp Log Message: Fixed fencepost error in cursor-prev-x in clsql data store
--- /project/elephant/cvsroot/elephant/src/db-clsql/sql-collections.lisp 2007/04/12 02:47:24 1.13 +++ /project/elephant/cvsroot/elephant/src/db-clsql/sql-collections.lisp 2007/04/29 04:03:28 1.14 @@ -518,18 +518,19 @@ (cursor-prev-x cursor) ) (defmethod cursor-prev-x ((cursor sql-secondary-cursor) &key (returnpk nil)) - (declare (optimize (speed 3))) +;; (declare (optimize (speed 3))) (if (cursor-initialized-p cursor) (progn - (let ((cur-pk (get-current-key cursor))) + (let ((prior-pk (get-current-key cursor))) (decf (sql-crsr-ck cursor)) - (if (equal cur-pk (get-current-key cursor)) + (format t "prior-key: ~A current-key: ~A%" prior-pk (get-current-key cursor)) + (if (eq prior-pk (get-current-key cursor)) (setf (dp-nmbr cursor) (max 0 (- (dp-nmbr cursor) 1))) - (setf (dp-nmbr cursor) - (sql-get-from-clcn-cnt (cursor-oid cursor) - (get-current-key cursor) - (get-con (cursor-btree cursor)) - )))) + (setf (dp-nmbr cursor) + (1- (sql-get-from-clcn-cnt (cursor-oid cursor) + (get-current-key cursor) + (get-con (cursor-btree cursor)))) + ))) (has-key-value-scnd cursor :returnpk returnpk)) (cursor-last-x cursor :returnpk returnpk)))