PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #780

DB/common.php -> DB mismatch (DB 1.6.0RC6)

Details

Submitted2004-02-17 19:23 UTC
Fromjkaufman at wamnetgov dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version4.3.4
OSLinux - Mandrake 9.1
Roadmaps(Not assigned)

Comments

[2004-02-17 19:23 UTC] jkaufman at wamnetgov dot com

Description:
------------
v1.24 of common.php, no problem.
v1.87 of common.php gives a db mismatch error.

My query is a simple one:

select task_id, task_code, task_descr from task_master, task_wbs_element where task_id in (31)

(works fine in dbaccess)

I am using this command to execute the query:
$res = $dbh->query($sql, DB_FETCHMODE_ASSOC);

The new code contains this in executeEmulateQuery:

if (count($this->prepare_types[$stmt]) != count($data)) {
$this->last_query = $this->prepared_queries[$stmt];
return $this->raiseError(DB_ERROR_MISMATCH);
}

And that is where it fails. I don't understand why a simple query needs to go through prepare/execute, nor what I need to do to fix this.

Reproduce code:
---------------
All is shown above.

Expected result:
----------------
Values from db, not 'db mismatch error'.

Actual result:
--------------
db_error Object
(
[error_message_prefix] =>
[mode] => 16
[level] => 1024
[code] => -7
[message] => DB Error: mismatch
[userinfo] => select task_id, task_code, task_descr, task_wbs_element from task_master where task_id in (31)
[backtrace] => Array
(
[0] => Array
(
[file] => /usr/share/pear/DB.php
[line] => 739
[function] => pear_error
[class] => db_error
[type] => ->
[args] => Array
(
[0] => DB Error: mismatch
[1] => -7
[2] => 16
[3] => handle_Error
[4] => select task_id, task_code, task_descr, task_wbs_element from task_master where task_id in (31)
)

)

[1] => Array
(
[file] => /usr/share/pear/PEAR.php
[line] => 525
[function] => db_error
[class] => db_error
[type] => ->
[args] => Array
(
[0] => -7
[1] => 16
[2] => handle_Error
[3] => select task_id, task_code, task_descr, task_wbs_element from task_master where task_id in (31)
)

)

[2] => Array
(
[file] => /usr/share/pear/DB/common.php
[line] => 495
[function] => raiseerror
[class] => pear
[type] => ::
[args] => Array
(
[0] =>
[1] => -7
[2] =>
[3] =>
[4] => select task_id, task_code, task_descr, task_wbs_element from task_master where task_id in (31)
[5] => DB_Error
[6] => 1
)

)

[3] => Array
(
[file] => /usr/share/pear/DB/common.php
[line] => 980
[function] => raiseerror
[class] => db_ifx
[type] => ->
[args] => Array
(
[0] => -7
)

)

[4] => Array
(
[file] => /usr/share/pear/DB/common.php
[line] => 940
[function] => executeemulatequery
[class] => db_ifx
[type] => ->
[args] => Array
(
[0] => 0
[1] => 2
)

)

[5] => Array
(
[file] => /usr/share/pear/DB/common.php
[line] => 1130
[function] => execute
[class] => db_ifx
[type] => ->
[args] => Array
(
[0] => 0
[1] => 2
)

)

[6] => Array
(
[file] => /var/www/html/tsg_2.20/enter_service_request3.php
[line] => 74
[function] => query
[class] => db_ifx
[type] => ->
[args] => Array
(
[0] => select task_id, task_code, task_descr, task_wbs_element from task_master where task_id in (31)
[1] => 2
)

)

)

[callback] => handle_Error
)