From: skodak Date: Sat, 25 Oct 2008 18:31:40 +0000 (+0000) Subject: MDL-14679 dml/native_mysqli fixed decimal columns - unittests now complete without... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c65845cca112c5a7aaeb9f1f5c31bd503d5f402b;p=moodle.git MDL-14679 dml/native_mysqli fixed decimal columns - unittests now complete without errors! --- diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 3bd8337120..d7df9e6e7c 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -236,11 +236,11 @@ class mysqli_native_moodle_database extends moodle_database { $info->unique = null; } - } else if (preg_match('/decimal\((\d+),(\d+)\)/i', $rawcolumn->type, $matches)) { - $info->type = 'decimal'; + } else if (preg_match('/(decimal|double|float)\((\d+),(\d+)\)/i', $rawcolumn->type, $matches)) { + $info->type = $matches[1]; $info->meta_type = 'N'; - $info->max_length = $matches[1]; - $info->scale = $matches[2]; + $info->max_length = $matches[2]; + $info->scale = $matches[3]; $info->not_null = ($rawcolumn->null === 'NO'); $info->default_value = $rawcolumn->default; $info->has_default = is_null($info->default_value) ? false : true;