From: stronk7 Date: Mon, 11 May 2009 15:11:23 +0000 (+0000) Subject: MDL-18547 mysql floats - only none/both params (length & decimals) syntax is X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d09af2e19fec8814f292c575803fb1d629c5d992;p=moodle.git MDL-18547 mysql floats - only none/both params (length & decimals) syntax is allowed. So, if decimals are missing, enforce 0 if length is defined. Merged from 19_STABLE --- diff --git a/lib/ddl/mysql_sql_generator.php b/lib/ddl/mysql_sql_generator.php index a2a012b538..e0197724a7 100644 --- a/lib/ddl/mysql_sql_generator.php +++ b/lib/ddl/mysql_sql_generator.php @@ -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 .= ')'; }