Commit 9f8c05cd 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-2.5' into 2.5

Close #2318
Close DBAL-831
parents 86974572 2736fd51
...@@ -657,7 +657,7 @@ LEFT JOIN user_cons_columns r_cols ...@@ -657,7 +657,7 @@ LEFT JOIN user_cons_columns r_cols
$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";
......
...@@ -706,6 +706,63 @@ EOD; ...@@ -706,6 +706,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