I have strange problem, im using 10.2.27 mariadb version . created procedure for auditing user connections using init_connect parameter to call the procedure. this procedure working for all the users except one user who is having REPLICATION CLIENT and table level privs and table is not getting updated with this user details where i can see the user connections in the processlist. Please help me how to fix this issue a or any pointer are most appreciated
here is the procedure
DELIMITER //
CREATE PROCEDURE login_trigger()
SQL SECURITY DEFINER
BEGIN
INSERT INTO test.tracking (user, host, ts)
VALUES (SUBSTR(USER(), 1, instr(USER(), '@')-1), substr(USER(), instr(USER(), '@')+1), NOW())
ON DUPLICATE KEY UPDATE ts = NOW();
END;
//
DELIMITER ;
parameter set set from root user of the database
SET GLOBAL init_connect="CALL test.login_trigger()";