-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Wrong cast generated in PostgreSQL when using plain SQL with UPDATE statements and null literals #5345
Comments
So is it impossible to set fields to NULL currently? |
@wouterhund You can certainly set fields to null. Are you using Suricatta? This issue is really mostly related to Suricatta... |
@lukaseder I am not, I am using a custom The output I got was
(Removed a few sensitive fields from the queries manually) It's odd that there's a cast to varchar for the null fields, but now everything is correctly cast to timestamp. Perhaps in my case it was related to a code generation fluke of sorts. I'll report back if I can pin it down. I'm using the generated |
@wouterhund Thanks for the feedback. Would you mind creating a new issue, then? Can you please include the exact code that you're using that produces the problems you're having? |
As reported on the user group by @niwinz:
I found a very strange cast to character varying in UPDATE statement when setting a field to NULL with postgresql dialect. When a default or mysql dialect is used everything works as expected.
The reproducing code is (clojure + suricatta):
That will translate to something like this in groovy/java:
This behavior makes me imposible to set a field to NULL. I don't know if is something related to Clojure<->java interop or is just a bug in jOOQ. But my first impression is that something wrong is in postgresql dialect.
See also:
The text was updated successfully, but these errors were encountered: