From f67543df067506b142b706333e1974bebcd48802 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Thu, 16 Jan 2014 02:18:36 -0500 Subject: [PATCH] DatabaseMysqlBase: Remove broken check for Percona Server Percona Server does not include its name in its version suffix. It would be possible to check for precompiled versions of the product using the version_comment variable, though not third- party builds from its source code (which are merely indicated as "Source distribution"). Given that even Percona itself does not distinguish between Percona Server and MySQL in their version of the mysql command- line client, I have chosen simply to remove the broken check. I have also made the check for MariaDB consistent with that in its version of mysql (by also checking for the old suffix "-maria-"). Follows-up 0eab1ace67e7. Change-Id: I62c3949b775a38f28f09568ebb28af2adb9be69b --- includes/db/DatabaseMysqlBase.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 85be31c920..23b845efae 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -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]'; } /** -- 2.20.1