mirror of
https://github.com/moodle/moodle.git
synced 2025-06-03 14:46:35 +02:00
MDL-32113 xmldb: Remove hard-coded exceptions for long number fields
We are going to unify the maximum supported precision of all numeric fields to 38 digits (which are the current Oracle and MSSQL limits). Get rid of hard-coded exceptions for longer fields.
This commit is contained in:
parent
3cdb015828
commit
457eaef9ec
@ -194,10 +194,6 @@ class mssql_sql_generator extends sql_generator {
|
||||
case XMLDB_TYPE_NUMBER:
|
||||
$dbtype = $this->number_type;
|
||||
if (!empty($xmldb_length)) {
|
||||
// 38 is the max allowed
|
||||
if ($xmldb_length > 38) {
|
||||
$xmldb_length = 38;
|
||||
}
|
||||
$dbtype .= '(' . $xmldb_length;
|
||||
if (!empty($xmldb_decimals)) {
|
||||
$dbtype .= ',' . $xmldb_decimals;
|
||||
|
@ -181,10 +181,6 @@ class oracle_sql_generator extends sql_generator {
|
||||
case XMLDB_TYPE_FLOAT:
|
||||
case XMLDB_TYPE_NUMBER:
|
||||
$dbtype = $this->number_type;
|
||||
// 38 is the max allowed
|
||||
if ($xmldb_length > 38) {
|
||||
$xmldb_length = 38;
|
||||
}
|
||||
if (!empty($xmldb_length)) {
|
||||
$dbtype .= '(' . $xmldb_length;
|
||||
if (!empty($xmldb_decimals)) {
|
||||
|
@ -786,10 +786,6 @@ class xmldb_field extends xmldb_object {
|
||||
|
||||
case XMLDB_TYPE_NUMBER:
|
||||
$maxlength = self::NUMBER_MAX_LENGTH;
|
||||
if ($xmldb_table->getName() === 'question_numerical_units' and $name === 'multiplier') {
|
||||
//TODO: remove after MDL-32113 is resolved
|
||||
$maxlength = 40;
|
||||
}
|
||||
$length = $this->getLength();
|
||||
if (!is_number($length) or $length <= 0 or $length > $maxlength) {
|
||||
return 'Invalid field definition in table {'.$xmldb_table->getName().'}: XMLDB_TYPE_NUMBER field "'.$this->getName().'" has invalid length';
|
||||
|
Loading…
x
Reference in New Issue
Block a user