-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
PDO_MySQL not properly quoting PDO_PARAM_LOB binary data #15949
Conversation
@mbeccati as promised 👍 |
8d3e20d
to
dd983d9
Compare
The prepared statement emulation layer is handling binary content in a way that creates warnings in MySQL. When analysing the query logs, we saw that the content sent to the server is missing `0x5C` characters when the using emulated prepares. This introduces a minimal test case that reproduces the issue to aid the solution. More info: doctrine/dbal#6522 (comment) Signed-off-by: Luís Cobucci <[email protected]>
cb36fc5
to
c6710b7
Compare
@cmb69 @SakiTakamachi Even though it's a bug fix, I've changed the target to 8.4 as I'm not fully comfortable in making this change across all versions. What do you think? |
In my opinion, this is valid reason to target |
I agree with the concern and the approach. The main worry here is having unexpected side-effects with the introduction of the There were some PRs that suggested the introduction of a |
This is a bug fix of sorts, so I'd vote for it to be merged into 8.4. |
c6710b7
to
9b7e2ac
Compare
Since the bug fix mainly affects PDO::quote() I thought it was a good idea to cover that too. The test il passing locally and on most CIs, aside from circleci on arm, with a failure that's baffling me.
I've checked and both use the same docker image sha256, so I'd expect the configuration and the quoted string to be the same, but on arm we have one extra byte (a backslash?). I'll try to add a test on the query result and perhaps use %d for the failing var_dump. |
9b7e2ac
to
9fa7ad7
Compare
@NattyNarwhal Well spotted: #10343 is pretty much the same fix as this, for DBLIB. Perhaps it would be worth combining the tests and making them part of the PDO common suite, so that we can verify that #11462 would be the PR for |
I wasn't sure if overriding the semantics of It's been a while since I've thought of this topic, but I think it's worth discussing in an RFC on the internals mailing list. There's the issues I brought up on those previous threads, but there's likely other ones worth discussing. |
If we agree that |
Yeah, though my problem with overriding the semantics of |
Absolutely! That's what I meant in #15949 (comment) 😄 |
The prepared statement emulation layer is handling binary content in a way that creates warnings in MySQL.
When analysing the query logs, we saw that the content sent to the server is missing
0x5C
characters when the using emulated prepares.This introduces a minimal test case that reproduces the issue to aid the solution.
More info: doctrine/dbal#6522 (comment)