<?php
+/**
+ * @ingroup Database
+ * @file
+ */
/**
* This is the Oracle database abstraction layer.
+ * @ingroup Database
*/
-
class ORABlob {
var $mData;
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;
}
return $ret;
}
-};
+}
+/**
+ * @ingroup Database
+ */
class DatabaseOracle extends Database {
var $mInsertId = NULL;
var $mLastResult = NULL;
function implicitGroupby() {
return false;
}
+ function implicitOrderby() {
+ return false;
+ }
function searchableIPs() {
return true;
}
$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__);
oci_free_statement($stmt);
}
-
+
function tableName( $name ) {
# Replace reserved words with better ones
switch( $name ) {
}
/**
- * 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 '';
}
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;
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