DROP PROCEDURE IF EXISTS mocha_select_tenant;

CREATE PROCEDURE mocha_select_tenant
(
	IN p_tenant_id INT
)
BEGIN

	IF p_tenant_id IS NULL THEN

		SELECT @current_tenant_id;

	ELSE

		SET @current_tenant_id = p_tenant_id;

	END IF;

END;
