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

fix: send type void parameters as null value #1922

Merged
merged 1 commit into from
Oct 13, 2020

Conversation

petere
Copy link
Contributor

@petere petere commented Oct 13, 2020

I'm working on adding support for procedure OUT parameters to the JDBC driver. More on that later. In the meantime, while I was playing around with various ideas, I noticed that the parameters of type void are sent to the server with a payload value of "null" as a string. This seems a bit strange and wasteful. I suggest to change this to a real null value.

I looked up the original commit where this came in (ccc8f4c), but didn't see any explanation there either. Perhaps it wasn't ever questioned.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Existing Features:

  • Have you successfully run tests with your changes locally?

The previous code sent parameters of type void (used for OUT
parameters of functions) with a text value of "null".  While this
doesn't affect anything, since the value is ignored anyway, it's
somewhat confusing, especially if it shows up in debug traces and
error messages, and it's also a bit wasteful to send 4 bytes for
nothing.  So instead, send those parameters as a null value, which
seems semantically saner.
petere added a commit to petere/postgresql that referenced this pull request Oct 13, 2020
@davecramer davecramer merged commit 770b6d3 into pgjdbc:master Oct 13, 2020
@petere petere deleted the fix-void-null branch October 15, 2020 07:25
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.

None yet

2 participants