Skip to content
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

Fix blob binding overwrite on DB2 #6093

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

melekhovets
Copy link
Contributor

Q A
Type bug
Fixed issues -

Summary

On DB2 when binding more than 1 blob in the same statement each subsequent blob overwrites previous one. So instead of [1, 2, 3] we get [2, 3, 3]
This happens because of reference between the loop variable $value and the item in $this->parameters[], which remains after iteration, see bindLobs and bind methods in \Doctrine\DBAL\Driver\IBMDB2\Statement

@melekhovets melekhovets marked this pull request as ready for review July 13, 2023 09:06
On DB2 when binding more than 1 blob in the same statement each subsequent blob overwrites previous one.
So instead of [1, 2, 3] we get [2, 3, 3]
This happens because of reference between loop variable `$value` and the item in `$this->parameters[]`,
which remains after iteration, see `bindLobs` and `bind` methods in `\Doctrine\DBAL\Driver\IBMDB2\Statement`
@melekhovets melekhovets force-pushed the fix-db2-blob-binding-overwrite branch from af8bef2 to 8eee35b Compare July 16, 2023 21:57
@derrabus derrabus added this to the 3.6.5 milestone Jul 17, 2023
@derrabus derrabus merged commit 96d5a70 into doctrine:3.6.x Jul 17, 2023
@derrabus
Copy link
Member

Thank you!

derrabus added a commit that referenced this pull request Jul 23, 2023
* 3.6.x:
  Fix blob binding overwrite on DB2 (#6093)
derrabus added a commit to derrabus/dbal that referenced this pull request Jul 24, 2023
* 3.7.x:
  Avoid self deprecation about listTableColumn (doctrine#6108)
  Fix blob binding overwrite on DB2 (doctrine#6093)
  Optimize TypeRegistry::lookupName() from O(N) to O(1) (doctrine#6082)
  Add documentation for doctrine#6044 (doctrine#6069)
  Use triggerIfCalledFromOutside in listTableDetails
  Document alternative to Type::getName (doctrine#6077)
cgknx pushed a commit to cgknx/dbal that referenced this pull request Aug 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants