add function to build PatchRecordTable.