Skip to content

Commit

Permalink
MDL-59099 dml: MySQL8 supports only the Barracuda file format.
Browse files Browse the repository at this point in the history
The following InnoDB file format configuration parameters were deprecated
in MySQL 5.7.7 and are now removed:
- innodb_file_format
- innodb_file_format_check
- innodb_file_format_max
- innodb_large_prefix

File format configuration parameters were necessary for creating tables
compatible with earlier versions of InnoDB in MySQL 5.1.
Now that MySQL 5.1 has reached the end of its product lifecycle,
the parameters are no longer required.

The FILE_FORMAT column was removed from the INNODB_SYS_TABLES and
INNODB_SYS_TABLESPACES Information Schema tables.

Ref: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-0.html
  • Loading branch information
scara committed Oct 27, 2017
1 parent 40f1801 commit 740a931
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/dml/mysqli_native_moodle_database.php
Expand Up @@ -307,6 +307,18 @@ public function get_row_format($table = null) {
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', '>=')) {
$dbengine = $this->get_dbengine();
$supporteddbengines = array('InnoDB', 'XtraDB');
if (in_array($dbengine, $supporteddbengines)) {
$rowformat = 'Barracuda';
}

return $rowformat;
}

$sql = "SHOW VARIABLES LIKE 'innodb_file_format'";
}
$this->query_start($sql, NULL, SQL_QUERY_AUX);
Expand Down Expand Up @@ -384,6 +396,12 @@ public function is_file_per_table_enabled() {
* @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', '>=')) {
return true;
}

if ($largeprefix = $this->get_record_sql("SHOW VARIABLES LIKE 'innodb_large_prefix'")) {
if ($largeprefix->value == 'ON') {
return true;
Expand Down

0 comments on commit 740a931

Please sign in to comment.