diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-01 07:49:50 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-01 07:49:50 +1000 |
commit | 9702f336ccc46e0eb0759596c6462963d9f6548d (patch) | |
tree | f8470f20c98098e370b3f04ff2a6e1eab6049a85 | |
parent | a4863c9ef9986bee2a08f758de3faa53bbf09ebf (diff) |
Make sure you never try to take a negative number of things!
-rw-r--r-- | src/clojure_sql/dsl.clj | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clojure_sql/dsl.clj b/src/clojure_sql/dsl.clj index 6d9b413..6ba81bc 100644 --- a/src/clojure_sql/dsl.clj +++ b/src/clojure_sql/dsl.clj @@ -371,7 +371,7 @@ (-> query (take 10) (drop 2)) = (-> query (drop 2) (take 8))" [query n] (let [query (if-let [old-take (:take query)] - (assoc query :take (- old-take n)) + (assoc query :take (max (- old-take n) 0)) query)] (if-let [old-drop (:drop query)] (assoc query :drop (+ old-drop n)) |