Commit b4099e45 authored by zYne's avatar zYne

varchar max length fix

parent 81a8f3d5
......@@ -96,7 +96,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
'escape' => false,
'escape_pattern' => false
),
'wildcards' => array('%', '_')
'wildcards' => array('%', '_'),
'varchar_max_length' => 255,
);
/**
* @var array $serverInfo
......
......@@ -152,10 +152,10 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
}
}
$length = ($field['length'] < $this->conn->varchar_max_length) ? $field['length'] : false;
$length = ($field['length'] <= $this->conn->varchar_max_length) ? $field['length'] : false;
$fixed = (isset($field['fixed'])) ? $field['fixed'] : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)')
return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(255)')
: ($length ? 'VARCHAR(' . $length . ')' : 'TEXT');
case 'clob':
if (!empty($field['length'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment