Syntax
INT2IP(int_value)
Purpose
Converts the integer int_value to an IP address.
Assume that the input value is s. The returned IP address s4.s3.s2.s1 is calculated as follows:
s1issmod 2^8^.s2is (s-s1) / 2^8^ mod 2^8^.s3is ((s-s1) / 2^8^ -s2) / 2^8^ mod 2^8^.s4is (((s-s1) / 2^8^ -s2) / 2^8^ -s3) / 2^8^ mod 2^8^.
If the input value is greater than 4294967295 or NULL, the function returns NULL.
Examples
obclient> SELECT
INT2IP(16777216),
HEX(16777216),
INT2IP(1)
\G
*************************** 1. row ***************************
INT2IP(16777216): 1.0.0.0
HEX(16777216): 1000000
INT2IP(1): 0.0.0.1
1 row in set
