ZF-11816: Use bindParam instead of oci_bind_by_name in Zend_Db_Statement::execute
Description
Hello,
I write an underclass of Zend_Db_Statement_Oracle to get wrong or slow queries (because the profile only report good queries). It works almost fine except for fetch() method that I can not get binded params.
The issue is on Zend_Db_Statement_Oracle::_execute() that directly calls oci_bind_by_name() (@line 243) instead of bindParam() (and not _bindParam(), because I wouldn't get Zend_Db_Statement::$_bindParam attribute populated.
Here is the proposed patch on Zend/Db/Statement/Oracle.php:
243c243
< if (!@oci_bind_by_name($this->_stmt, $name, $params[$name], -1)) {
---
> if (!$this->bindParam($name, $params[$name], null, -1)) {
Thx for your help and support, Wilfried
Comments
Posted by Wilfried Loche (w_loche) on 2011-10-18T06:44:03.000+0000
Still no activity on this issue ? While this is a very minor code improvement, it would really help me on my Oracle tracing...
Thanks a lot for your help & support, Wilfried
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-27T18:33:19.000+0000
Waiting to hear from component lead on whether or not there is a specific known reason why the oci method was used directly
Posted by Wilfried Loche (w_loche) on 2011-10-28T07:18:44.000+0000
Great news, I wondered if my issue would get any support :)
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-04T19:25:09.000+0000
Attached patch with OP's suggested fix. No unit test.
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-02T00:24:24.000+0000
Fixed in trunk (1.12.0): r24863
Posted by Wilfried Loche (w_loche) on 2012-07-03T06:47:14.000+0000
Thank you Adam for your help & support