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

DB2 does not support streams for the LARGE_OBJECT parameter type #3288

Closed
mpdude opened this issue Sep 13, 2018 · 3 comments
Closed

DB2 does not support streams for the LARGE_OBJECT parameter type #3288

mpdude opened this issue Sep 13, 2018 · 3 comments

Comments

@mpdude
Copy link
Contributor

mpdude commented Sep 13, 2018

While fixing #3217, added tests showed that DB2Statement is unable to correctly process streams passed in with the ParameterType::LARGE_OBJECT.

Such streams will be cast to strings by the DB2 driver in PHP and finally end up in the database as strings like Resource id #126.

#3217 fixes this for MySQLi.

A quick scan through https://github.com/php/pecl-database-ibm_db2/blob/master/ibm_db2.c does not show any attempt to support stream handling in DB2.

One solution might be to detect streams in userland (i. e. DBAL), use stream_get_contents or similar and pass the whole data on to DB2. The other approach is to write stream data out to a file and make use of the DB2_PARAM_FILE parameter type (docs) to avoid the memory overhead.

When this issue is fixed, the testInsertProcessesStream and testUpdateProcessesStream tests in \Doctrine\Tests\DBAL\Functional\BlobTest need no longer be skipped.

mpdude added a commit to mpdude/dbal that referenced this issue Sep 13, 2018
Should fix the builds for doctrine#3217, real issue could be addressed via doctrine#3288.
mpdude added a commit to mpdude/dbal that referenced this issue Sep 13, 2018
Should fix the builds for doctrine#3217, real issue could be addressed via doctrine#3288.
@morozov
Copy link
Member

morozov commented Sep 13, 2018

According to this article, DB2_PARAM_FILE can work with streams as well. If not, we can store the stream in a temporary file and bind the path to the statement.

@morozov
Copy link
Member

morozov commented Oct 13, 2018

Fixed via #3309.

@github-actions
Copy link

github-actions bot commented Aug 1, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants