cvs: pear /DB/DB sqlite.php
| From: | Mika Tuupola | Date: | Sun, 07 Sep 2003 20:01:44 +0000 |
| Subject: | cvs: pear /DB/DB sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-12530@lists.php.net to get a copy of this message | ||
tuupola Sun Sep 7 16:01:44 2003 EDT
Modified files:
/pear/DB/DB sqlite.php
Log:
* add more error messages
Index: pear/DB/DB/sqlite.php
diff -u pear/DB/DB/sqlite.php:1.10 pear/DB/DB/sqlite.php:1.11
--- pear/DB/DB/sqlite.php:1.10 Sun Sep 7 15:22:11 2003
+++ pear/DB/DB/sqlite.php Sun Sep 7 16:01:44 2003
@@ -17,7 +17,7 @@
// | Mika Tuupola <tuupola@appelsiini.net> |
// +----------------------------------------------------------------------+
//
-// $Id: sqlite.php,v 1.10 2003/09/07 19:22:11 tuupola Exp $
+// $Id: sqlite.php,v 1.11 2003/09/07 20:01:44 tuupola Exp $
//
// Database independent query interface definition for the PECL's SQLite
// extension.
@@ -434,7 +434,10 @@
static $error_regexps;
if (empty($error_regexps)) {
$error_regexps = array(
- '/^no such table:/' => DB_ERROR_NOSUCHTABLE
+ '/^no such table:/' => DB_ERROR_NOSUCHTABLE,
+ '/^table .* already exists$/' => DB_ERROR_ALREADY_EXISTS,
+ '/^no such column:/' => DB_ERROR_NOSUCHFIELD,
+ '/^near ".*": syntax error$/' => DB_ERROR_SYNTAX
);
}
foreach ($error_regexps as $regexp => $code) {
@@ -661,9 +664,9 @@
* @return object a PEAR error object
*/
function sqliteRaiseError($errno = null) {
-
- $native = $this->errorNative();
+
if ($errno === null) {
+ $native = $this->errorNative();
$errno = $this->errorCode($native);
}
return $this->raiseError($errno, null, null, null,