PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #162

DB::executeEmulateQuery() error

Details

Submitted2003-10-29 02:20 UTC
Frompear at gw00 dot com
Assigneddanielc
StatusClosed
PackageDB
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2003-10-29 02:20 UTC] pear at gw00 dot com

Description:
------------
DB::executeEmulateQuery() returns a DB_ERROR_NEED_MORE_DATA error incorrectly in certain cases. The "shortcut" of using simply $data instead of sizeof($data) fails whenever the data value looks like zero. Here is the fix:

--- common-orig.php Fri Oct 10 19:50:17 2003
+++ common.php Fri Oct 10 19:51:10 2003
@@ -600,7 +600,7 @@
$qq = &$this->prepare_tokens[$stmt];
$qp = sizeof($qq) - 1;

- if ((!$data && $qp > 0) ||
+ if ((!sizeof($data) && $qp > 0) ||
(!is_array($data) && $qp > 1) ||
(is_array($data) && $qp > sizeof($data)))
{

Sorry for not a better explanation; I fixed this several weeks ago and can't quite remember the exact problem. Please let me know if I should explain better.