Added some __METHOD__ to DatabaseBase::query() calls
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 11 Sep 2010 19:41:30 +0000 (19:41 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 11 Sep 2010 19:41:30 +0000 (19:41 +0000)
includes/installer/MysqlInstaller.php
includes/installer/MysqlUpdater.php
maintenance/updaters.inc

index 3876d1a..d4af144 100644 (file)
@@ -144,7 +144,7 @@ class MysqlInstaller extends DatabaseInstaller {
                # 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 @@ class MysqlInstaller extends DatabaseInstaller {
                }
 
                $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 @@ class MysqlInstaller extends DatabaseInstaller {
                $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;
index b7e16cc..a54b202 100644 (file)
@@ -185,17 +185,14 @@ class MysqlUpdater extends DatabaseUpdater {
                        $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" );
                        }
                }
index 5d28cc1..a237df5 100644 (file)
@@ -142,7 +142,7 @@ function check_bin( $table, $field, $patchFile ) {
        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 ) ) {