Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newer Graal and partial interval type #67

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

coracuity
Copy link

I need to punt on this for now but just in case anyone else can pick it up. Apologies in advance for the big hammer I used fixing things in the reflections JSON, PGConnection was hiding what the real error is and this made it work. I'm confident someone more knowledgable about how to trace these things could figure out what it's trying to call.

This builds using GraalVM CE 23.0.2+7.1 on macos. The tests fail with these errors:

ERROR in (postgresql-test) (impl.clj:210)
interval
expected: (= [#:interval_table{:interval_col "0 years 0 mons 0 days 3 hours 3 mins 3.0 secs"}] (db/execute! db ["insert into interval_table(interval_col) values (?)" "03:03:03"]))
  actual: clojure.lang.ExceptionInfo: ERROR: column "interval_col" is of type interval but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 50
{:type "class org.postgresql.util.PSQLException"}
 at babashka.pods.impl$processor.invokeStatic (impl.clj:210)
    babashka.pods.impl$processor.invoke (impl.clj:139)
    babashka.pods.jvm$load_pod$fn__3123.invoke (jvm.clj:62)
    clojure.core$binding_conveyor_fn$fn__5842.invoke (core.clj:2047)
    clojure.lang.AFn.call (AFn.java:18)
    java.util.concurrent.FutureTask.run (FutureTask.java:317)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1144)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:642)
    java.lang.Thread.run (Thread.java:1575)

ERROR in (postgresql-test) (impl.clj:210)
interval
expected: (= [#:interval_table{:interval_col "0 years 0 mons 0 days 0 hours 0 mins 0.0 secs"} #:interval_table{:interval_col "0 years 0 mons 0 days 1 hours 1 mins 1.0 secs"}] (sql/insert-multi! db :interval_table [:interval_col] [["00:00:00"] ["01:01:01"]]))
  actual: clojure.lang.ExceptionInfo: ERROR: column "interval_col" is of type interval but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 51
{:type "class org.postgresql.util.PSQLException"}
 at babashka.pods.impl$processor.invokeStatic (impl.clj:210)
    babashka.pods.impl$processor.invoke (impl.clj:139)
    babashka.pods.jvm$load_pod$fn__3123.invoke (jvm.clj:62)
    clojure.core$binding_conveyor_fn$fn__5842.invoke (core.clj:2047)
    clojure.lang.AFn.call (AFn.java:18)
    java.util.concurrent.FutureTask.run (FutureTask.java:317)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1144)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:642)
    java.lang.Thread.run (Thread.java:1575)

Ran 1 tests containing 49 assertions.
0 failures, 2 errors.

The code can read the interval type, it just can't cast a string value to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant