use MariaDB 10.x as database for a JOOMLA driven site
login to backend and open "system->systeminformation"
look for the "database server version"
show the correct MariaDB server version, e.g.: "10.0.17-MariaDB-log"
shows the MariaDB version with a prefix of "5.5.5-", e.g.: "5.5.5-10.0.17-MariaDB-log"
MariaDB 10 adds the prefix "5.5.5-"
relevant code:
libraries/joomla/database/driver/mysqli.php
the mysqli.php driver function "getVersion" uses the "mysqli_get_server_info" rather than the SQL query "select version();"
/**
* Get the version of the database connector.
*
* @return string The database connector version.
*
* @since 12.1
*/
public function getVersion()
{
$this->connect();
return mysqli_get_server_info($this->connection);
}
For reference, other systems do have the same issue...
http://mediawiki-commits.wikimedia.narkive.com/mxwXjYFI/gerrit-databasemysqlbase-use-version-rather-than-server-info-change-mediawiki-core
@schultz-it-solutions Looks like this might be a difference in how MariaDB reports it's version under Linux/apache vs Windows
I agree, it is most probably a difference in the MariaDB implementation between LINUX and WINDOWS (Apache webserver itself is irrelevant here, especially as I am using Apache on windows as well).
Actually, if the above named function would get the version by querying the database
select VERSION()
it would return the correct values from either MySQL or MariaDB (at least on a WINDOWS environment, but I am certain, that this would be correct in other environments as well).
Could that be implemented?
see #8291 (comment)
5.5.5-10.0.17-MariaDB
after all is the correct answer from the "mysqli" pardon "mariadb" driver
maybe some 3dp extensions can use some test on
5.5.5
surely you can use select VERSION()
for mysql land, but not so sure it works on MSSQL for example
I am not fully convinced that "5.5.5" IS CORRECT.
MariaDB announces itself as "10.0.23-MariaDB" on LINUX systems (as photodude states above), why should this be different on WINDOWS systems?
In fact I belief the issue is more in the PHP mysqli_get_server_info() function, which seems to deliver different values for MariaDB versions on LINUX and WINDOWS systems. I will submit a respective topic on the PHP.net site...
And as we are defenitly talking about the mysqli driver ("libraries/joomla/database/driver/mysqli.php"), the MSSQL argument is not applicable
@schultz-it-solutions I think you need to dig into why MariaDB prefixes the version on your system.
everything I'm seeing says this is a MariaDB prefix setting.
I would also argue after looking at things, 5.5.5-10.0.17-MariaDB
is more correct than 10.0.17-MariaDB
since the prefix appears to be the related MySQL query version which a 3rd party component or Joomla might be checking against.
Do note: although MariaDB is a MySQL compatible variant server (typically a drop in replacement for MySQL) it is not actually supported by Joomla even though it is possible to run Joomla on MariaDB
https://www.joomla.org/about-joomla/technical-requirements.html
@photodude: as you mentioned in your first post, you receive "Database Version 10.0.23-MariaDB" on a LINUX system, so the argument that "5.5.5-10.0.17-MariaDB is more correct than 10.0.17-MariaDB" does not really apply here.
However I agree that MariaDB is the source of this behaviour (I also created an issue on MariaDB discussionforum https://mariadb.atlassian.net/browse/MDEV-9565
Let me explain the issue from the MariaDB side.
MySQL replication slave code decides what the master can do (binlog format, etc) by looking at the first character of the version as sent in the handshake packet. When MariaDB went 10.0, MySQL slaves started to think it's version 1, and refused to replicate from it.
As a workaround we've implemented this version prefix. MariaDB sends an impossible combination in the handshake packet — the version "5.5.5" and "support authentication plugins" in the capability field. The MariaDB client library detects that and transparently removes the fake version prefix.
Of course if you link with not mariadb-aware client library, the prefix will be not removed, and you'll see it in the application.
SQL function VERSION()
always shows the true version without a prefix.
Thank you vuvova for this clarification.
This brings me back to my initial comment, where I suggested to replace the mysqli driver function "mysqli_get_server_info" with an SQL query "select version()" in the libraries/joomla/database/driver/mysqli.php script.
As background information about why this is important to me: I am developer of a joomla component, and in the backend I am providing a direct link to the SQL manual respective to the users database driver and version. With the "5.5.5-" prefix for MariaDB on windows, this functionality is broken. Of course I could implement a patch to fix this in my component, but from a general point of view my component (named jDBexport) is "the last in the line", so I'd prefer a more global solution to this issue.
I used Joomla 3.4.8 and MariaDB Cluster on AWS. Database versions will show like this.
yes, we already seem to have verified that on LINUX systems, the mysqli_get_server_info() method returns the correct value. This is not the case for WINDOWS systems (running apache and MariaDB).
I will reiterate my belief that this is a MariaDB issue and is specific to the MariaDB server settings.
See related MariaDB issue MySQL client doesn't strip off 5.5.5- prefix while connecting to 10.x server
As stated in the issue MariaDB issue "There was a small patch for 5.1+ that was supposed to allow 5.x clients to strip off 5.5.5- hack from the 10.x server version."
So either the version your running doesn't have the fix, their fix didn't fix the issue, or the your server settings are not set to strip off 5.5.5- hack from the reported version.
Status | New | ⇒ | Confirmed |
Closed for the reason stated above
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 10:33:32 |
Closed_By | ⇒ | brianteeman |
I cannot confirm this issue for Joomla 3.4.8
For one of my systems,
Database Version 10.0.23-MariaDB
That matches what you identified as the expected result.