Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-62

Length of a string column cannot exceed 255

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-RC1-RC3
    • Fix Version/s: 2.0-RC4
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mysql

      Description

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

        Activity

        jules b created issue -
        Hide
        Jani Hartikainen added a comment - - edited

        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.

        Show
        Jani Hartikainen added a comment - - edited 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.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Description 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)".
        I use the annotation mapping:
        here's my mapping informations:

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


        when i check the mysql column type it's still "varchar(255)".
        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0-RC4 [ 10111 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12106 ] jira-feedback2 [ 17672 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17672 ] jira-feedback3 [ 20027 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-62, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            jules b
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: