Fix the SQL parsing after recent commit when the table has a primary key