процедура выглядит после правок так:
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `radreply`(IN login VARCHAR(64), tag VARCHAR(64), IN usr_mac VARCHAR(64))
BEGIN
DECLARE usr_id INT;
DECLARE usr_ip VARCHAR(15) DEFAULT NULL;
SELECT id INTO usr_id FROM users WHERE name=login LIMIT 1;
SELECT get_ip_by_tag(usr_id, tag) INTO usr_ip;
CALL set_auth(usr_ip, 'mod=pppoe;');
SELECT NULL,login,'Framed-IP-Address',usr_ip,'=';
SELECT NULL,login,'Framed-IP-Netmask','255.255.255.255','=';
SELECT NULL,login,'Framed-Protocol','PPP','=';
INSERT INTO mac_uid SET mac=usr_mac,
uid=usr_id, device_mac='', device_port='', ip=INET_ATON(usr_ip), time=UNIX_TIMESTAMP()
ON DUPLICATE KEY UPDATE
uid=usr_id, device_mac='', device_port='', ip=INET_ATON(usr_ip), time=UNIX_TIMESTAMP();
END ;;
DELIMITER
;