Merge "Changed tableName so it returns uppercased table names (+prefix) Changed table...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 18 Sep 2013 19:11:04 +0000 (19:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 18 Sep 2013 19:11:04 +0000 (19:11 +0000)
includes/db/DatabaseOracle.php

index fca979b..fbaa4da 100644 (file)
@@ -694,7 +694,7 @@ class DatabaseOracle extends DatabaseBase {
                                break;
                }
 
-               return parent::tableName( strtoupper( $name ), $format );
+               return strtoupper( parent::tableName( $name, $format ) );
        }
 
        function tableNameInternal( $name ) {
@@ -883,7 +883,7 @@ class DatabaseOracle extends DatabaseBase {
 
        /**
         * Query whether a given table exists (in the given schema, or the default mw one if not given)
-        * @return int
+        * @return bool
         */
        function tableExists( $table, $fname = __METHOD__ ) {
                $table = $this->tableName( $table );
@@ -891,13 +891,14 @@ class DatabaseOracle extends DatabaseBase {
                $owner = $this->addQuotes( strtoupper( $this->mDBname ) );
                $SQL = "SELECT 1 FROM all_tables WHERE owner=$owner AND table_name=$table";
                $res = $this->doQuery( $SQL );
-               if ( $res ) {
-                       $count = $res->numRows();
-                       $res->free();
+               if ( $res && $res->numRows() > 0 ) {
+                       $exists = true;
                } else {
-                       $count = 0;
+                       $exists = false;
                }
-               return $count;
+
+               $res->free();
+               return $exists;
        }
 
        /**