Commit a3577e49 authored by Marco Pivetta's avatar Marco Pivetta

Merge branch...

Merge branch 'fix/#2318-fix-listing-table-columns-when-using-external-or-os-authentication-on-oracledb'

Close #2318
Close DBAL-831
parents 122e4581 48c8a661
...@@ -660,7 +660,7 @@ END;'; ...@@ -660,7 +660,7 @@ END;';
$colCommentsTableName = "user_col_comments"; $colCommentsTableName = "user_col_comments";
$ownerCondition = ''; $ownerCondition = '';
if (null !== $database) { if (null !== $database && '/' !== $database) {
$database = $this->normalizeIdentifier($database); $database = $this->normalizeIdentifier($database);
$database = $this->quoteStringLiteral($database->getName()); $database = $this->quoteStringLiteral($database->getName());
$tabColumnsTableName = "all_tab_columns"; $tabColumnsTableName = "all_tab_columns";
......
...@@ -704,6 +704,63 @@ EOD; ...@@ -704,6 +704,63 @@ EOD;
$this->assertEquals($createTriggerStatement, $sql[3]); $this->assertEquals($createTriggerStatement, $sql[3]);
} }
/**
* @dataProvider getReturnsGetListTableColumnsSQL
* @group DBAL-831
*/
public function testReturnsGetListTableColumnsSQL($database, $expectedSql)
{
// note: this assertion is a bit strict, as it compares a full SQL string.
// Should this break in future, then please try to reduce the matching to substring matching while reworking
// the tests
$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} * {@inheritdoc}
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment