[MDEV-7780] Support for faking server version Created: 2015-03-14  Updated: 2020-08-25  Resolved: 2015-11-27

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.2.0

Type: Task Priority: Minor
Reporter: Imre Rad Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-10541 Faking the version string only works ... Closed
causes MDEV-10982 Faking the server version also change... Closed
Relates
relates to MDEV-7365 Option to hide server version Closed
relates to MDEV-9593 Print the real version in the error log Closed
relates to MDEV-11113 Server with binary logging refuses to... Open
relates to MDEV-12816 Please extend fake server version fea... Open
relates to CONJ-321 Handle 10.2 server "forced" version Closed
relates to MDEV-10967 Print the real version in the error l... Closed
Sprint: 10.2.0-1

 Description   

The official MySQL server returns version string like this:
5.5.25-log
While (latest stable) MariaDB:
10.0.17-MariaDB-1~wheezy-log

Some old and crappy CMS installations break with the MariaDB string above, like Joomla til API17:

  public function hasUTF()
  {
    $verParts = explode('.', $this->getVersion());
    return ($verParts[0] == 5 || ($verParts[0] == 4 && $verParts[1] == 1 && (int)$verParts[2] >= 2));
  }

MariaDB is told to be a drop-in replacement for MySQL. In this case it is unfortunately not true. Patching the already installed webapps is usually not an option for administrators.

For this reason I recommend to add a new configuration option, something like this into mysqld section of the config file:
fake_version=5.5.25-log

With this option set, MariaDB could return the faked version string.



 Comments   
Comment by Sergei Golubchik [ 2015-11-10 ]

We can simply make @@version writable (from the command-line, not run-time)

Comment by Sergey Vojtovich [ 2015-11-24 ]

serg, please review patch for this task.

Comment by Sergey Vojtovich [ 2015-11-24 ]

serg, please disregard first patch, it's incorrect. Will send updated version ASAP.

Comment by Sergey Vojtovich [ 2015-11-25 ]

serg, patch updated.

Comment by Sergey Vojtovich [ 2015-11-26 ]

serg, test case extended as requested.

Comment by Sergey Vojtovich [ 2015-11-26 ]

serg, test case updated.

Generated at Thu Feb 08 07:22:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.