Commit 1da878f8 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1752688: Need to check what flavour of mysql is being used"

parents 6fa7a9ee ca22b51f
......@@ -5171,7 +5171,7 @@ function xmldb_core_upgrade($oldversion=0) {
log_debug('Adjust existing "event_log" data to fit new table structure');
$db_version = get_db_version();
if (is_mysql() && version_compare($db_version, '5.7.8', '>=')) {
if (is_mysql() && mysql_get_type() == 'mysql' && version_compare($db_version, '5.7.8', '>=')) {
// Update the event_log table using the json datatype
// by converting the data field to json.
// This datatype was introduced in Mysql 5.7.8.
......
......@@ -1562,6 +1562,22 @@ function is_mysql() {
return (strpos(get_config('dbtype'), 'mysql') === 0);
}
function mysql_get_type() {
if (!is_mysql()) {
throw new SQLException('mysql_get_type() expects a mysql database');
}
$mysqltype = mysql_get_variable('version_comment');
if (stripos($mysqltype, 'MariaDB') !== false) {
return 'mariadb';
}
else if (stripos($mysqltype, 'Percona') !== false) {
return 'percona';
}
else {
return 'mysql';
}
}
/**
* function to convert an array to
* an array of placeholders (?)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment