install Joomla 3.10 on a maria db system (for example latest xampp that can be found here: https://www.apachefriends.org/download.html)
check the System -> System Information
10.4.6-MariaDB (well atleast this is the actuall version shipped with xampp)
5.5.5-10.4.6-MariaDB
xampp 7.3.8
I'm aware of that this line here https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/mysqli.php#L518 correctly returns the 5.5.5-10.4.6-MariaDB
version number.
But this fails the supported_databases
checks implement here:
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Updater/Adapter/ExtensionAdapter.php#L160-L189
We have different possible workarounds of this problem but I would like to hear your feedback first. Here is a, not complete, collection on how we could possibly deal with that issue in the updater class. But I'm open to any other suggestions too.
$dbType = strtoupper($db->getServerType());
$dbVersion = $db->getVersion();
if ($dbType === 'MYSQL' &&
strpos(strtolower($dbVersion), 'mariadb')
&& strpos(strtolower($dbVersion), '5.5.5-') === 0)
{
// Lets remove the 5.5.5- from the version number so we have the real maria db version number.
$dbVersion = substr($dbVersion , 6);
}
Anonther workaroud could be to ship a dedicated tag from the xml.
<supported_databases mysql="5.6" mariadb="10.4" postgresql="11.0" />
and an conditional
$dbType = strtoupper($db->getServerType());
$dbVersion = $db->getVersion();
if ($dbType === 'MYSQL'
&& strpos(strtolower($dbVersion), 'mariadb')
&& strpos(strtolower($dbVersion), '5.5.5-') === 0)
{
// Lets remove the 5.5.5- from the version number so we have the real maria db version number.
$dbVersion = substr($dbVersion , 6);
$dbType = 'MARIADB';
}
other way around could be
<supported_databases mysql="5.6" mariadb="5.5.5-10.4" postgresql="11.0" />
$dbType = strtoupper($db->getServerType());
$dbVersion = $db->getVersion();
if ($dbType === 'MYSQL'
&& strpos(strtolower($dbVersion), 'mariadb')
&& strpos(strtolower($dbVersion), '5.5.5-') === 0)
{
$dbType = 'MARIADB';
}
Labels |
Added:
?
?
|
Ok looks great.
// Check if we have a MariaDB version string and extract the proper version from it
if (preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i', $data['db_version'], $versionParts))
{
$data['db_version'] = $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch'];
}
So what would be you suggestion just throw that new version string against the mysql option from the xml or create a new mariadb dedicated one?
Should we offer that regexed version also from the database layer so we don't need to reinvent the wheel at all places where we need to use the actual version number like the updater or the stats plugin in that case?
No the database API should not be filtering the client version string.
Systems that rely on MariaDB specific checks should do it locally.
Changing that behavior will break B/C in a painful way.
And yes, there would need to be a separate attribute for the MariaDB min
version.
On Thu, Aug 29, 2019 at 6:42 PM zero-24 notifications@github.com wrote:
Ok looks great.
// Check if we have a MariaDB version string and extract the proper version from it if (preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i', $data['db_version'], $versionParts)) { $data['db_version'] = $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch']; }
So what would be you suggestion just throw that new version string against
the mysql option from the xml or create a new mariadb dedicated one?Should we offer that regexed version also from the database layer so we
don't need to reinvent the wheel at all places where we need to use the
actual version number like the updater or the stats plugin in that case?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/joomla/joomla-cms/issues/26078?email_source=notifications&email_token=AACZ7INCURFPJMXHYXNOVDTQHBNHVA5CNFSM4ISHW5PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QDX2Q#issuecomment-526400490,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACZ7IMKLGL65Q6G3HXCJSTQHBNHVANCNFSM4ISHW5PA
.
--
ok thanks for your feedback
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-08-30 01:30:05 |
Closed_By | ⇒ | zero-24 |
Please don’t rely on substr, there is an adequate check in the stats plugin if you feel it necessary to post-process the version strong that can be re-used (which comes from a OSS platform with much greater visibility than Joomla).