Avoid redundant buffer copies for get_record