@@ -2044,13 +2044,24 @@ bool vertex_index_fetch_tuple(struct IndexFetchTableData *scan,
2044
2044
* according to `snapshot`. If a tuple was found and passed the visibility
2045
2045
* test, returns true, false otherwise.
2046
2046
*/
2047
- bool vertex_tuple_fetch_row_version (Relation rel , ItemPointer tid ,
2047
+ bool vertex_tuple_fetch_row_version (Relation relation , ItemPointer tid ,
2048
2048
Snapshot snapshot , TupleTableSlot * slot ) {
2049
- ereport (ERROR , (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2050
- errmsg_internal ("vertex_parallelscan_reinitialize not implemented" )));
2051
-
2049
+ BufferHeapTupleTableSlot * bslot = (BufferHeapTupleTableSlot * ) slot ;
2050
+ Buffer buffer ;
2052
2051
2053
- return false;
2052
+ Assert (TTS_IS_BUFFERTUPLE (slot ));
2053
+
2054
+ bslot -> base .tupdata .t_self = * tid ;
2055
+ if (heap_fetch (relation , snapshot , & bslot -> base .tupdata , & buffer ))
2056
+ {
2057
+ /* store in slot, transferring existing pin */
2058
+ ExecStorePinnedBufferHeapTuple (& bslot -> base .tupdata , slot , buffer );
2059
+ slot -> tts_tableOid = RelationGetRelid (relation );
2060
+
2061
+ return true;
2062
+ }
2063
+
2064
+ return false;
2054
2065
}
2055
2066
2056
2067
/*
@@ -2569,16 +2580,37 @@ TM_Result vertex_tuple_delete(Relation relation, ItemPointer tid, CommandId cid,
2569
2580
}
2570
2581
2571
2582
/* see table_tuple_update() for reference about parameters */
2572
- TM_Result vertex_tuple_update (Relation rel , ItemPointer otid , TupleTableSlot * slot ,
2583
+ TM_Result vertex_tuple_update (Relation relation , ItemPointer otid , TupleTableSlot * slot ,
2573
2584
CommandId cid , Snapshot snapshot , Snapshot crosscheck ,
2574
2585
bool wait , TM_FailureData * tmfd , LockTupleMode * lockmode ,
2575
2586
bool * update_indexes ) {
2576
2587
2577
- ereport (ERROR , (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
2578
- errmsg_internal ("vertex_parallelscan_reinitialize not implemented" )));
2579
-
2588
+ bool shouldFree = true;
2589
+ HeapTuple tuple = ExecFetchSlotHeapTuple (slot , true, & shouldFree );
2590
+ TM_Result result ;
2591
+
2592
+ /* Update the tuple with table oid */
2593
+ slot -> tts_tableOid = RelationGetRelid (relation );
2594
+ tuple -> t_tableOid = slot -> tts_tableOid ;
2595
+
2596
+ result = heap_update (relation , otid , tuple , cid , crosscheck , wait ,
2597
+ tmfd , lockmode );
2598
+ ItemPointerCopy (& tuple -> t_self , & slot -> tts_tid );
2599
+
2600
+ /*
2601
+ * Decide whether new index entries are needed for the tuple
2602
+ *
2603
+ * Note: heap_update returns the tid (location) of the new tuple in the
2604
+ * t_self field.
2605
+ *
2606
+ * If it's a HOT update, we mustn't insert new index entries.
2607
+ */
2608
+ * update_indexes = result == TM_Ok && !HeapTupleIsHeapOnly (tuple );
2609
+
2610
+ if (shouldFree )
2611
+ pfree (tuple );
2580
2612
2581
- return 0 ;
2613
+ return result ;
2582
2614
}
2583
2615
2584
2616
/* see table_tuple_lock() for reference about parameters */
0 commit comments