Page MenuHomePhabricator

Differentiate between MySQL and MySQL forks (ie MariaDB)
Closed, ResolvedPublic

Description

<mutante> just switched a mediawiki from MySQL to MariaDB on Debian squeeze, went all fine, wiki kept running. on Special:Version "5.1.55-MariaDB-mariadb98~squeeze-log", the only minor thing is the "Product" Link is eventually MySQL and link to mysql.com
<Reedy> MariaDB isn't "supported" as a fork


Version: unspecified
Severity: enhancement

Details

Reference
bz28281

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 11:35 PM
bzimport set Reference to bz28281.

I don't see any reason to really "push" this since it isn't MW's responsibility to promote MySQL.

sumanah wrote:

The issue here is that MediaWiki thinks that the database is MySQL "because we're using mysql_* functions ...we assumed DatabaseMysql would only ever refer to mysql.... Presumably we'd like to have some way in php to differentiate the two."

I'm reaching out to the MariaDB community to see whether they care about this issue at all and would want to put any time into fixing it.

IRC conversation for context:

<^demon> I dunno what MariaDB would need to do.
<blobaugh> sumanah: that looks like an issue on the MariaDB side?
<^demon> Presumably we'd like to have some way in php to differentiate the two.
<blobaugh> the only way to fix that is to contribute the patch to them
<sumanah> blobaugh: I mean, MariaDB people would donate a bit of time to fix it in MediaWiki.
<^demon> Again...
<^demon> I'm not sure what MariaDB needs to do?
<^demon> We assume it's mysql because we're using mysql_* functions
<blobaugh> ^demon: it looks like just change the link on the Special:Version page
<Platonides> getSoftwareLink() currently returns a static string
<Platonides> (DatabaseMysql class)
<^demon> Platonides: Right. Because we assumed DatabaseMysql would only ever refer to mysql.
<Platonides> the work is to somewhow differenciate between the two
<blobaugh> so to fix it a new class would need to be made? DatabaseMariaDb?
<^demon> Platonides: But other than a software link, do we need to differentiate at all? 
<^demon> ie: Would the subclass be anything other than overriding getSoftwareLink()? 
<blobaugh> Not in the code, yet 
<Platonides> make mysql family servers add a command 'SELECT UPSTREAM_LINK();' :) 
<Platonides> I don't think so 
<blobaugh> ^demon: afaik you are correct
<Platonides> if we switched to it, perhaps we would begin optimizing some edge cases
<G_SabinoMullane> I thought MariaDB was meant to be super transparent with regards to working MySQL code?
<Platonides> but it's similar enough to mysql that I don't think we would make any change in the class

I wonder if we actually really need to do anything further for this. From mediawiki.org just now:

MySQL 5.5.30-MariaDB-mariadb1~precise-log

(In reply to comment #3)

I wonder if we actually really need to do anything further for this. From
mediawiki.org just now:

MySQL 5.5.30-MariaDB-mariadb1~precise-log

Well it says 'MySQL' and the link goes to http://www.mysql.com/. So while we don't really need to change that, it seems appropriate considering it's not really MySQL, but a fork.

Database*::getSoftwareLink() is already being called non-statically from both WebInstallerPage and SpecialVersion. So it would be about 5 minutes' work to change the method declarations to be non-static and to fix DatabaseMysql::getSoftwareLink() to return something appropriate. In the WebInstallerPage case, the object is not connected to an actual server, which is not a problem, it's just an extra line of code to check for that.

Probably want to change config-type-mysql msg in installer to be "MySql or MariaDB"

Yeah it's not just MariaDB, it's also Percona Server (Drizzle doesn't support mysql's communication protocol so it's not relevant).

The return of VERSION() appears to at least hint what the server type is. We might just want to try and extract which server type it is out of that then look up a hardcoded list of MySQL derived server types and their urls.

Creating a subclass for MariaDB doesn't really sound like a great idea. That could make things turn into a mess if we decide to slowly ease into migrating from the mysql_* functions to MySQLi or PDO by creating something like a Database_MySQLi subclass.

Change 106490 had a related patch set uploaded by PleaseStand:
Clean up config-support-* messages

https://gerrit.wikimedia.org/r/106490

Change 106489 had a related patch set uploaded by PleaseStand:
WebInstaller: Don't call getSoftwareLink()

https://gerrit.wikimedia.org/r/106489

Change 106490 abandoned by PleaseStand:
Clean up config-support-* messages

Reason:
Squashed into I6dbc9d32, with message keys changed.

https://gerrit.wikimedia.org/r/106490

Change 106489 merged by jenkins-bot:
WebInstaller: Don't call getSoftwareLink()

https://gerrit.wikimedia.org/r/106489

The above change added detection for most versions of MariaDB, though I still have to fix detection of Percona Server.

(In reply to Kevin Israel (PleaseStand) from comment #13)

The above change added detection for most versions of MariaDB, though I
still have to fix detection of Percona Server.

Decided not to do that, instead removing the broken check in f67543df0675.