$problem = false;
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
- $size = $generator->guess_antolope_row_size($columns);
+ $size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
- $size = $generator->guess_antolope_row_size($columns);
+ $size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
- $size = $generator->guess_antolope_row_size($columns);
+ $size = $generator->guess_antelope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
* Note: the returned value is a bit higher to compensate for
* errors and changes of column data types.
*
+ * @deprecated since Moodle 2.9 MDL-49723 - please do not use this function any more.
* @param xmldb_field[]|database_column_info[] $columns
* @return int approximate row size in bytes
*/
public function guess_antolope_row_size(array $columns) {
+ debugging('guess_antolope_row_size() is deprecated, please use guess_antelope_row_size() instead.', DEBUG_DEVELOPER);
+ return $this->guess_antelope_row_size($columns);
+ }
+
+ /**
+ * Calculate proximate row size when using InnoDB tables in Antelope row format.
+ *
+ * Note: the returned value is a bit higher to compensate for errors and changes of column data types.
+ *
+ * @param xmldb_field[]|database_column_info[] $columns
+ * @return int approximate row size in bytes
+ */
+ public function guess_antelope_row_size(array $columns) {
+
if (empty($columns)) {
return 0;
}
// Do we need to use compressed format for rows?
$rowformat = "";
- $size = $this->guess_antolope_row_size($xmldb_table->getFields());
+ $size = $this->guess_antelope_row_size($xmldb_table->getFields());
if ($size > self::ANTELOPE_MAX_ROW_SIZE) {
if ($this->mdb->is_compressed_row_format_supported()) {
$rowformat = "\n ROW_FORMAT=Compressed";
if ($this->table_exists($xmldb_table)) {
$tablename = $xmldb_table->getName();
- $size = $this->guess_antolope_row_size($this->mdb->get_columns($tablename));
- $size += $this->guess_antolope_row_size(array($xmldb_field));
+ $size = $this->guess_antelope_row_size($this->mdb->get_columns($tablename));
+ $size += $this->guess_antelope_row_size(array($xmldb_field));
if ($size > self::ANTELOPE_MAX_ROW_SIZE) {
if ($this->mdb->is_compressed_row_format_supported()) {