tdb: add utility function check_merge_with_left_record()