DBAL-62: Length of a string column cannot exceed 255 #1835

Closed
doctrinebot opened this Issue Nov 16, 2010 · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user gordonslondon:

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)".

@doctrinebot

Comment created by jhartikainen:

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.

@doctrinebot

Comment created by @beberlei:

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.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@beberlei beberlei was assigned by doctrinebot Dec 7, 2015
@doctrinebot doctrinebot added this to the 2.0-RC4 milestone Dec 7, 2015
@doctrinebot doctrinebot closed this Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment