summaryrefslogtreecommitdiff
path: root/includes/db/DatabaseMssql.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /includes/db/DatabaseMssql.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/db/DatabaseMssql.php')
-rw-r--r--includes/db/DatabaseMssql.php86
1 files changed, 9 insertions, 77 deletions
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 28ccab2d..6b1206b0 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -10,7 +10,7 @@
/**
* @ingroup Database
*/
-class DatabaseMssql extends Database {
+class DatabaseMssql extends DatabaseBase {
var $mAffectedRows;
var $mLastResult;
@@ -25,7 +25,7 @@ class DatabaseMssql extends Database {
$failFunction = false, $flags = 0, $tablePrefix = 'get from global') {
global $wgOut, $wgDBprefix, $wgCommandLineMode;
- if (!isset($wgOut)) $wgOut = NULL; # Can't get a reference if it hasn't been set yet
+ if (!isset($wgOut)) $wgOut = null; # Can't get a reference if it hasn't been set yet
$this->mOut =& $wgOut;
$this->mFailFunction = $failFunction;
$this->mFlags = $flags;
@@ -45,6 +45,10 @@ class DatabaseMssql extends Database {
}
+ function getType() {
+ return 'mssql';
+ }
+
/**
* todo: check if these should be true like parent class
*/
@@ -131,7 +135,7 @@ class DatabaseMssql extends Database {
function close() {
$this->mOpened = false;
if ($this->mConn) {
- if ($this->trxLevel()) $this->immediateCommit();
+ if ($this->trxLevel()) $this->commit();
return mssql_close($this->mConn);
} else return true;
}
@@ -446,22 +450,6 @@ class DatabaseMssql extends Database {
}
/**
- * Estimate rows in dataset
- * Returns estimated count, based on EXPLAIN output
- * Takes same arguments as Database::select()
- */
- function estimateRowCount( $table, $vars='*', $conds='', $fname = 'Database::estimateRowCount', $options = array() ) {
- $rows = 0;
- $res = $this->select ($table, 'COUNT(*)', $conds, $fname, $options );
- if ($res) {
- $row = $this->fetchObject($res);
- $rows = $row[0];
- }
- $this->freeResult($res);
- return $rows;
- }
-
- /**
* Determines whether a field exists in a table
* Usually aborts on failure
* If errors are explicitly ignored, returns NULL on failure
@@ -490,13 +478,13 @@ class DatabaseMssql extends Database {
function indexInfo( $table, $index, $fname = 'Database::indexInfo' ) {
throw new DBUnexpectedError( $this, 'Database::indexInfo called which is not supported yet' );
- return NULL;
+ return null;
$table = $this->tableName( $table );
$sql = 'SHOW INDEX FROM '.$table;
$res = $this->query( $sql, $fname );
if ( !$res ) {
- return NULL;
+ return null;
}
$result = array();
@@ -708,13 +696,6 @@ class DatabaseMssql extends Database {
}
/**
- * USE INDEX clause
- */
- function useIndexClause( $index ) {
- return "";
- }
-
- /**
* REPLACE query wrapper
* PostgreSQL simulates this with a DELETE followed by INSERT
* $row is the row to insert, an associative array
@@ -858,18 +839,6 @@ class DatabaseMssql extends Database {
}
/**
- * Returns an SQL expression for a simple conditional.
- *
- * @param $cond String: SQL expression which will result in a boolean value
- * @param $trueVal String: SQL expression to return if true
- * @param $falseVal String: SQL expression to return if false
- * @return string SQL fragment
- */
- function conditional( $cond, $trueVal, $falseVal ) {
- return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
- }
-
- /**
* Should determine if the last failure was due to a deadlock
* @return bool
*/
@@ -878,22 +847,6 @@ class DatabaseMssql extends Database {
}
/**
- * Begin a transaction, committing any previously open transaction
- * @deprecated use begin()
- */
- function immediateBegin( $fname = 'Database::immediateBegin' ) {
- $this->begin();
- }
-
- /**
- * Commit transaction, if one is open
- * @deprecated use commit()
- */
- function immediateCommit( $fname = 'Database::immediateCommit' ) {
- $this->commit();
- }
-
- /**
* Return MW-style timestamp used for MySQL schema
*/
function timestamp( $ts=0 ) {
@@ -931,16 +884,6 @@ class DatabaseMssql extends Database {
}
/**
- * not done
- */
- public function setTimeout($timeout) { return; }
-
- function ping() {
- wfDebug("Function ping() not written for MSSQL yet");
- return true;
- }
-
- /**
* How lagged is this slave?
*/
public function getLag() {
@@ -1001,20 +944,9 @@ class DatabaseMssql extends Database {
}
}
- /**
- * No-op lock functions
- */
- public function lock( $lockName, $method ) {
- return true;
- }
- public function unlock( $lockName, $method ) {
- return true;
- }
-
public function getSearchEngine() {
return "SearchEngineDummy";
}
-
}
/**