Syntax
IS_IPV4(expr)
Purpose
Returns 1 if the expr parameter is a valid IPv4 address string, and 0 otherwise.
For a specified parameter, if IS_IPV4() returns 1, then INET_ATON() and INET6_ATON() return a non-NULL value. Conversely, this is not always true. In some cases, INET_ATON() may return a non-NULL value even when IS_IPV4() returns 0. IS_IPV4() has stricter requirements for IPv4 addresses than INET_ATON(), and INET6_ATON() is as effective as IS_IPV4() in checking IPv4 addresses.
Examples
obclient> SELECT IS_IPV4('10.x.x.9'), IS_IPV4('10.x.x.256');
+---------------------+-----------------------+
| IS_IPV4('10.x.x.9') | IS_IPV4('10.x.x.256') |
+---------------------+-----------------------+
| 1 | 0 |
+---------------------+-----------------------+
1 row in set
