MySQL UDF to check data in PowerDNS tables