MySQL 8.x and INT values

MySQL 8 no longer supports INT lengths. INT(11) as a field type for a 'id' field for example now throws a "Value exceeds required length for 'id'" error message on saving.

./modules/fuel/core/MY_Model.php line 2410 includes:

if ($field_data['type'] != 'float' AND $field_data['type'] != 'double') $this->validator->add_rule($field, 'length_max', lang('error_value_exceeds_length', $field_name), array($value, $field_data['max_length']));

This is now redundant for MySQL8 hosts and should be removed

Comments

  • edited September 2020

    Does changing that line to the following fix the issue for you?

    if (!empty($field_data['max_length']) AND $field_data['type'] != 'float' AND $field_data['type'] != 'double') $this->validator->add_rule($field, 'length_max', lang('error_value_exceeds_length', $field_name), array($value, $field_data['max_length']));
    
  • Yes, it does seem to

  • I just pushed an update for that to the develop branch.

Sign In or Register to comment.