Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #7856 Error messages are not precise
Submitted: 2006-06-10 15:17 UTC
From: reg at dav-muz dot net Assigned: lsmith
Status: Closed Package: MDB2 (version 2.0.3)
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2006-06-10 15:17 UTC] reg at dav-muz dot net (Davide Muzzarelli)
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!

Comments

 [2006-06-11 14:16 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [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!