cvs: pear /MDB2/MDB2/Driver/Manager sqlite.php
| From: | Lukas Smith | Date: | Fri, 14 Oct 2005 09:42:45 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Manager sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35512@lists.php.net to get a copy of this message | ||
lsmith Fri Oct 14 05:42:45 2005 EDT
Modified files:
/pear/MDB2/MDB2/Driver/Manager sqlite.php
Log:
- added error code to createIndex() errors
- added primary handling in dropIndex()
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/sqlite.php?r1=1.26&r2=1.27&ty=u
Index: pear/MDB2/MDB2/Driver/Manager/sqlite.php
diff -u pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.26 pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.27
--- pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.26 Thu Oct 13 10:46:49 2005
+++ pear/MDB2/MDB2/Driver/Manager/sqlite.php Fri Oct 14 05:42:44 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: sqlite.php,v 1.26 2005/10/13 14:46:49 lsmith Exp $
+// $Id: sqlite.php,v 1.27 2005/10/14 09:42:44 lsmith Exp $
//
require_once 'MDB2/Driver/Manager/Common.php';
@@ -263,12 +263,14 @@
}
if (strtolower($name) == 'primary') {
- return $db->raiseError('Index may not be named primary');
+ return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+ 'Index may not be named primary');
}
$query = 'CREATE';
if (array_key_exists('primary', $definition) &&
$definition['primary']) {
- return $db->raiseError('Primary Key creation must be done during table
creation');
+ return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+ 'Primary Key creation must be done during table creation');
} elseif (array_key_exists('unique', $definition) &&
$definition['unique']) {
$query.= ' UNIQUE';
}
@@ -311,6 +313,11 @@
return $db;
}
+ if (strtolower($name) == 'primary') {
+ return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
+ 'Index may not be named primary');
+ }
+
return $db->query("DROP INDEX $name");
}