mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-61702 dml: MariaDB 10.3 supports only the Barracuda file format.
More details about this change also in https://tracker.moodle.org/browse/MDL-59099 Ref.: https://mariadb.com/kb/en/library/mariadb-1031-release-notes/#other-variables
This commit is contained in:
parent
5b4ca9eb5b
commit
82c2d98fa2
@ -293,6 +293,29 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
return $collation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the Antelope file format is still supported or it has been removed.
|
||||
* When removed, only Barracuda file format is supported, given the XtraDB/InnoDB engine.
|
||||
*
|
||||
* @return bool True if the Antelope file format has been removed; otherwise, false.
|
||||
*/
|
||||
protected function is_antelope_file_format_no_more_supported() {
|
||||
// Breaking change: Antelope file format support has been removed from both MySQL and MariaDB.
|
||||
// The following InnoDB file format configuration parameters were deprecated and then removed:
|
||||
// - innodb_file_format
|
||||
// - innodb_file_format_check
|
||||
// - innodb_file_format_max
|
||||
// - innodb_large_prefix
|
||||
// 1. MySQL: deprecated in 5.7.7 and removed 8.0.0+.
|
||||
$ismysqlge8d0d0 = ($this->get_dbtype() == 'mysqli') &&
|
||||
version_compare($this->get_server_info()['version'], '8.0.0', '>=');
|
||||
// 2. MariaDB: deprecated in 10.2.0 and removed 10.3.1+.
|
||||
$ismariadbge10d3d1 = ($this->get_dbtype() == 'mariadb') &&
|
||||
version_compare($this->get_server_info()['version'], '10.3.1', '>=');
|
||||
|
||||
return $ismysqlge8d0d0 || $ismariadbge10d3d1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the row format from the database schema.
|
||||
*
|
||||
@ -307,9 +330,8 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema = DATABASE() AND table_name = '{$this->prefix}$table'";
|
||||
} else {
|
||||
if (($this->get_dbtype() == 'mysqli') &&
|
||||
// Breaking change in MySQL 8.0.0+: antelope file format support has been removed.
|
||||
version_compare($this->get_server_info()['version'], '8.0.0', '>=')) {
|
||||
if ($this->is_antelope_file_format_no_more_supported()) {
|
||||
// Breaking change: Antelope file format support has been removed, only Barracuda.
|
||||
$dbengine = $this->get_dbengine();
|
||||
$supporteddbengines = array('InnoDB', 'XtraDB');
|
||||
if (in_array($dbengine, $supporteddbengines)) {
|
||||
@ -396,9 +418,8 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
* @return bool True if on otherwise false.
|
||||
*/
|
||||
public function is_large_prefix_enabled() {
|
||||
if (($this->get_dbtype() == 'mysqli') &&
|
||||
// Breaking change since 8.0.0: there is only one file format and 'innodb_large_prefix' has been removed.
|
||||
version_compare($this->get_server_info()['version'], '8.0.0', '>=')) {
|
||||
if ($this->is_antelope_file_format_no_more_supported()) {
|
||||
// Breaking change: Antelope file format support has been removed, only Barracuda.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user