INET6_NTOA output is set as null to varchar(39) variable
This looks like a genuine bug. I get the expected result in MySQL 5.7.20 (see below), but it returns null in MariaDB 10.2.10. The issue should be reported in the MariaDB Jira.

mysql&gt; DELIMITER ;;
mysql&gt; CREATE PROCEDURE p() CONTAINS SQL BEGIN DECLARE ip_full_addr varchar(39) DEFAULT ""; SELECT INET6_NTOA(UNHEX('20000000000000000000000000000000')) into ip_full_addr; SELECT ip_full_addr; END;;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; DELIMITER ;
mysql&gt; call p();
+--------------+
| ip_full_addr |
+--------------+
| 2000::       |
+--------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)