fix NPE in copy from if table has no explicit primary key