diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 11f9c8f09..33b44c558 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -112,6 +112,7 @@ class Mysql extends DboSource { 'biginteger' => array('name' => 'bigint', 'limit' => '20'), 'integer' => array('name' => 'int', 'limit' => '11', 'formatter' => 'intval'), 'float' => array('name' => 'float', 'formatter' => 'floatval'), + 'numeric' => array('name' => 'decimal', 'formatter' => 'floatval'), 'decimal' => array('name' => 'decimal', 'formatter' => 'floatval'), 'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'), 'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'), @@ -767,7 +768,7 @@ class Mysql extends DboSource { if (strpos($col, 'float') !== false || strpos($col, 'double') !== false) { return 'float'; } - if (strpos($col, 'decimal') !== false) { + if (strpos($col, 'decimal') !== false || strpos($col, 'numeric') !== false) { return 'decimal'; } if (strpos($col, 'enum') !== false) { diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index a42f2b78f..c1a382490 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -547,6 +547,10 @@ class MysqlTest extends CakeTestCase { $expected = 'decimal'; $this->assertEquals($expected, $result); + $result = $this->Dbo->column('numeric'); + $expected = 'decimal'; + $this->assertEquals($expected, $result); + $result = $this->Dbo->column('decimal(14,7) unsigned'); $expected = 'decimal'; $this->assertEquals($expected, $result);