MariaDB IS_IPV6()関数 IPV6アドレスかを判定するサンプル

環境
MariaDB 10.10.2

構文
IS_IPV6()
ipV6アドレスであるかを判定するには、「IS_IPV6()」を使用します。
IPV6アドレスであれば「1」を、そうでなければ「0」が返ります。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SELECT
IS_IPV6('::1'),
IS_IPV6('2001:0db8:1234:5678:90ab:cdef:0000:0000'),
IS_IPV6('192.168.11.1'),
IS_IPV6('aaa'),
IS_IPV6(0)
SELECT IS_IPV6('::1'), IS_IPV6('2001:0db8:1234:5678:90ab:cdef:0000:0000'), IS_IPV6('192.168.11.1'), IS_IPV6('aaa'), IS_IPV6(0)
SELECT 
IS_IPV6('::1'),
IS_IPV6('2001:0db8:1234:5678:90ab:cdef:0000:0000'),
IS_IPV6('192.168.11.1'),
IS_IPV6('aaa'),
IS_IPV6(0)

 

IT

Posted by arkgame