Home » Database » MDB2 » Bug #7856
Error messages are not precise
Details
| Submitted | 2006-06-10 15:17 UTC |
|---|---|
| From | reg at dav-muz dot net |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | Irrelevant |
| OS | irrelevant |
| 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!