]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18547 mysql floats - only none/both params (length & decimals) syntax is
authorstronk7 <stronk7>
Mon, 11 May 2009 15:11:23 +0000 (15:11 +0000)
committerstronk7 <stronk7>
Mon, 11 May 2009 15:11:23 +0000 (15:11 +0000)
allowed. So, if decimals are missing, enforce 0 if length is defined. Merged
from 19_STABLE

lib/ddl/mysql_sql_generator.php

index a2a012b538a3cc09eac3c8474ad51972aa740bf1..e0197724a7711eedfd4f1276d5f27fdd9262abcb 100644 (file)
@@ -211,6 +211,8 @@ class mysql_sql_generator extends sql_generator {
                     $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 .= ')';
                 }