From cc012b685f2c57bad20de33acec343fa027042ea Mon Sep 17 00:00:00 2001
From: Simon Edwards <simon@moxul.com>
Date: Wed, 30 Oct 2013 12:01:21 +0000
Subject: [PATCH] Use all_col_comments when specifying a $database for
 getListTableColumnsSQL()

Using user_col_comments in the INNER JOIN when referencing all_tab_columns causes no results to be returned.
---
 lib/Doctrine/DBAL/Platforms/OraclePlatform.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php
index 6dbfbf185..1f0fc9ee1 100644
--- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php
@@ -541,16 +541,18 @@ LEFT JOIN user_cons_columns r_cols
         $table = strtoupper($table);
 
         $tabColumnsTableName = "user_tab_columns";
+        $colCommentsTableName = "user_col_comments";
         $ownerCondition = '';
 
         if (null !== $database){
             $database = strtoupper($database);
             $tabColumnsTableName = "all_tab_columns";
+            $colCommentsTableName = "all_col_comments";
             $ownerCondition = "AND c.owner = '".$database."'";
         }
 
         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 ".
+               "INNER JOIN " . $colCommentsTableName . " 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";
     }
 
-- 
2.21.0