Skip to content

Commit 796ea3c

Browse files
committed
fixed params
1 parent 4341f64 commit 796ea3c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/metabase/driver/teradata.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,15 @@
205205

206206
;; Overridden to have access to the database with the configured property dbnames (inclusion list)
207207
;; which will be used to filter the schemas.
208-
(defmethod driver/describe-database :teradata
209-
[driver database]
210-
(jdbc/with-db-metadata [metadata driver database]
208+
(defmethod driver/describe-database :teradata [driver database]
209+
(jdbc/with-db-metadata [metadata (sql-jdbc.conn/db->pooled-connection-spec database)]
211210
{:tables (fast-active-tables, driver, ^DatabaseMetaData metadata, database)}))
212211

213212
(defn- run-query
214213
"Run the query itself without setting the timezone connection parameter as this must not be changed on a Teradata connection.
215214
Setting connection attributes like timezone would make subsequent queries behave unexpectedly."
216215
[{sql :query, params :params, remark :remark} timezone connection]
217-
(let [sql (s/replace (s/replace (str "-- " remark "\n" (hx/unescape-dots sql)) "OFFSET" "") "test_data" "test-data") ;; temporary hack
216+
(let [sql (s/replace (s/replace (str "-- " remark "\n" sql) "OFFSET" "") "test_data" "test-data") ;; temporary hack
218217
statement (into [sql] params)
219218
[columns & rows] (jdbc/query connection statement {:identifiers identity, :as-arrays? true
220219
:read-columns (#'metabase.driver.sql-jdbc.execute/read-columns :teradata timezone)})]

0 commit comments

Comments
 (0)