From c65845cca112c5a7aaeb9f1f5c31bd503d5f402b Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 25 Oct 2008 18:31:40 +0000 Subject: [PATCH] MDL-14679 dml/native_mysqli fixed decimal columns - unittests now complete without errors! --- lib/dml/mysqli_native_moodle_database.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.39.5