From 9036377148afb61a492c04baf3d82c2c63175bb4 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 1 Jul 2013 09:54:56 +1000 Subject: Change the condition for union compatible (require projections first) --- src/clojure_sql/dsl.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/clojure_sql/dsl.clj b/src/clojure_sql/dsl.clj index 0a05763..5eae2d7 100644 --- a/src/clojure_sql/dsl.clj +++ b/src/clojure_sql/dsl.clj @@ -379,7 +379,8 @@ (assoc query :drop n)))) (defn ^:private union-compatible? [& queries] - (apply = (map (comp set keys :fields) queries))) + (and (every? (comp seq keys :fields) queries) + (apply = (map (comp set keys :fields) queries)))) (defn union "Combine the results of two queries" -- cgit v1.2.3