浏览代码

More edge case handlignfor native_type in mysql for older versions of
php

Jose Lorenzo Rodriguez 12 年之前
父节点
当前提交
489d1db7d1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/Cake/Model/Datasource/Database/Mysql.php

+ 1 - 1
lib/Cake/Model/Datasource/Database/Mysql.php

@@ -229,7 +229,7 @@ class Mysql extends DboSource {
 			if ($column['len'] === 1 && (empty($column['native_type']) || $column['native_type'] === 'TINY')) {
 				$type = 'boolean';
 			} else {
-				$type = $column['native_type'];
+				$type = empty($column['native_type']) ? 'string' : $column['native_type'];
 			}
 			if (!empty($column['table']) && strpos($column['name'], $this->virtualFieldSeparator) === false) {
 				$this->map[$index++] = array($column['table'], $column['name'], $type);