ZF-11816: Use bindParam instead of oci_bind_by_name in Zend_Db_Statement::execute

Issue Type: Improvement Created: 2011-10-12T09:10:15.000+0000 Last Updated: 2012-07-03T06:47:14.000+0000 Status: Resolved Fix version(s): - 1.12.0 (27/Aug/12)

Reporter: Wilfried Loche (w_loche) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Db_Adapter_Oracle

  • FixForZF1.12
  • Oracle
  • Zend_Db
  • state:need-feedback
  • zf-caretaker-adamlundrigan
  • zf-crteam-review

Related issues: Attachments: - ZF-11816.patch



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:

<pre class="highlight">
<                 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


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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.