Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-293

mysql platform can not choose text type column

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Platforms
    • Labels:
      None

      Description

      getVarcharMaxLength() in DBAL/Platforms/MySqlPlatform.php returns 65535;
      So, it never choose "text", choose "mediumtext".

        Activity

        Kiichi Kajiura created issue -
        Hide
        Benjamin Eberlei added a comment -

        How do you call the schema/platform code?

        The code is correct, i think you are using it wrong.

        Show
        Benjamin Eberlei added a comment - How do you call the schema/platform code? The code is correct, i think you are using it wrong.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13790 ] jira-feedback2 [ 17614 ]
        Alexander made changes -
        Status Open [ 1 ] Awaiting Testcase/Feedback [ 10000 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17614 ] jira-feedback3 [ 19972 ]
        Hide
        Kiichi Kajiura added a comment -

        I don't use it directly.
        I use it in my entity class file with annotations.
        e.g.
        @Mapping\Column(type="text")
        @Mapping\Column(type="text", length=65535)

        Show
        Kiichi Kajiura added a comment - I don't use it directly. I use it in my entity class file with annotations. e.g. @Mapping\Column(type="text") @Mapping\Column(type="text", length=65535)
        made changes -
        Status Awaiting Feedback [ 10000 ] In Progress [ 3 ]
        Hide
        Steve Müller added a comment -

        Kiichi Kajiura TextType columns generate their SQL through AbstractPlatform::getClobTypeDeclarationSQL().
        See: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/TextType.php#L36

        The implementation of this method in MySqlPlatform DOES evaluate the length option of a column and switches to the appropriate type on the fly.
        See: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L274-L293

        So the implementation in DBAL is correct. AFAIK the column mapping information from ORM are also passed correctly to DBAL. I cannot reproduce this error. Can you please try it again with the current master branches of ORM and DBAL and see if the problem still exists? Otherwise I would like to close this ticket. Thank you.

        Show
        Steve Müller added a comment - Kiichi Kajiura TextType columns generate their SQL through AbstractPlatform::getClobTypeDeclarationSQL(). See: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/TextType.php#L36 The implementation of this method in MySqlPlatform DOES evaluate the length option of a column and switches to the appropriate type on the fly. See: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L274-L293 So the implementation in DBAL is correct. AFAIK the column mapping information from ORM are also passed correctly to DBAL. I cannot reproduce this error. Can you please try it again with the current master branches of ORM and DBAL and see if the problem still exists? Otherwise I would like to close this ticket. Thank you.
        Hide
        Benjamin Eberlei added a comment -

        This is not an issue, the code is clear about usage with "text" and length and not related to varchar max length.

        Show
        Benjamin Eberlei added a comment - This is not an issue, the code is clear about usage with "text" and length and not related to varchar max length.
        Benjamin Eberlei made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]

        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-293, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Kiichi Kajiura
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: