MDL-18547 mysql floats - only none/both params (length & decimals) syntax is

allowed. So, if decimals are missing, enforce 0 if length is defined.
This commit is contained in:
stronk7
2009-05-11 15:04:30 +00:00
parent abf58c0272
commit 0a5bf56672
@@ -125,6 +125,8 @@ class XMLDBmysql extends XMLDBGenerator {
$dbtype .= '(' . $xmldb_length;
if (!empty($xmldb_decimals)) {
$dbtype .= ',' . $xmldb_decimals;
} else {
$dbtype .= ', 0'; // In MySQL, if length is specified, decimals are mandatory for FLOATs
}
$dbtype .= ')';
}