Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBAL-84: Long string fields are being silently changed to 255 characters in the schema #2075

Closed
doctrinebot opened this issue Jan 31, 2011 · 3 comments
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user extesy:

I have an entity like this:

 * @orm:Entity
 */
class Product
{
    /****
     * @orm:Id
     * @orm:Column(name="Merchant",type="string",length=50)
     */
    protected $merchant;

    /****
     * @orm:Column(name="Name",type="string",length=500)
     */
    protected $name;
}```

When I change the length of $name field to 4000 it updates the schema like it is supposed to:

`php.exe -f console doctrine:schema:update --dump-sql`
`ALTER TABLE product CHANGE Name Name VARCHAR(4000) NOT NULL`

But when I change the length to 5000 it just silently without any warning uses value 255 instead:

`php.exe -f console doctrine:schema:update --dump-sql`
{{ALTER TABLE product CHANGE Name Name VARCHAR({color:red}255{color}) NOT NULL}}

I had to look into actual table definition using mysql browser to find this issue because doctrine doesn't even warn about it. This could lead to some pretty serious bugs!
@doctrinebot
Copy link
Author

Comment created by @beberlei:

Fixed in master and 2.0.x

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@doctrinebot doctrinebot added this to the 2.0.2 milestone Dec 7, 2015
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants