#572 ✓not-applicable

Integer in Mysql is wrong defined

Reported by Jonas | September 25th, 2008 @ 10:53 AM

In MySQL [1], the Integer type has been defined with a display width of 11:

tm.map(Integer).to('INT').with(:size => 11)

And since that range of MySQL INT is of 4 bytes it has any sense. Read under table here [2].

So it should be changed to:


[1] http://github.com/sam/dm-core/tr...

[2] http://dev.mysql.com/doc/refman/...

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) December 5th, 2008 @ 04:40 AM

    • Tag changed from dm-core, mysql, types to dm-core, mysql, types
    • State changed from “new” to “not-applicable”
    • Assigned user cleared.

    The existing code is correct. In MySQL when you create an INT you generally specify it as INT(11), unless you want a smaller display size, but the default is 11. The :size parameter in DM refers to the maximum display length, not necessarily the number of bytes that it takes to store in the database.

    Please note that MySQL doesn't actually change the number of bytes it takes to store an INT when you specify the display width. INT(1) and INT(11) will take up the same amount of space underneath.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket