[wp-hackers] BIGINT(20) ... was: Is there a limit to the number of sub categories?

Dan Larkin nitephire at gmail.com
Wed Mar 12 03:05:07 GMT 2008


Whoops, I contradicted myself there on the padding with zeros/spaces.  I
meant spaces, which is correct.  And also I heed the correction that it
allows 2^64 values, or 0 to 2^64 - 1 which is equivalent to 0 to
18446744073709551615.  :)

:: Dan Larkin

On 3/11/08, Eric Marden <wp at xentek.net> wrote:
>
> >> 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
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list