[wp-hackers] BIGINT(20) ... was: Is there a limit to the number
of sub categories?
Eric Marden
wp at xentek.net
Wed Mar 12 01:18:44 GMT 2008
>> It's a BIGINT with a 20 digit limit. ;)
>>
>
>
> The "BIGINT(20)" specification isn't a digit limit. It just means
> that when
> the data is displayed, if it uses less than 20 digits it will be
> left-padded
> with zeros. 2^64 is the hard limit for the BIGINT type, and has 20
> digits
> itself, hence BIGINT(20) just means everything less than 10^20 will be
> left-padded with spaces on display. This is kind of getting off topic
> though, so...
Not to keep riding a dead horse, but I wanted to chime in on this
quickly.
Here's the full column definition:
`term_id` bigint(20) NOT NULL auto_increment
The '20' is the maximum display width. However, this does NOT limit
the range of values that can be stored in this column, which for
bigint is: -9223372036854775808 to 9223372036854775807
If its unsigned (which this one is not), a bigint has this range: 0
to 18446744073709551615
If you specify zerofill as one of the options in the column
definition, values will be left-padded with zeros. Displaying the
value without zerofill will left-pad with spaces.
More info here:
http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
-e
More information about the wp-hackers
mailing list