Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
fix: use named parameters#54172
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
fix: use named parameters#54172
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedMar 6, 2024
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
derrabus left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm fine with the change, but can you please also submit a bug report for DBAL?
drupol commentedMar 6, 2024
Sure! Will submit a PR there too. |
nicolas-grekas commentedMar 7, 2024
Closing per#50507 (comment) since it ain't broken. Thanks for the heads up. |
Uh oh!
There was an error while loading.Please reload this page.
Hello!
Today, my colleague@samsonradu and I noticed an issue while using Oracle database and regarding the
DoctrineDbalAdapter, potentially introduced by PR#50507.Basically, by making positional parameters lazily injected, the order of those parameters are no more preserved, and we end up with totally broken SQL queries. Here are more details:
The introduction of a lazy loading mechanism in this PR has led to issues with the ordering of bound values in SQL statements. New keys added by the lazy loading process are appended at the end of the parameters array, disrupting the intended logical order. See it here:
In here, you can see that the
paramsare not correctly ordered and this is breaking the SQL query.IMHO, I think this issue should be fixed in
doctrine/dbalwith a simpleksortonparams, but I'm not sure, that's the reason why I comment in here.Alternatively, we could implement explicit parameter mapping instead of positional indexes to ensure each bound value maintains its correct order, regardless of when it's added.
From thedoctrine/dbal doc, I see:
Maybe this is something to fix somewhere else?