From 5c87daf08304fb7fb9e4500d7996990206641260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 18 Oct 2010 00:08:34 -0430 Subject: [PATCH] Implementing listSources for postgres --- cake/libs/model/datasources/dbo/dbo_postgres.php | 6 +++--- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 038bd1adbbb..b6885569a6b 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -161,8 +161,8 @@ function listSources() { } $schema = $this->config['schema']; - $sql = "SELECT table_name as name FROM INFORMATION_SCHEMA.tables WHERE table_schema = '{$schema}';"; - $result = $this->fetchAll($sql, false); + $sql = "SELECT table_name as name FROM INFORMATION_SCHEMA.tables WHERE table_schema = ?"; + $result = $this->_execute($sql, array($schema)); if (!$result) { return array(); @@ -170,7 +170,7 @@ function listSources() { $tables = array(); foreach ($result as $item) { - $tables[] = $item[0]['name']; + $tables[] = $item->Name; } parent::listSources($tables); diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 32036841cb4..ca73d487687 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -427,7 +427,7 @@ function testLastInsertIdMultipleInsert() { $db2 = clone $db1; $db2->connect(); - $this->assertNotEqual($db1->connection, $db2->connection); + $this->assertNotSame($db1->getConnection(), $db2->getConnection()); $table = $db1->fullTableName('users', false); $password = '5f4dcc3b5aa765d61d8327deb882cf99';