[DBAL-293] mysql platform can not choose text type column Created: 20/Jun/12  Updated: 30/Dec/13  Resolved: 30/Dec/13

Status: Resolved
Project: Doctrine DBAL
Component/s: Platforms
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Kiichi Kajiura Assignee: Benjamin Eberlei
Resolution: Cannot Reproduce Votes: 0
Labels: None


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

Comment by Benjamin Eberlei [ 05/Jul/12 ]

How do you call the schema/platform code?

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

Comment by Kiichi Kajiura [ 19/Jul/12 ]

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

Comment by Steve Müller [ 28/Dec/13 ]

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.

Comment by Benjamin Eberlei [ 30/Dec/13 ]

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

Generated at Mon Nov 30 12:23:46 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.