fix: EXPOSED-493 Update with join query throws if WHERE clause present #2207
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.
Description
Summary of the change:
Fixes bug when generating UPDATE-FROM-JOIN statement that uses a subquery (with its own WHERE clause) in the JOIN part.
Detailed description:
Why:
Previous refactor of
UpdateStatement.arguments()
, to properly order registered arguments in an update-from-join statement, took place in PR fix: EXPOSED-301 Update with join throws if additionalConstraint provided #2007 . The fix did not factor in the possibility that the join target could be a subquery. If this query itself holds any clause with arguments, the latter will not be registered when preparing the statement, leading to the sameNo value specified for parameter x
errors as previously.How:
Type of Change
Please mark the relevant options with an "X":
Affected databases:
Checklist
Related Issues
EXPOSED-493