-
Notifications
You must be signed in to change notification settings - Fork 857
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
Under preferQueryMode = simple, a PreparedStatement calls setBytes first and then call executeQuery, raise an exception. #3169
Comments
This is confirmed to be a bug. Here's a (failing) test case to add to the repo to verify it:
Running this test on master gives the following error on the server:
The bytea parameter is indeed not being serialized and the driver is just putting a At first I thought this was somehow related to the recent CVE fix for simple parameters but I'm able to reproduce this atop 42.7.1 (which precedes the CVE fix) as well as 42.6.0 (I didn't try anything else older). I don't think this has been working for a while and it just happens that nobody is using bytea params with simple query mode. I think this is the line that's returning the
@davecramer @vlsi What's surprising is that I'd expect us to use |
We have 67 skipped tests, so some of the cases are not implemented or not tested.
|
Describe the issue
Under preferQueryMode = simple, a PreparedStatement calls setBytes first and then call executeQuery, resulting in the following exception. Through debug, setBytes will eventually call the toString method of the SimpleParameterList class, but this method doesn't handle the bytea type. Is this an expected behavior?
Driver Version?
42.7.3 release
Java Version?
openjdk 21.0.2
OS Version?
macOs 13.0
PostgreSQL Version?
PostgreSQL 14.11 (Homebrew) on aarch64-apple-darwin22.6.0, compiled by Apple clang version 15.0.0 (clang-1500.1.0.2.5), 64-bit
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Under preferQueryMode = simple , PreparedStatement call setBytes, executeQuery, It returns the correct result instead of throwing an exception.
Logs
nologs
Using the following template code make sure the bug can be replicated in the driver alone.
The text was updated successfully, but these errors were encountered: