DatabaseMysqlBase: Remove broken check for Percona Server
authorKevin Israel <pleasestand@live.com>
Thu, 16 Jan 2014 07:18:36 +0000 (02:18 -0500)
committerKevin Israel <pleasestand@live.com>
Sat, 22 Mar 2014 00:17:08 +0000 (20:17 -0400)
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

index 85be31c..23b845e 100644 (file)
@@ -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]';
        }
 
        /**