cvs: pear /MDB2/MDB2/Driver/Manager sqlite.php
| From: | Lukas Smith | Date: | Fri, 14 Oct 2005 22:37:10 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Manager sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35553@lists.php.net to get a copy of this message | ||
lsmith Fri Oct 14 18:37:10 2005 EDT
Modified files:
/pear/MDB2/MDB2/Driver/Manager sqlite.php
Log:
- index quoting not supported
http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/sqlite.php?r1=1.29&r2=1.30&ty=u
Index: pear/MDB2/MDB2/Driver/Manager/sqlite.php
diff -u pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.29 pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.30
--- pear/MDB2/MDB2/Driver/Manager/sqlite.php:1.29 Fri Oct 14 18:12:10 2005
+++ pear/MDB2/MDB2/Driver/Manager/sqlite.php Fri Oct 14 18:37:08 2005
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: sqlite.php,v 1.29 2005/10/14 22:12:10 lsmith Exp $
+// $Id: sqlite.php,v 1.30 2005/10/14 22:37:08 lsmith Exp $
//
require_once 'MDB2/Driver/Manager/Common.php';
@@ -264,7 +264,6 @@
}
$table = $db->quoteIdentifier($table);
- $name = $db->quoteIdentifier($name);
$query = 'CREATE';
if (array_key_exists('unique', $definition) &&
$definition['unique']) {
$query.= ' UNIQUE';
@@ -287,7 +286,27 @@
}
$query .= implode(', ', $fields) . ')';
return $db->query($query);
+ }
+
+ // }}}
+ // {{{ dropIndex()
+ /**
+ * drop existing index
+ *
+ * @param string $table name of table that should be used in method
+ * @param string $name name of the index to be dropped
+ * @return mixed MDB2_OK on success, a MDB2 error on failure
+ * @access public
+ */
+ function dropIndex($table, $name)
+ {
+ $db =& $this->getDBInstance();
+ if (PEAR::isError($db)) {
+ return $db;
+ }
+
+ return $db->query("DROP INDEX $name");
}
// }}}
@@ -307,7 +326,6 @@
return $db;
}
- $table = $db->quoteIdentifier($table);
$query = "SELECT name FROM sqlite_master WHERE type='index' AND
tbl_name='$table' AND sql NOT NULL ORDER BY name";
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
@@ -319,7 +337,6 @@
return $result;
}
-
// }}}
// {{{ createConstraint()