Declaration
INT2IP(int_value)
Description
Converts the integer int_value to an IP address.
Assuming the input value is s, the returned IP address s4.s3.s2.s1 is calculated as follows:
s1:smod 2^8^s2:s-s1/ 2^8^ mod 2^8^s3:((s-s1) / 2^8^ -s2)/ 2^8^ mod 2^8^s4:(((s-s1) / 2^8^ -s2)/ 2^8^ -s3)/ 2^8^ mod 2^8^
If the input is greater than 4294967295 or NULL, NULL is returned.
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