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

Unset statement resource in bindValue #6089

Closed
wants to merge 3 commits into from

Conversation

epistemery
Copy link

Fix odbc issue #6088

Q A
Type bug/feature/improvement
Fixed issues #6088

Summary

Reset statement resource after call to bindValue

@derrabus
Copy link
Member

derrabus commented Jul 8, 2023

Thank you. Please add a functional test that reproduces your issue and thus covers your change.

@epistemery
Copy link
Author

I've added a test case based on my description of #6088 , but could not find documentation on how to run the sqlsrv test cases, so I could not verify that the test is working as expected. Do you have documentation on how to run the tests for specific platforms?

@derrabus
Copy link
Member

Do you have documentation on how to run the tests for specific platforms?

You need a local database server obviously. All you need to do then is create a custom PHPUnit configuration with the credentials to your database. You'll find some examples in the ci/github/phpunit directory. Those are the configuration files that we use for our CI.

@derrabus
Copy link
Member

Tests are failing btw.

@epistemery
Copy link
Author

Tests should pass now. But another thing I've noticed is that I can reproduce the error in the context of a Symfony app, but not within a test case of doctrine/dbal. Meaning, the test passes with and without the fix in Statement.php.

A similar test fails (with same connection params and with config = eventManager = null) when having doctrine/dbal installed in the context of a Symfony application.

One other thing I've realized is, that is has something to do with encoding. I have to do some further debugging to find out what's causing this issue.

INSERT INTO bug (content) VALUES (?)
SQL);

$stmt->bindValue(1, implode(array_fill(0, 4000, 'x')));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know str_repeat()?

@derrabus
Copy link
Member

Meaning, the test passes with and without the fix in Statement.php.

Then it's not a valid test for your change, sorry.

@epistemery
Copy link
Author

Correct, this is not a valid test case. I was finally able to do some testing and it seems the culprit is sqlsrv extension < 5.11. I thought I was testing it with 5.11, but due to some docker caching magic I had 5.10 in the original setup, and 5.11 in my dbal testing setup.

Although this pull fixes it for sqlsrv version 5.10, my guess is that you do not want to merge, so I'm closing this PR. I'll add a note in #6088 for anyone who needs 5.10 and needs a workaround.

@epistemery epistemery closed this Aug 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 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.

2 participants