Skip to content
Snippets Groups Projects
Unverified Commit a566bd32 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Add test for #13932 (#19766)

parent 81ce8384
No related branches found
No related tags found
No related merge requests found
(ns metabase.driver.vertica-test
(:require [clojure.test :refer :all]
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
[metabase.query-processor :as qp]
[metabase.test :as mt]
[metabase.test.util :as tu]))
......@@ -18,3 +19,24 @@
:port 5433
:db "birds-near-me"
:additional-options "ConnectionLoadBalance=1"}))))))
(deftest dots-in-column-names-test
(mt/test-driver :vertica
(testing "Columns with dots in the name should be properly quoted (#13932)"
(mt/dataset dots-in-names
(is (= {:query (str "SELECT * "
"FROM table "
"WHERE \"public\".\"dots_in_names_objects.stuff\".\"dotted.name\" = ?")
:params ["ouija_board"]}
(qp/query->native
{:database (mt/id)
:type :native
:native {:query "SELECT * FROM table WHERE {{x}}"
:template-tags {"x" {:name "x"
:display-name "X"
:type :dimension
:dimension [:field (mt/id :objects.stuff :dotted.name) nil]
:widget-type :text}}}
:parameters [{:type :text
:target [:dimension [:template-tag "x"]]
:value "ouija_board"}]})))))))
......@@ -117,13 +117,6 @@
;;; ------------------------------------------- Tests for sync edge cases --------------------------------------------
(mt/defdataset dots-in-names
[["objects.stuff"
[{:field-name "dotted.name", :base-type :type/Text}]
[["toucan_cage"]
["four_loko"]
["ouija_board"]]]])
(deftest edge-case-identifiers-test
(mt/test-driver :postgres
(testing "Make sure that Tables / Fields with dots in their names get escaped properly"
......
......@@ -210,3 +210,10 @@
(t/offset-time t) ; time-ltz
(t/offset-time t) ; time-tz
cnt])]]) ; num-crows
(tx/defdataset dots-in-names
[["objects.stuff"
[{:field-name "dotted.name", :base-type :type/Text}]
[["toucan_cage"]
["four_loko"]
["ouija_board"]]]])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment