Add test to V2 for issue #282

This commit is contained in:
Sean Corfield 2020-10-28 16:26:35 -07:00
parent 273732089b
commit 39a83ae57e

View file

@ -254,3 +254,20 @@
(from [:foo :f])
(cross-join [:bar :b])
sql/format))))
(defn- stack-overflow-282 [num-ids]
(let [ids (range num-ids)]
(sql/format (reduce
where
{:select [[:id :id]]
:from [:collection]
:where [:= :personal_owner_id nil]}
(clojure.core/for [id ids]
[:not-like :location [:raw (clojure.core/format "'/%d/%%'" id)]])))))
(deftest issue-282
(is (= [(str "SELECT id AS id FROM collection"
" WHERE (personal_owner_id IS NULL)"
" AND (location NOT LIKE '/0/%')"
" AND (location NOT LIKE '/1/%')")]
(stack-overflow-282 2))))