LauJensen / clojureql

ClojureQL is superior SQL integration for Clojure
https://clojureql.sabrecms.com
Eclipse Public License 1.0
284 stars 39 forks source link

Possible Bug in Union /Difference when using constraints #91

Closed base-zz closed 12 years ago

base-zz commented 13 years ago

;Creating tables works as expected

(def a (select (table db :a) (where (and (= :id 12345) (= :name "fred"))))) a 1:523 sql=> SELECT a.* FROM a WHERE ((a.id = 12345) AND (a.name = fred))

(def b (select (table db :a) (where (and (= :id 6789) (= :name "john"))))) b 1:526 sql=> SELECT a.* FROM a WHERE ((a.id = 6789) AND (a.name = john))

;as you can see these appear normal. ;However attempting some of the operations provides some strange results

(-> a (union b :all)) 1:542 sql=> (SELECT a.* FROM a WHERE ((a.id = 12345) AND (a.name = fred))) UNION ALL (SELECT a.* FROM a WHERE ((a.id = 6789) AND (a.name = ?)))

(-> a (difference b :all)) 1:546 sql=> (SELECT a.* FROM a WHERE ((a.id = 12345) AND (a.name = fred))) EXCEPT ALL (SELECT a.* FROM a WHERE ((a.id = 6789) AND (a.name = ?)))

; i have been wrestling with this for a few ; days now and am really unsure why this wont ; work. Any help would be appreciated. ;Thanks!

bendlas commented 13 years ago

Duplicate of #81

LauJensen commented 12 years ago

Fixed in HEAD