Skip to content
Snippets Groups Projects
Commit bca065ca authored by Cam Saül's avatar Cam Saül
Browse files

Test joins with duplicate column names :yum:

parent 9cc03d5b
Branches
Tags
No related merge requests found
......@@ -84,3 +84,23 @@
(-> (data/dataset metabase.driver.postgres-test/dots-in-names
(data/run-query objects.stuff))
:data (dissoc :cols)))
;;; # Make sure that duplicate column names (e.g. caused by using a FK) still return both columns
(def-database-definition duplicate-names
["birds"
[{:field-name "name", :base-type :TextField}]
[["Rasta"]
["Lucky"]]]
["people"
[{:field-name "name", :base-type :TextField}
{:field-name "bird_id", :base-type :IntegerField, :fk :birds}]
[["Cam" 1]]])
(expect-with-engine :postgres
{:columns ["name" "name_2"]
:rows [["Cam" "Rasta"]]}
(-> (data/dataset metabase.driver.postgres-test/duplicate-names
(data/run-query people
(ql/fields $name $bird_id->birds.name)))
:data (dissoc :cols)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment