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

Bug #9599 Error mapping broken since 5.2.0
Submitted: 2006-12-12 08:57 UTC
From: tuupola Assigned: aharvey
Status: Closed Package: DB (version 1.7.6)
PHP Version: 5.2.0 RC4 OS: Solaris 10
Roadmaps: (Not assigned)    

 [2006-12-12 08:57 UTC] tuupola (Mika Tuupola)
Description: ------------ I recently noticed sequence table auto creation with sqlite driver broke when upgrading to PHP 5.2.0. Reason is $php_errormsg variable now behaves differently. With older versions oh PHP error message is for example: no such table: test_seq with 5.2.0 it is now: sqlite_query(): no such table: test_seq This change broke error string to error code mapping in sqlite driver (and most likely others) which rely on regexps such as: '/^no such table:/' => DB_ERROR_NOSUCHTABLE '/^no such index:/' => DB_ERROR_NOT_FOUND


 [2006-12-20 08:24 UTC] tuupola at php dot net (Mika Tuupola)
Below is a quick patch against current CVS (I have it waiting for commit if it is ok with you): -cut- --- sqlite.php 17 Mar 2006 08:37:33 -0000 1.110 +++ sqlite.php 20 Dec 2006 08:21:57 -0000 @@ -728,6 +728,7 @@ */ function errorCode($errormsg) { + $errormsg = str_replace('sqlite_query(): ', '', $errormsg); static $error_regexps; if (!isset($error_regexps)) { $error_regexps = array( -cut-
 [2006-12-21 04:00 UTC] aharvey (Adam Harvey)
Go ahead and commit, Mika. You're right about the other drivers having similar issues as well; I'll fix them as soon as I have suitable CVS karma.
 [2006-12-29 08:57 UTC] aharvey (Adam Harvey)
The affected drivers ended up being mSQL, SQLite and Sybase. I've committed a fix for each driver into CVS. I'll leave the bug open until I've tested it a bit more thoroughly; for one thing, I don't even have Sybase installed here at home yet.
 [2007-01-05 07:27 UTC] aharvey (Adam Harvey)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.