From e82094dd8643958711c8567702bad8a8d34bcdff Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Wed, 13 Nov 2019 10:51:14 -0800 Subject: [PATCH] Expand test for #73 to other databases This verifies that it is _only_ PostgreSQL that cannot do this conversion! --- test/next/jdbc_test.clj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/next/jdbc_test.clj b/test/next/jdbc_test.clj index 93d5ebc..69ce079 100644 --- a/test/next/jdbc_test.clj +++ b/test/next/jdbc_test.clj @@ -222,13 +222,13 @@ VALUES ('Pear', 'green', 49, 47) (doall (take 3 (jdbc/plan (ds) ["select * from fruit"])))))) (deftest issue-73 - (when (postgres?) - (try - (jdbc/execute-one! (ds) ["drop table temp_table"]) - (catch Throwable _)) - (jdbc/execute-one! (ds) ["create table temp_table (id serial primary key, deadline timestamp not null)"]) - (try - (jdbc/execute-one! (ds) ["insert into temp_table (deadline) values (?)" (java.util.Date.)]) - (catch Throwable t - (println "Issue #73: PostgreSQL cannot convert java.util.Date to timestamp by default?") - (println (ex-message t)))))) + ;; only postgresql cannot convert a java.util.Date to a timestamp column... + (try + (jdbc/execute-one! (ds) ["drop table temp_table"]) + (catch Throwable _)) + (jdbc/execute-one! (ds) ["create table temp_table (id int not null, deadline timestamp not null)"]) + (try + (jdbc/execute-one! (ds) ["insert into temp_table (id, deadline) values (?,?)" 1 (java.util.Date.)]) + (catch Throwable t + (println "Issue #73:" (db) "cannot convert java.util.Date to timestamp by default?") + (println (ex-message t)))))