It would be my guess that you're trying to store inet_aton()'s value
into a signed integer column, which is in the range of roughly -2G - 2G-1,
while inet_aton()'s result is unsigned, in the range 0 - 4G-1.  Whenever
inet_aton() happens to return a value > 2G-1, MySQL truncates it and stores
into your table the largest value possible for the column type you specified.

ALTER TABLE sequoia MODIFY ip INTEGER UNSIGNED <whatever else you want>;

G'luck,
Peter

-- 
What would this sentence be like if pi were 3?

On Tue, Mar 20, 2001 at 02:09:48PM -0800, Jason Bell wrote:
> ok... this is stumping me.... perhaps I'm doing something wring, but It
> doesn't appear that I am....
> 
> Am I doing, or not doing something that makes the INET_ATON function
> default to 127.255.255.255 ? why does it work for 24.18.10.5, but not
> 192.168.50.5 when inserting into a table?
> 
> 
> 
> mysql> SELECT INET_ATON("24.18.10.5");
> +-------------------------+
> | INET_ATON("24.18.10.5") |
> +-------------------------+
> |               403835397 |
> +-------------------------+
> 1 row in set (0.01 sec)
> 
> mysql> SELECT INET_ATON("192.168.50.5");
> +---------------------------+
> | INET_ATON("192.168.50.5") |
> +---------------------------+
> |                3232248325 |
> +---------------------------+
> 1 row in set (0.01 sec)
> 
> mysql> insert into sequoia VALUES ( INET_ATON("24.18.10.5"), 'TestHost',
> 'This is a test', 'Test' );
> Query OK, 1 row affected (0.03 sec)
> 
> mysql> insert into sequoia VALUES ( INET_ATON("192.168.50.5"),
> 'TestHost2', 'This is a test', 'Test' );
> Query OK, 1 row affected (0.01 sec)
> 
> mysql> select * from sequoia;
> +------------+-----------+----------------+----------+
> | ip         | hostname  | comment        | customer |
> +------------+-----------+----------------+----------+
> |  403835397 | TestHost  | This is a test | Test     |
> | 2147483647 | TestHost2 | This is a test | Test     |
> +------------+-----------+----------------+----------+
> 2 rows in set (0.01 sec)
> 
> mysql> select INET_NTOA(ip),hostname from sequoia;
> +-----------------+-----------+
> | INET_NTOA(ip)   | hostname  |
> +-----------------+-----------+
> | 24.18.10.5      | TestHost  |
> | 127.255.255.255 | TestHost2 |
> +-----------------+-----------+
> 2 rows in set (0.01 sec)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to