test and fix for (select-instances (o) ...) bug reported by Mihai Bazon
Mon Oct 5 03:25:33 PDT 2009 tomi.borbely@gmail.com
* test and fix for (select-instances (o) ...) bug reported by Mihai Bazon
Warning: CRC errors found. These are probably harmless but should be repaired.
See 'darcs gzcrcs --help' for more information.
diff -rN -u old-cl-perec/query/plan.lisp new-cl-perec/query/plan.lisp
--- old-cl-perec/query/plan.lisp 2014-07-31 12:44:13.000000000 -0700
+++ new-cl-perec/query/plan.lisp 2014-07-31 12:44:13.000000000 -0700
@@ -832,13 +832,13 @@
(iter (with skipped-columns = 0)
(for variable in variables)
(for name in names)
- (for type = (persistent-type-of variable))
+ (for type = (backquote-type-syntax (persistent-type-of variable)))
(for slots = (prefetched-slots-for variable prefetch-mode))
(for column-counts = (mapcar #'column-count-of slots))
(for total-column-count = (reduce '+ column-counts :initial-value +oid-column-count+))
(cond ((not (member variable referenced-variables))
(incf skipped-columns total-column-count))
-
+
((zerop skipped-columns)
(collect
`(,name (prog1
diff -rN -u old-cl-perec/test/query/forum.lisp new-cl-perec/test/query/forum.lisp
--- old-cl-perec/test/query/forum.lisp 2014-07-31 12:44:13.000000000 -0700
+++ new-cl-perec/test/query/forum.lisp 2014-07-31 12:44:13.000000000 -0700
@@ -363,3 +363,9 @@
(not (equal o instance)) ;; this does not work, while (not (equal (oid-of o) (oid-of instance))) ok
;; cause: executed in lisp and o and instance are not equal (p-eq only)
(like (slot-value o slot-name) pattern)))))))
+
+(deftest test/query/select/select-instance/bug ()
+ (test-query (:select-count nil :fixture forum-data)
+ (bind ((oids (select ((oid-of instance)) (from (instance message-test)))))
+ (select-instances (o)
+ (where (member (oid-of o) oids))))))
\ No newline at end of file