List:General Discussion« Previous MessageNext Message »
From:Mojtaba Faridzad Date:June 10 2003 5:53pm
Subject:Re: INT type
View as plain text  
Thanks Mike and Dan. The link explained everything. but why the manual which
had been installed on my computer ( by downloading and installing mysql 4.0)
is not as complete as the website? anyways, I will look into mysql online
document instead of the downloaded manual. Thanks again.

----- Original Message ----- 
From: "Mike Hillyer" <mhillyer@stripped>
To: "Mojtaba Faridzad" <faridzad@stripped>;
<mysql@stripped>
Sent: Tuesday, June 10, 2003 1:38 PM
Subject: RE: INT type


The 11 is the display width and does not affect the size of values that
can be stored in the column. Here is a quote from
http://www.mysql.com/doc/en/Numeric_types.html:

------BEGIN QUOTE------ 
As an extension to the ANSI/ISO SQL92 standard, MySQL also supports the
integer types TINYINT, MEDIUMINT, and BIGINT as listed in the tables
above. Another extension is supported by MySQL for optionally specifying
the display width of an integer value in parentheses following the base
keyword for the type (for example, INT(4)). This optional width
specification is used to left-pad the display of values whose width is
less than the width specified for the column, but does not constrain the
range of values that can be stored in the column, nor the number of
digits that will be displayed for values whose width exceeds that
specified for the column. When used in conjunction with the optional
extension attribute ZEROFILL, the default padding of spaces is replaced
with zeroes. For example, for a column declared as INT(5) ZEROFILL, a
value of 4 is retrieved as 00004. Note that if you store larger values
than the display width in an integer column, you may experience problems
when MySQL generates temporary tables for some complicated joins, as in
these cases MySQL trusts that the data did fit into the original column
width.
------END QUOTE------

Regards,
Mike Hillyer

-----Original Message-----
From: Mojtaba Faridzad [mailto:faridzad@stripped]
Sent: Tuesday, June 10, 2003 11:26 AM
To: mysql@stripped
Subject: INT type


Hi,

I defined a field as INT type but when I checked in phpMyAdmin, it
showed
INT(11). Still I cannot enter higher 2147483647 (signed int) in this
field.
Does 11 mean that MySQL needs 11 bytes to keep it?  I changed the length
to
2 (for example) but still I could save higher values such as 999 in
it!!!
What does length mean in INT(length)?

Thanks in advance


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1


Thread
Fw: 2 questions about indexing and testing speedMojtaba Faridzad9 Jun
  • arrangement of fields in a tableMojtaba Faridzad9 Jun
    • Re: arrangement of fields in a tableJeremy Zawodny9 Jun
    • Re: arrangement of fields in a tableNils Valentin10 Jun
  • Re: Fw: 2 questions about indexing and testing speedVictoria Reznichenko10 Jun
Re: Fw: 2 questions about indexing and testing speedrich johnson10 Jun
  • INT typeMojtaba Faridzad10 Jun
    • Re: INT typeDan Nelson10 Jun
RE: INT typeMike Hillyer10 Jun
  • Re: INT typeMojtaba Faridzad10 Jun
    • Re: INT typePaul DuBois10 Jun
    • Re: INT typeDan Nelson10 Jun