diff --git a/admin/xmldb/actions/check_bigints/check_bigints.class.php b/admin/xmldb/actions/check_bigints/check_bigints.class.php index c908fabf469..676282c81cc 100644 --- a/admin/xmldb/actions/check_bigints/check_bigints.class.php +++ b/admin/xmldb/actions/check_bigints/check_bigints.class.php @@ -26,7 +26,8 @@ /// This class will check all the int(10) fields existing in the DB /// reporting about the ones not phisically implemented as BIGINTs -/// and providing one SQL script to fix all them. MDL-11038 +/// and providing one SQL script to fix all them. Also, under MySQL, +/// it performs one check of signed bigints. MDL-11038 class check_bigints extends XMLDBAction { @@ -52,6 +53,7 @@ class check_bigints extends XMLDBAction { 'completelogbelow' => 'xmldb', 'nowrongintsfound' => 'xmldb', 'yeswrongintsfound' => 'xmldb', + 'mysqlextracheckbigints' => 'xmldb', 'yes' => '', 'no' => '', 'error' => '', @@ -104,6 +106,9 @@ class check_bigints extends XMLDBAction { $o = ''; $o.= '
'; $o.= '

' . $this->str['confirmcheckbigints'] . '

'; + if ($CFG->dbfamily == 'mysql') { + $o.= '

' . $this->str['mysqlextracheckbigints'] . '

'; + } $o.= '
'; $o.= '
'; $o.= '
'; @@ -187,17 +192,16 @@ class check_bigints extends XMLDBAction { $metacolumn = $metacolumns[$xmldb_field->getName()]; /// Going to check this field in DB $o.='
  • ' . $this->str['field'] . ': ' . $xmldb_field->getName() . ' '; - /// Detect if the phisical field is wrong - if ($metacolumn->type == $correct_type) { - $o.='' . $this->str['ok'] . '
  • '; - continue; - } else { + /// Detect if the phisical field is wrong and, under mysql, check for incorrect signed fields too + if ($metacolumn->type != $correct_type || ($CFG->dbfamily == 'mysql' && $xmldb_field->getUnsigned() && !$metacolumn->unsigned)) { $o.='' . $this->str['wrong'] . ''; /// Add the wrong field to the list $obj = new object; $obj->table = $xmldb_table; $obj->field = $xmldb_field; $wrong_fields[] = $obj; + } else { + $o.='' . $this->str['ok'] . ''; } $o.=''; }