Skip to content

Loading…

DBAL-293: mysql platform can not choose text type column #1474

Closed
doctrinebot opened this Issue · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user shirokappa:

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

@doctrinebot

Comment created by @beberlei:

How do you call the schema/platform code?

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

@doctrinebot

Comment created by shirokappa:

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)

@doctrinebot

Comment created by @deeky666:

[~shirokappa] 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.

@doctrinebot

Comment created by @beberlei:

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

@doctrinebot

Issue was closed with resolution "Cannot Reproduce"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.