-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue #2261 - OCI8 Driver PHP 7 - Fix bindValue overwriting other params. #2262
Conversation
Requires a test case scenario that validates the fix. |
@@ -72,6 +72,11 @@ class OCI8Statement implements \IteratorAggregate, Statement | |||
protected $_paramMap = array(); | |||
|
|||
/** | |||
* @var array | |||
*/ | |||
protected $_bindings = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do not introduce a protected member here, unless completely necessary. Otherwise we will have to keep BC for that afterwards. Also please do not use the old underscore prefix naming here. private $bindings
is fine.
Delayed for now as I'd like to wait for the PHP guys to come up with a fix before we start working around here. |
Considered not a bug by PHP:
|
Or to translate it, and give more insight why this PR works: By using the array, you always pass a different reference and therefor the values are not overwritten. |
So basically what is happening is that the values are GC'd before we can ever use them. |
Ok, it's a bug! how can we try to solve in the doctrine? Actually, we solved the problem after applied the patch that use solution in the issue #2261 |
So, I've tried this pull-request and I ran the test suite on an oracle-12 instance (https://hub.docker.com/r/sath89/oracle-12c/):
My test configuration is available in this gist. Btw, without this patch none of the OCI8 tests will pass because |
We expect look !!! |
If someone got a solution for this problem without manipulating the doctrine sources locally i would be interesseted in this solution. |
No solution on my end, this also adds issues regarding CLOB/BLOB to me. We just need to determine whether it's a php bug or a feature, in which case we have to fix the OCI8Statement library. |
As written before, its NOT a bug by PHP, its a "new behavior in PHP 7" |
@Lynx91 I agree, just saying this because it's still labeled as "Delayed".
He has a point, so I'm not sure everyone agrees to this behavior... |
Hm..it seems to be a difficult decision...hope, that there will be any solution in the near future...thx for your response |
@soyuka Have you done another PR with your CLOB/BLOB fix? If your PR works, maybe the solution is just to clone off your fork for awhile until the Doctrine team stops playing ostrich on this issue -- since apparently the PHP team is not considering it a bug but a feature (as has been repeatedly pointed out)... |
@mmucklo I need time to check this further, I have no clean fix yet. However, you can check this commit on my fork. It's almost there, I remember there was a small issue on top of it (maybe unrelated). |
It's possible to merge this commit, because Statement on Oracle doesn't work on PHP7 :( |
Nope this one should be closed in favor of #2434 |
Closing in favour of #2434. |
Handled in #2434 |
#2261