[Groonga-commit] pgroonga/pgroonga at 10ea55c [master] Support HOT update on PostgreSQL 9.3

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Apr 30 17:00:19 JST 2015


Kouhei Sutou	2015-04-30 17:00:19 +0900 (Thu, 30 Apr 2015)

  New Revision: 10ea55c7c26dedb1ab82497567e0e4bcfd66dd09
  https://github.com/pgroonga/pgroonga/commit/10ea55c7c26dedb1ab82497567e0e4bcfd66dd09

  Message:
    Support HOT update on PostgreSQL 9.3

  Modified files:
    pgroonga.c

  Modified: pgroonga.c (+8 -2)
===================================================================
--- pgroonga.c    2015-04-29 14:45:38 +0900 (f28439d)
+++ pgroonga.c    2015-04-30 17:00:19 +0900 (828578e)
@@ -916,14 +916,20 @@ PGrnIsAliveCtid(Relation table, ItemPointer ctid)
 	ItemPointerData realCtid;
 	bool allDead;
 	bool found;
-	bool isAlive;
+	bool isAlive = false;
 
 	buffer = ReadBuffer(table, ItemPointerGetBlockNumber(ctid));
 	snapshot = RegisterSnapshot(GetLatestSnapshot());
 	realCtid = *ctid;
 	found = heap_hot_search_buffer(&realCtid, table, buffer, snapshot, &tuple,
 								   &allDead, true);
-	isAlive = (found && CtidToUInt64(&(tuple.t_self)) == CtidToUInt64(ctid));
+	if (found) {
+		uint64 tupleID;
+
+		tupleID = CtidToUInt64(&(tuple.t_self));
+		isAlive = (tupleID == CtidToUInt64(ctid) ||
+				   tupleID == CtidToUInt64(&realCtid));
+	}
 	UnregisterSnapshot(snapshot);
 	ReleaseBuffer(buffer);
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index