Fix bug upon insert/update of a row created in the same tx