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.
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
params
are not correctly ordered and this is breaking the SQL query.IMHO, I think this issue should be fixed in
doctrine/dbal
with a simpleksort
onparams
, 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 the doctrine/dbal doc, I see:
Maybe this is something to fix somewhere else?