Syntax
INT2IP(int_value)
Purpose
You can call this function to convert the integer int_value into an IP address.
For example, the integer s is converted into the IP address s4.s3.s2.s1 based on the following rules:
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 entered value is NULL or greater than 4294967295, 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 (0.01 sec)