Add test to V2 for issue #282
This commit is contained in:
parent
273732089b
commit
39a83ae57e
1 changed files with 17 additions and 0 deletions
|
|
@ -254,3 +254,20 @@
|
||||||
(from [:foo :f])
|
(from [:foo :f])
|
||||||
(cross-join [:bar :b])
|
(cross-join [:bar :b])
|
||||||
sql/format))))
|
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))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue