Home » Database » MDB2 » Bug #1574
Apparent bug in autoExecute() method
Details
| Submitted | 2004-06-08 03:26 UTC |
|---|---|
| From | ate2 at cornell dot edu |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | 4.3.3 |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2004-06-08 03:26 UTC] ate2 at cornell dot edu
Description:
------------
Very useful MDB2_Extended::autoExecute() method has a significant bug that causes it to build and execute faulty queries:
In distributed package, line 130 (Extended.php) reads:
<code>
$result =& $this->executeParams($prepared_query, array_values($fields_values), $param_types, $result_class);
</code>
There are 2 problems with this line. First, it causes a fatal error because there is no executeParams() method in MDB2. Second, when corrected to db, field types are substituted as values and field values are completely ignored. Was there originally supposed to be another executeParams() in MDB2_Extended ?
The fix seems simple. Method produces expected results when line 130 is changed to:
<code>
$result =& $db->executeParams($prepared_query, $param_types, array_values($fields_values), $result_class);
</code>
[2004-06-08 14:52 UTC] smith at backendmedia dot com
This bug has been fixed in CVS.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.
In case this was a pear.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.