http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72825

Revision: 72825
Author:   ialex
Date:     2010-09-11 19:41:30 +0000 (Sat, 11 Sep 2010)

Log Message:
-----------
Added some __METHOD__ to DatabaseBase::query() calls

Modified Paths:
--------------
    trunk/phase3/includes/installer/MysqlInstaller.php
    trunk/phase3/includes/installer/MysqlUpdater.php
    trunk/phase3/maintenance/updaters.inc

Modified: trunk/phase3/includes/installer/MysqlInstaller.php
===================================================================
--- trunk/phase3/includes/installer/MysqlInstaller.php  2010-09-11 19:10:24 UTC 
(rev 72824)
+++ trunk/phase3/includes/installer/MysqlInstaller.php  2010-09-11 19:41:30 UTC 
(rev 72825)
@@ -144,7 +144,7 @@
                # Determine existing default character set
                if ( $conn->tableExists( "revision" ) ) {
                        $revision = $conn->escapeLike( $this->getVar( 
'wgDBprefix' ) . 'revision' );
-                       $res = $conn->query( "SHOW TABLE STATUS LIKE 
'$revision'" );
+                       $res = $conn->query( "SHOW TABLE STATUS LIKE 
'$revision'", __METHOD__ );
                        $row = $conn->fetchObject( $res );
                        if ( !$row ) {
                                $this->parent->showMessage( 
'config-show-table-status' );
@@ -205,7 +205,7 @@
                }
 
                $engines = array();
-               $res = $conn->query( 'SHOW ENGINES' );
+               $res = $conn->query( 'SHOW ENGINES', __METHOD__ );
                foreach ( $res as $row ) {
                        if ( $row->Support == 'YES' || $row->Support == 
'DEFAULT' ) {
                                $engines[] = $row->Engine;
@@ -415,7 +415,7 @@
                $conn = $status->value;
                $dbName = $this->getVar( 'wgDBname' );
                if( !$conn->selectDB( $dbName ) ) {
-                       $conn->query( "CREATE DATABASE `$dbName`" );
+                       $conn->query( "CREATE DATABASE `$dbName`", __METHOD__ );
                        $conn->selectDB( $dbName );
                }
                return $status;

Modified: trunk/phase3/includes/installer/MysqlUpdater.php
===================================================================
--- trunk/phase3/includes/installer/MysqlUpdater.php    2010-09-11 19:10:24 UTC 
(rev 72824)
+++ trunk/phase3/includes/installer/MysqlUpdater.php    2010-09-11 19:41:30 UTC 
(rev 72825)
@@ -185,17 +185,14 @@
                        $field = $prefix . '_namespace';
 
                        $tablename = $this->db->tableName( $table );
-                       $result = $this->db->query( "SHOW COLUMNS FROM 
$tablename LIKE '$field'" );
+                       $result = $this->db->query( "SHOW COLUMNS FROM 
$tablename LIKE '$field'", __METHOD__ );
                        $info = $this->db->fetchObject( $result );
 
                        if ( substr( $info->Type, 0, 3 ) == 'int' ) {
                                wfOut( "...$field is already a full int 
($info->Type).\n" );
                        } else {
                                wfOut( "Promoting $field from $info->Type to 
int... " );
-
-                               $sql = "ALTER TABLE $tablename MODIFY $field 
int NOT NULL";
-                               $this->db->query( $sql );
-
+                               $this->db->query( "ALTER TABLE $tablename 
MODIFY $field int NOT NULL", __METHOD__ );
                                wfOut( "ok\n" );
                        }
                }

Modified: trunk/phase3/maintenance/updaters.inc
===================================================================
--- trunk/phase3/maintenance/updaters.inc       2010-09-11 19:10:24 UTC (rev 
72824)
+++ trunk/phase3/maintenance/updaters.inc       2010-09-11 19:41:30 UTC (rev 
72825)
@@ -142,7 +142,7 @@
        if ( $dbw->getType() != 'mysql' )
                return;
        $tableName = $dbw->tableName( $table );
-       $res = $dbw->query( "SELECT $field FROM $tableName LIMIT 0" );
+       $res = $dbw->query( "SELECT $field FROM $tableName LIMIT 0", __METHOD__ 
);
        $flags = explode( ' ', mysql_field_flags( $res->result, 0 ) );
 
        if ( in_array( 'binary', $flags ) ) {



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to