* (bug 14258, 14368) Fix for subpage renames in replication environments
[lhc/web/wiklou.git] / includes / DatabaseOracle.php
index 7bb4e15..8d2a675 100644 (file)
@@ -1,9 +1,13 @@
 <?php
+/**
+ * @ingroup Database
+ * @file
+ */
 
 /**
  * This is the Oracle database abstraction layer.
+ * @ingroup Database
  */
-
 class ORABlob {
        var $mData;
 
@@ -14,12 +18,13 @@ class ORABlob {
        function getData() {
                return $this->mData;
        }
-};
+}
 
-/*
- * The oci8 extension is fairly weak and doesn't support oci_num_rows, among 
- * other things.  We use a wrapper class to handle that and other 
+/**
+ * The oci8 extension is fairly weak and doesn't support oci_num_rows, among
+ * other things.  We use a wrapper class to handle that and other
  * Oracle-specific bits, like converting column names back to lowercase.
+ * @ingroup Database
  */
 class ORAResult {
        private $rows;
@@ -83,8 +88,11 @@ class ORAResult {
                }
                return $ret;
        }
-};
+}
 
+/**
+ * @ingroup Database
+ */
 class DatabaseOracle extends Database {
        var $mInsertId = NULL;
        var $mLastResult = NULL;
@@ -124,6 +132,9 @@ class DatabaseOracle extends Database {
        function implicitGroupby() {
                return false;
        }
+       function implicitOrderby() {
+               return false;
+       }
        function searchableIPs() {
                return true;
        }
@@ -197,7 +208,7 @@ class DatabaseOracle extends Database {
                        $e = oci_error($this->mConn);
                        $this->reportQueryError($e['message'], $e['code'], $sql, __FUNCTION__);
                }
-               
+
                if (oci_execute($stmt, $this->execFlags()) == false) {
                        $e = oci_error($stmt);
                        $this->reportQueryError($e['message'], $e['code'], $sql, __FUNCTION__);
@@ -360,7 +371,7 @@ class DatabaseOracle extends Database {
 
                oci_free_statement($stmt);
        }
-       
+
        function tableName( $name ) {
                # Replace reserved words with better ones
                switch( $name ) {
@@ -385,7 +396,7 @@ class DatabaseOracle extends Database {
        }
 
        /**
-        * ORacle does not have a "USE INDEX" clause, so return an empty string
+        * Oracle does not have a "USE INDEX" clause, so return an empty string
         */
        function useIndexClause($index) {
                return '';
@@ -523,7 +534,7 @@ class DatabaseOracle extends Database {
        }
 
        function reportQueryError($error, $errno, $sql, $fname, $tempIgnore = false) {
-               # Ignore errors during error handling to avoid infinite 
+               # Ignore errors during error handling to avoid infinite
                # recursion
                $ignore = $this->ignoreErrors(true);
                ++$this->mErrorCount;
@@ -646,36 +657,54 @@ echo "error!\n";
 
                if ( isset( $options['GROUP BY'] ) ) $preLimitTail .= " GROUP BY {$options['GROUP BY']}";
                if ( isset( $options['ORDER BY'] ) ) $preLimitTail .= " ORDER BY {$options['ORDER BY']}";
-               
+
                if (isset($options['LIMIT'])) {
                //      $tailOpts .= $this->limitResult('', $options['LIMIT'],
-               //              isset($options['OFFSET']) ? $options['OFFSET'] 
+               //              isset($options['OFFSET']) ? $options['OFFSET']
                //              : false);
                }
 
                #if ( isset( $noKeyOptions['FOR UPDATE'] ) ) $tailOpts .= ' FOR UPDATE';
                #if ( isset( $noKeyOptions['LOCK IN SHARE MODE'] ) ) $tailOpts .= ' LOCK IN SHARE MODE';
-               if ( isset( $noKeyOptions['DISTINCT'] ) && isset( $noKeyOptions['DISTINCTROW'] ) ) $startOpts .= 'DISTINCT';
+               if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) $startOpts .= 'DISTINCT';
 
                if ( isset( $options['USE INDEX'] ) && ! is_array( $options['USE INDEX'] ) ) {
                        $useIndex = $this->useIndexClause( $options['USE INDEX'] );
                } else {
                        $useIndex = '';
                }
-               
+
                return array( $startOpts, $useIndex, $preLimitTail, $postLimitTail );
        }
 
        public function setTimeout( $timeout ) {
-               /// @fixme no-op
+               // @todo fixme no-op
        }
 
        function ping() {
-               wfDebug( "Function ping() not written for DatabasePostgres.php yet");
+               wfDebug( "Function ping() not written for DatabaseOracle.php yet");
                return true;
        }
 
+       /**
+        * How lagged is this slave?
+        *
+        * @return int
+        */
+       public function getLag() {
+               # Not implemented for Oracle
+               return 0;
+       }
 
-} // end DatabaseOracle class
+       function setFakeSlaveLag() {}
+       function setFakeMaster() {}
 
-?>
+       function getDBname() {
+               return $this->mDBname;
+       }
+
+       function getServer() {
+               return $this->mServer;
+       }
+
+} // end DatabaseOracle class