X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fdb%2FDatabaseMysqlBase.php;h=3b70ae17e27cf2d84a89174c41ab5fcabae53e48;hb=d1f8fb08d496fe84f90d97d8f888a0242ed0efb4;hp=85be31c92077182cb0d6a36f6ec4fe3976bd735b;hpb=00501a17f10bcb58c3b13671d29d9d50a4bf3d6a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 85be31c920..3b70ae17e2 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -93,7 +93,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase { if ( !$error ) { $error = $this->lastError(); } - wfLogDBError( "Error connecting to {$this->mServer}: $error\n" ); + wfLogDBError( "Error connecting to {$this->mServer}: $error" ); wfDebug( "DB connection error\n" . "Server: $server, User: $user, Password: " . substr( $password, 0, 3 ) . "..., error: " . $error . "\n" ); @@ -108,7 +108,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase { $success = $this->selectDB( $dbName ); wfRestoreWarnings(); if ( !$success ) { - wfLogDBError( "Error selecting database $dbName on server {$this->mServer}\n" ); + wfLogDBError( "Error selecting database $dbName on server {$this->mServer}" ); wfDebug( "Error selecting database $dbName on server {$this->mServer} " . "from client host " . wfHostname() . "\n" ); @@ -804,14 +804,18 @@ abstract class DatabaseMysqlBase extends DatabaseBase { * @return string */ public function getSoftwareLink() { + // MariaDB includes its name in its version string (sent when the connection is opened), + // and this is how MariaDB's version of the mysql command-line client identifies MariaDB + // servers (see the mariadb_connection() function in libmysql/libmysql.c). $version = $this->getServerVersion(); - if ( strpos( $version, 'MariaDB' ) !== false ) { + if ( strpos( $version, 'MariaDB' ) !== false || strpos( $version, '-maria-' ) !== false ) { return '[{{int:version-db-mariadb-url}} MariaDB]'; - } elseif ( strpos( $version, 'percona' ) !== false ) { - return '[{{int:version-db-percona-url}} Percona Server]'; - } else { - return '[{{int:version-db-mysql-url}} MySQL]'; } + + // Percona Server's version suffix is not very distinctive, and @@version_comment + // doesn't give the necessary info for source builds, so assume the server is MySQL. + // (Even Percona's version of mysql doesn't try to make the distinction.) + return '[{{int:version-db-mysql-url}} MySQL]'; } /**