From 27232d5f4282f6053334ba960a7f27945f61b41e Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 11 Sep 2010 19:41:30 +0000 Subject: [PATCH] Added some __METHOD__ to DatabaseBase::query() calls --- includes/installer/MysqlInstaller.php | 6 +++--- includes/installer/MysqlUpdater.php | 7 ++----- maintenance/updaters.inc | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 3876d1a861..d4af144d46 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -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; diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index b7e16cc7bc..a54b202bf9 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -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" ); } } diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 5d28cc1995..a237df5e1d 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -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 ) ) { -- 2.20.1