Commit 8253c780 authored by Benjamin Eberlei's avatar Benjamin Eberlei

[DBAL-206] Fix user-supplied patch to work with testsuite

parent 05d052bb
......@@ -480,7 +480,7 @@ END;';
cols.position,
r_alc.table_name \"references_table\",
r_cols.column_name \"foreign_column\"
FROM usercons_columns cols
FROM user_cons_columns cols
LEFT JOIN user_constraints alc
ON alc.constraint_name = cols.constraint_name
LEFT JOIN user_constraints r_alc
......@@ -502,14 +502,16 @@ LEFT JOIN user_cons_columns r_cols
public function getListTableColumnsSQL($table, $database = null)
{
$table = strtoupper($table);
$ownerCondition = '';
$tabColumnsTableName = "user_tab_columns";
$ownerCondition = '';
if(null !== $database){
$database = strtoupper($database);
$tabColumnsTableName = "all_tab_columns";
$ownerCondition = "AND c.owner = '".$database."'";
}
return "SELECT c.*, d.comments FROM user_tab_columns c ".
return "SELECT c.*, d.comments FROM $tabColumnsTableName c ".
"INNER JOIN user_col_comments d ON d.TABLE_NAME = c.TABLE_NAME AND d.COLUMN_NAME = c.COLUMN_NAME ".
"WHERE c.table_name = '" . $table . "' ".$ownerCondition." ORDER BY c.column_name";
}
......
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