Unit test for merge_table_records_with_pk