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

Viper007Bond viper at viper007bond.com
Wed Mar 12 09:57:50 GMT 2008


Ah, thanks for the clarification! :)

On Tue, Mar 11, 2008 at 6:18 PM, 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
>



-- 
Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/


More information about the wp-hackers mailing list