2

If I inspect the DB version information from within PHP, MariaDB returns an extra set of version numbers at the front of its version string.

>>> DB::connection()->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
=> "5.5.5-10.2.20-MariaDB-1:10.2.20+maria~bionic"

What does the 5.5.5 represent?

Erich
  • 2,408
  • 18
  • 40
  • 1
    SO is for programming questions when you're having issues with your code. Since this question doesn't have anything to do with programming, I'm voting to close it. – M. Eriksson Jun 14 '19 at 15:41
  • Execute the query: `show variables where variable_name like '%version%' ` and see what you get. My suspicion is that it is the `innodb_version`. – KIKO Software Jun 14 '19 at 15:42
  • 1
    Hmmm... I just ran `$pdo->getAttribute(PDO::ATTR_SERVER_VERSION)` on my dev box and got `5.5.5-10.1.30-MariaDB` ... my innodb version is `5.6.36-82.2` ... I'm going to hazard a guess that PDO hedges its bets with MariaDB versions when you request `PDO::ATTR_SERVER_VERSION`; I suspect `5.5.5` and `10.1.30` were the stable versions of the 5.x and 10.x branches when I installed MariaDB (currently it's 5.5.65 and 10.1.40 ... or 10.2.24 ... or 10.3.15 ... ho hum). – CD001 Jun 14 '19 at 15:54

1 Answers1

5

The version prefix (so called "replication version hack") was introduced when MariaDB bumped the major version number to 10 (2 digits).

This was necessary, since the replication protocol expects a 1-digit major version number and would break with a 2 digit version number.

The version 5.5.5 was never released.

From Connector/C source:

#define MA_RPL_VERSION_HACK "5.5.5-"
...
mysql->server_version= strdup(end + sizeof(MA_RPL_VERSION_HACK) - 1);
Georg Richter
  • 5,970
  • 2
  • 9
  • 15