On 19-03-2015 15:13, Robert Haas wrote:
> On Wed, Mar 18, 2015 at 5:36 PM, Andres Freund <and...@2ndquadrant.com> wrote:
>> Reading the README first, the rest later. So you can comment on my
>> comments, while I actually look at the code. Parallelism, yay!
> 
I'm also looking at this piece of code and found some low-hanging fruit.


-- 
   Euler Taveira                   Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
>From 3ce5376868f61a67540915b83a15c59a31fc895a Mon Sep 17 00:00:00 2001
From: Euler Taveira <eu...@timbira.com>
Date: Sun, 26 Apr 2015 13:49:37 -0300
Subject: [PATCH 1/3] fix some typos.

---
 src/backend/access/heap/heapam.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index da0b70e..16d8c59 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -2250,7 +2250,7 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid,
 	/*
 	 * For now, parallel operations are required to be strictly read-only.
 	 * Unlike heap_update() and heap_delete(), an insert should never create
-	 * a combo CID, so it might be possible to relax this restrction, but
+	 * a combo CID, so it might be possible to relax this restriction, but
 	 * not without more thought and testing.
 	 */
 	if (IsInParallelMode())
@@ -2666,7 +2666,7 @@ heap_delete(Relation relation, ItemPointer tid,
 	Assert(ItemPointerIsValid(tid));
 
 	/*
-	 * Forbid this during a parallel operation, lest it allocate a combocid.
+	 * Forbid this during a parallel operation, lets it allocate a combocid.
 	 * Other workers might need that combocid for visibility checks, and we
 	 * have no provision for broadcasting it to them.
 	 */
@@ -3124,7 +3124,7 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
 	Assert(ItemPointerIsValid(otid));
 
 	/*
-	 * Forbid this during a parallel operation, lest it allocate a combocid.
+	 * Forbid this during a parallel operation, lets it allocate a combocid.
 	 * Other workers might need that combocid for visibility checks, and we
 	 * have no provision for broadcasting it to them.
 	 */
@@ -5435,7 +5435,7 @@ heap_inplace_update(Relation relation, HeapTuple tuple)
 	/*
 	 * For now, parallel operations are required to be strictly read-only.
 	 * Unlike a regular update, this should never create a combo CID, so it
-	 * might be possible to relax this restrction, but not without more
+	 * might be possible to relax this restriction, but not without more
 	 * thought and testing.  It's not clear that it would be useful, anyway.
 	 */
 	if (IsInParallelMode())
-- 
2.1.4

>From cf25445d9d21496b6927e9ef45e6c3815fef8ad5 Mon Sep 17 00:00:00 2001
From: Euler Taveira <eu...@timbira.com>
Date: Sun, 26 Apr 2015 14:24:26 -0300
Subject: [PATCH 2/3] Avoid compiler warnings about unused variables in
 assert-disabled builds.

---
 src/backend/utils/fmgr/funcapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c
index ebd7ddd..b9f2b06 100644
--- a/src/backend/utils/fmgr/funcapi.c
+++ b/src/backend/utils/fmgr/funcapi.c
@@ -887,7 +887,7 @@ get_func_trftypes(HeapTuple procTup,
 				  Oid **p_trftypes)
 {
 
-	Form_pg_proc procStruct = (Form_pg_proc) GETSTRUCT(procTup);
+	Form_pg_proc procStruct PG_USED_FOR_ASSERTS_ONLY = (Form_pg_proc) GETSTRUCT(procTup);
 	Datum		protrftypes;
 	ArrayType  *arr;
 	int			nelems;
-- 
2.1.4

>From 7d1716fdf84f24a1dddfa02db27d532e06c92c3d Mon Sep 17 00:00:00 2001
From: Euler Taveira <eu...@timbira.com>
Date: Sun, 26 Apr 2015 14:52:39 -0300
Subject: [PATCH 3/3] Fix some more typos.

---
 src/backend/access/transam/README.parallel | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/access/transam/README.parallel b/src/backend/access/transam/README.parallel
index c066fff..2257e4c 100644
--- a/src/backend/access/transam/README.parallel
+++ b/src/backend/access/transam/README.parallel
@@ -76,7 +76,7 @@ Instead, we take a more pragmatic approach. First, we try to make as many of
 the operations that are safe outside of parallel mode work correctly in
 parallel mode as well.  Second, we try to prohibit common unsafe operations
 via suitable error checks.  These checks are intended to catch 100% of
-unsafe things that a user might do from the SQL interface, but code writen
+unsafe things that a user might do from the SQL interface, but code written
 in C can do unsafe things that won't trigger these checks.  The error checks
 are engaged via EnterParallelMode(), which should be called before creating
 a parallel context, and disarmed via ExitParallelMode(), which should be
@@ -108,7 +108,7 @@ worker.  This includes:
   - The combo CID mappings.  This is needed to ensure consistent answers to
     tuple visibility checks.  The need to synchronize this data structure is
     a major reason why we can't support writes in parallel mode: such writes
-    might create new combo CIDs, and we have now way to let other workers
+    might create new combo CIDs, and we have no way to let other workers
     (or the initiating backend) know about them.
 
   - The transaction snapshot.
@@ -178,7 +178,7 @@ pins, catcache or relcache reference counts, tuple descriptors, and so on
 are managed separately by each backend, and must free them before exiting.
 There are, however, some important differences between parallel worker
 commit or abort and a real top-level transaction commit or abort.  Most
-imporantly:
+importantly:
 
   - No commit or abort record is written; the initiating backend is
     responsible for this.
-- 
2.1.4

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to