]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 dml/native_mysqli fixed decimal columns - unittests now complete without...
authorskodak <skodak>
Sat, 25 Oct 2008 18:31:40 +0000 (18:31 +0000)
committerskodak <skodak>
Sat, 25 Oct 2008 18:31:40 +0000 (18:31 +0000)
lib/dml/mysqli_native_moodle_database.php

index 3bd833712064ded554247217398470d02b4033d3..d7df9e6e7cdaf329a645c1dca12dd2e648373390 100644 (file)
@@ -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;