PEAR is archived and read-only

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

Home » Database » MDB2 » Bug #7856

Error messages are not precise

Details

Submitted2006-06-10 15:17 UTC
Fromreg at dav-muz dot net
Assignedlsmith
StatusClosed
PackageMDB2
PHP VersionIrrelevant
OSirrelevant
Roadmaps(Not assigned)

Comments

[2006-06-10 15:17 UTC] reg at dav-muz dot net

Description:
------------
Error messages are not precise.

If I commit an error that is not in the query but in the PHP function, the error message refer to the previous query and not in the actual.

Error messages should be precise and could refer to the correct error.

Test script:
---------------
Example (debug mode active):

1: [...] // do a correct query without errors (aka Query1).
2:
3: // do a second correct query (aka Query2).
4: $prep = array($query2, array('inteeeegggeeerrrr')); // <- there is an error: integer!
5: $result = $prep->execute(array(10));
6: if (MDB2::isError($result)) {
7: print_r($result->getMessage() . ' ' . $result->getUserInfo());
9: }

Expected result:
----------------
Output: the Query2 has an error at line 7!

Actual result:
--------------
Output: the Query1 has an error at line 7!

[2006-06-12 10:49 UTC] reg at dav-muz dot net

> I presume you were using one of the backends where
> prepared statements were emulated?

Yes, I use MySQL 4.x and it is partially emulated.

I think that the query have not to be the message (the query is correct), but the real problem: a function parameter is invalid.

However, your fix can solve hours of debugging, THX!