cvs: pear /MDB2_Schema/MDB2 Schema.php
| From: | Igor Feghali | Date: | Mon, 02 Oct 2006 02:44:37 +0000 |
| Subject: | cvs: pear /MDB2_Schema/MDB2 Schema.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42340@lists.php.net to get a copy of this message | ||
ifeghali Mon Oct 2 02:44:37 2006 UTC
Modified files:
/pear/MDB2_Schema/MDB2 Schema.php
Log:
- createDatabase() was trying to use the database before creating it
- dumpDatabase() was passing a non-empty types array to queryAll(), which caused unexpected
results
http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/MDB2/Schema.php?r1=1.97&r2=1.98&diff_format=u
Index: pear/MDB2_Schema/MDB2/Schema.php
diff -u pear/MDB2_Schema/MDB2/Schema.php:1.97 pear/MDB2_Schema/MDB2/Schema.php:1.98
--- pear/MDB2_Schema/MDB2/Schema.php:1.97 Sat Sep 30 03:21:33 2006
+++ pear/MDB2_Schema/MDB2/Schema.php Mon Oct 2 02:44:37 2006
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: Schema.php,v 1.97 2006/09/30 03:21:33 ifeghali Exp $
+// $Id: Schema.php,v 1.98 2006/10/02 02:44:37 ifeghali Exp $
//
require_once 'MDB2.php';
@@ -1031,6 +1031,14 @@
if ($create) {
$errorcodes = array(MDB2_ERROR_UNSUPPORTED, MDB2_ERROR_NOT_CAPABLE);
$this->db->expectError($errorcodes);
+
+ /**
+ *
+ * We need to clean up database name before any query to prevent
+ * database driver from using a inexistent database
+ *
+ */
+ $this->db->setDatabase("");
$databases = $this->db->manager->listDatabases();
// Lower / Upper case the db name if the portability deems so.
@@ -2057,7 +2065,7 @@
}
$query = 'SELECT '.implode(', ', array_keys($fields)).'
FROM ';
$query.= $this->db->quoteIdentifier($table_name, true);
- $data = $this->db->queryAll($query, $fields, MDB2_FETCHMODE_ASSOC);
+ $data = $this->db->queryAll($query, array(), MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($data)) {
return $data;
}