@@ -92,6 +92,7 @@ bool UpdateExecutor::PerformUpdatePrimaryKey(
9292 return false ;
9393 }
9494 transaction_manager.PerformDelete (current_txn, old_location, new_location);
95+ statement_write_set_.insert (new_location);
9596
9697 // //////////////////////////////////////////
9798 // Insert tuple rather than install version
@@ -191,9 +192,6 @@ bool UpdateExecutor::DExecute() {
191192 oid_t physical_tuple_id = pos_lists[0 ][visible_tuple_id];
192193
193194 ItemPointer old_location (tile_group->GetTileGroupId (), physical_tuple_id);
194- if (IsInStatementWriteSet (old_location)) {
195- continue ;
196- }
197195
198196 LOG_TRACE (" Visible Tuple id : %u, Physical Tuple id : %u " ,
199197 visible_tuple_id, physical_tuple_id);
@@ -221,6 +219,11 @@ bool UpdateExecutor::DExecute() {
221219 }
222220 // /////////////////////////////////////////////////////////
223221
222+
223+ if (IsInStatementWriteSet (old_location)) {
224+ continue ;
225+ }
226+
224227 if (trigger_list != nullptr ) {
225228 LOG_TRACE (" size of trigger list in target table: %d" ,
226229 trigger_list->GetTriggerListSize ());
@@ -268,7 +271,8 @@ bool UpdateExecutor::DExecute() {
268271 executor_context_);
269272
270273 transaction_manager.PerformUpdate (current_txn, old_location);
271- statement_write_set_.insert (old_location);
274+ // we do not need to add any item pointer to statement-level write set
275+ // here, because we do not generate any new version
272276 }
273277 }
274278 // if we have already obtained the ownership
0 commit comments