test: Disable no-arg callable statement tests in simple query mode #2419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I took a look into fixing #2399 but it's more complicated than I thought. This PR doesn't actually fix anything yet. It just disables those three new tests in simple query mode so as not to break the CI. Nothing has changed recently in that part of the driver, those are just new tests that exposed existing broken behavior.
Here's the block in Parser where the extra parameter is being added:
pgjdbc/pgjdbc/src/main/java/org/postgresql/core/Parser.java
Lines 1167 to 1204 in d281a78
That "parameter" is actually an out parameter to reflect the functions return value. However removing it ends up breaking subsequent invocations to
CallableStatement.registerOutParameter(...)
as then the driver thinks there are no out parameters.The reason this all works fine in extended mode is that the server "helpfully" ignores any void parameters and pretends they're not part of the command. Honestly it's very odd and I think it's a server bug and fixing it there would likely break working (but errant) things like this driver's callable statement interface.
I think the fix for this would have to touch both the parsing and parameter parsing. Not sure when I'll be able to follow up on this so if anyone else wants to take a look please go ahead. That code is pretty old and we haven't heard any complaints about it so I doubt there's anyone actually running into this issue as you'd have to be both using simple mode and JDBC call syntax.
I ran the omni suite on my fork and it completed successfully (https://github.com/sehrope/pgjdbc/runs/4939369066?check_suite_focus=true) so once this cycles through CI here I'll merge it in to make CI green again.