From b829b92beaa237aaa008abe61258a13883ca977d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 17 Feb 2016 13:24:45 +0100 Subject: [PATCH 1/2] fix list table columns when using external or os authentication --- lib/Doctrine/DBAL/Platforms/OraclePlatform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index b0d4cda98fd..b7c4596c1b7 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -655,7 +655,7 @@ public function getListTableColumnsSQL($table, $database = null) $colCommentsTableName = "user_col_comments"; $ownerCondition = ''; - if (null !== $database) { + if (null !== $database && '/' !== $database) { $database = $this->normalizeIdentifier($database); $tabColumnsTableName = "all_tab_columns"; $colCommentsTableName = "all_col_comments"; From 04e6fa15d1c0acc0ff808a9b6ec1a8c2ef60319c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 19 Feb 2016 11:10:07 +0100 Subject: [PATCH 2/2] add testReturnsGetListTableColumnsSQL test --- .../DBAL/Platforms/OraclePlatformTest.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php index d99d12331fb..166a3a3139b 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php @@ -696,6 +696,60 @@ public function testQuotedTableNames() $this->assertEquals($createTriggerStatement, $sql[3]); } + /** + * @dataProvider getReturnsGetListTableColumnsSQL + * @group DBAL-831 + */ + public function testReturnsGetListTableColumnsSQL($database, $expectedSql) + { + $this->assertEquals($expectedSql, $this->_platform->getListTableColumnsSQL('"test"', $database)); + } + + public function getReturnsGetListTableColumnsSQL() + { + return array( + array( + null, + "SELECT c.*, + ( + SELECT d.comments + FROM user_col_comments d + WHERE d.TABLE_NAME = c.TABLE_NAME + AND d.COLUMN_NAME = c.COLUMN_NAME + ) AS comments + FROM user_tab_columns c + WHERE c.table_name = 'test' + ORDER BY c.column_name" + ), + array( + '/', + "SELECT c.*, + ( + SELECT d.comments + FROM user_col_comments d + WHERE d.TABLE_NAME = c.TABLE_NAME + AND d.COLUMN_NAME = c.COLUMN_NAME + ) AS comments + FROM user_tab_columns c + WHERE c.table_name = 'test' + ORDER BY c.column_name" + ), + array( + 'scott', + "SELECT c.*, + ( + SELECT d.comments + FROM all_col_comments d + WHERE d.TABLE_NAME = c.TABLE_NAME + AND d.COLUMN_NAME = c.COLUMN_NAME + ) AS comments + FROM all_tab_columns c + WHERE c.table_name = 'test' AND c.owner = 'SCOTT' + ORDER BY c.column_name" + ), + ); + } + /** * {@inheritdoc} */