Re: IP regex
Michael Stassen <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
The storage requirements for each column type are documented in the manual <http://dev.mysql.com/doc/mysql/en/Storage_requirements.html>, which confirms that INTs take 4 bytes. Michael Jamie McCarthy wrote: > [email protected] (Vladimir V. Kolpakov) writes: > >>On Sun, Oct 31, 2004 at 02:02:26PM -0500, Michael Stassen wrote: >> >>>Then you store an IP using INET_ATON(IP) and retrieve it with >>>INET_NTOA(ip_column). That takes 4 bytes instead of 8 to 16 >> >>It's very common mistake, -- to think integer occupies in >>databases 4 bytes. Please look DESC on your table, and you can >>find it takes 11 bytes, because is stored in character form. > > You misunderstand the output of DESCRIBE. INT is stored in 4 bytes. > The "(11)" is the display width, which doesn't really affect anything > done through the perl interface. -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected]