DROP PROCEDURE IF EXISTS `update_user_name`;
DELIMITER ;;
CREATE PROCEDURE `update_user_name` (
    IN p_name VARCHAR(50),
    IN p_user_id INT,
    OUT p_status INT
)
proc:BEGIN
    IF p_name = '' OR p_name IS NULL THEN
        SET p_status = -1;
        LEAVE proc;
    END IF;
    UPDATE users SET name = p_name WHERE id = p_user_id;
    SET p_status = 0;
END ;;
DELIMITER ;
