[DBAL-62] Length of a string column cannot exceed 255 Created: 16/Nov/10  Updated: 27/Nov/10  Resolved: 27/Nov/10

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.0.0-RC1-RC3
Fix Version/s: 2.0-RC4

Type: Bug Priority: Major
Reporter: jules b Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


DBAL-69 Varchar definition should automatical... Sub-task Resolved Benjamin Eberlei  


I use the annotation mapping:
here's my mapping informations:

* @var mixed optionValue
* @orm:Column(nullable="true", name="option_value", length="2000", type="string") 
protected $optionValue;

when i check the mysql column type it's still "varchar(255)".

Comment by Jani Hartikainen [ 26/Nov/10 ]

Confirmed on OS X 10.6, PHP 5.3.2, MySQL 5.1.51, DBAL RC3. Schema-tool always generates a VARCHAR(255) column for cases like this. 1.x used to generate TEXT, which I would assume is the correct behavior with MySQL in this case.

Comment by Benjamin Eberlei [ 27/Nov/10 ]

Fixed, the max length of varchars was set to 255.

However this is rather the default value. The maximum value is now 4000, which is the smallest common denominator between all supported vendors (Oracle is that).

In the future we would probably allow arbitrary large sizes here and switch to a CLOB definition automatically if the specifed string length is larger than max length.

Generated at Thu Nov 26 00:12:14 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.