[BUG FIX]Throw exception if the table has no primary keys.