r71630 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71629‎ | r71630 | r71631 >
Date:15:58, 25 August 2010
Author:reedy
Status:ok
Tags:
Comment:
Change usages of Database:: for function names in DatabaseMssql to DatabaseMssql::
Modified paths:
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -281,7 +281,7 @@
282282 * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
283283 * @return Mixed: database result resource (feed to Database::fetchObject or whatever), or false on failure
284284 */
285 - function select( $table, $vars, $conds = '', $fname = 'Database::select', $options = array(), $join_conds = array() )
 285+ function select( $table, $vars, $conds = '', $fname = 'DatabaseMssql::select', $options = array(), $join_conds = array() )
286286 {
287287 $sql = $this->selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds );
288288 if ( isset( $options['EXPLAIN'] ) ) {
@@ -306,7 +306,7 @@
307307 * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
308308 * @return string, the SQL text
309309 */
310 - function selectSQLText( $table, $vars, $conds = '', $fname = 'Database::select', $options = array(), $join_conds = array() ) {
 310+ function selectSQLText( $table, $vars, $conds = '', $fname = 'DatabaseMssql::select', $options = array(), $join_conds = array() ) {
311311 if ( isset( $options['EXPLAIN'] ) ) {
312312 unset( $options['EXPLAIN'] );
313313 }
@@ -320,7 +320,7 @@
321321 * Returns -1 if count cannot be found
322322 * Takes same arguments as Database::select()
323323 */
324 - function estimateRowCount( $table, $vars = '*', $conds = '', $fname = 'Database::estimateRowCount', $options = array() ) {
 324+ function estimateRowCount( $table, $vars = '*', $conds = '', $fname = 'DatabaseMssql::estimateRowCount', $options = array() ) {
325325 $options['EXPLAIN'] = true;// http://msdn2.microsoft.com/en-us/library/aa259203.aspx
326326 $res = $this->select( $table, $vars, $conds, $fname, $options );
327327
@@ -337,7 +337,7 @@
338338 * Returns information about an index
339339 * If errors are explicitly ignored, returns NULL on failure
340340 */
341 - function indexInfo( $table, $index, $fname = 'Database::indexExists' ) {
 341+ function indexInfo( $table, $index, $fname = 'DatabaseMssql::indexExists' ) {
342342 # This does not return the same info as MYSQL would, but that's OK because MediaWiki never uses the
343343 # returned value except to check for the existance of indexes.
344344 $sql = "sp_helpindex '" . $table . "'";
@@ -376,7 +376,7 @@
377377 * Usually aborts on failure
378378 * If errors are explicitly ignored, returns success
379379 */
380 - function insert( $table, $arrToInsert, $fname = 'Database::insert', $options = array() ) {
 380+ function insert( $table, $arrToInsert, $fname = 'DatabaseMssql::insert', $options = array() ) {
381381 # No rows to insert, easy just return now
382382 if ( !count( $arrToInsert ) ) {
383383 return true;
@@ -507,7 +507,7 @@
508508 * $conds may be "*" to copy the whole table
509509 * srcTable may be an array of tables.
510510 */
511 - function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'Database::insertSelect',
 511+ function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseMssql::insertSelect',
512512 $insertOptions = array(), $selectOptions = array() )
513513 {
514514 $ret = parent::insertSelect( $destTable, $srcTable, $varMap, $conds, $fname, $insertOptions, $selectOptions );
@@ -591,7 +591,7 @@
592592 # It may be more efficient to leave off unique indexes which are unlikely to collide.
593593 # However if you do this, you run the risk of encountering errors which wouldn't have
594594 # occurred in MySQL
595 - function replace( $table, $uniqueIndexes, $rows, $fname = 'Database::replace' ) {
 595+ function replace( $table, $uniqueIndexes, $rows, $fname = 'DatabaseMssql::replace' ) {
596596 $table = $this->tableName( $table );
597597
598598 if ( count( $rows ) == 0 ) {
@@ -641,9 +641,9 @@
642642 }
643643
644644 # DELETE where the condition is a join
645 - function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = "Database::deleteJoin" ) {
 645+ function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = "DatabaseMssql::deleteJoin" ) {
646646 if ( !$conds ) {
647 - throw new DBUnexpectedError( $this, 'Database::deleteJoin() called with empty $conds' );
 647+ throw new DBUnexpectedError( $this, 'DatabaseMssql::deleteJoin() called with empty $conds' );
648648 }
649649
650650 $delTable = $this->tableName( $delTable );
@@ -762,7 +762,7 @@
763763 /**
764764 * Query whether a given column exists in the mediawiki schema
765765 */
766 - function fieldExists( $table, $field, $fname = 'Database::fieldExists' ) {
 766+ function fieldExists( $table, $field, $fname = 'DatabaseMssql::fieldExists' ) {
767767 $table = $this->tableName( $table );
768768 $res = sqlsrv_query( $this->mConn, "SELECT DATA_TYPE FROM INFORMATION_SCHEMA.Columns
769769 WHERE TABLE_NAME = '$table' AND COLUMN_NAME = '$field'" );
@@ -792,7 +792,7 @@
793793 /**
794794 * Begin a transaction, committing any previously open transaction
795795 */
796 - function begin( $fname = 'Database::begin' ) {
 796+ function begin( $fname = 'DatabaseMssql::begin' ) {
797797 sqlsrv_begin_transaction( $this->mConn );
798798 $this->mTrxLevel = 1;
799799 }
@@ -800,7 +800,7 @@
801801 /**
802802 * End a transaction
803803 */
804 - function commit( $fname = 'Database::commit' ) {
 804+ function commit( $fname = 'DatabaseMssql::commit' ) {
805805 sqlsrv_commit( $this->mConn );
806806 $this->mTrxLevel = 0;
807807 }
@@ -809,7 +809,7 @@
810810 * Rollback a transaction.
811811 * No-op on non-transactional databases.
812812 */
813 - function rollback( $fname = 'Database::rollback' ) {
 813+ function rollback( $fname = 'DatabaseMssql::rollback' ) {
814814 sqlsrv_rollback( $this->mConn );
815815 $this->mTrxLevel = 0;
816816 }

Status & tagging log