Skip to content
Snippets Groups Projects
Commit 7490bbdf authored by Ryan Senior's avatar Ryan Senior
Browse files

Minor fixes for reflection and a long line in the mysql tests

parent 1ea4584a
Branches
Tags
No related merge requests found
......@@ -471,11 +471,11 @@
(defn- run-query-without-timezone [driver settings connection query]
(do-in-transaction connection (partial run-query query nil)))
(defn- run-query-with-timezone [driver settings connection query]
(defn- run-query-with-timezone [driver {:keys [^String report-timezone] :as settings} connection query]
(try
(do-in-transaction connection (fn [transaction-connection]
(set-timezone! driver settings transaction-connection)
(run-query query (some-> settings :report-timezone TimeZone/getTimeZone) transaction-connection)))
(run-query query (some-> report-timezone TimeZone/getTimeZone) transaction-connection)))
(catch SQLException e
(log/error "Failed to set timezone:\n" (with-out-str (jdbc/print-sql-exception-chain e)))
(run-query-without-timezone driver settings connection query))
......
......@@ -31,7 +31,9 @@
;; make sure connection details w/ extra params work as expected
(expect
"//localhost:3306/cool?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF8&characterSetResults=UTF8&useLegacyDatetimeCode=true&useJDBCCompliantTimezoneShift=true&useSSL=false&tinyInt1isBit=false"
(str "//localhost:3306/cool?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF8"
"&characterSetResults=UTF8&useLegacyDatetimeCode=true&useJDBCCompliantTimezoneShift=true"
"&useSSL=false&tinyInt1isBit=false")
(:subname (sql/connection-details->spec (MySQLDriver.) {:host "localhost"
:port "3306"
:dbname "cool"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment