Re: bulk typos

2020-11-01 Thread Michael Paquier
On Fri, Oct 30, 2020 at 09:08:01PM -0500, Justin Pryzby wrote:
> On Sun, Oct 25, 2020 at 02:48:49PM -0500, Justin Pryzby wrote:
>> Pavel, I can't understand this one.
>> I guess s/producement/producing/ is too simple of a fix.
>> Please check my proposed language.
>> +XmlTableFetchRow(TableFuncScanState *state)
>> +* XmlTable returns table - set of composite values. The error 
>> context, is
>> +* used for producement more values, between two calls, there can be
>> +* created and used another libxml2 error context. ...
>> 
>> Surafel, this typo existed twice in the original commit (357889eb1).
>> One instance was removed by Tom in 35cb574aa.  Should we simply fix the typo,
>> or borrow Julien/Tom's lanuage?
>> +   * Tuple at limit is needed for comparation in subsequent
>> +   * execution to detect ties.

What you have sent for xml.c is a clear improvement, but I am not sure
if that's the best we can do.  So I have left this part out, and
applied the rest.

PS: I am also quite fond of "unbetimes".
--
Michael


signature.asc
Description: PGP signature


Re: bulk typos

2020-10-30 Thread Justin Pryzby
On Sun, Oct 25, 2020 at 02:48:49PM -0500, Justin Pryzby wrote:
> On Sat, Mar 31, 2018 at 05:56:40AM -0500, Justin Pryzby wrote:
> > I needed another distraction so bulk-checked for typos, limited to comments 
> > in
> > *.[ch].
> > 
> > I'm not passionate about this, but it serves the purpose of reducing the
> > overhead of fixing them individually.
> 
> I happened across this old patch, so ran this again to find new typos.
> 
> There's a few that I don't know how best to fix.

I've added a few more, but still not sure about these two.

> Pavel, I can't understand this one.
> I guess s/producement/producing/ is too simple of a fix.
> Please check my proposed language.
> +XmlTableFetchRow(TableFuncScanState *state)
> +* XmlTable returns table - set of composite values. The error 
> context, is
> +* used for producement more values, between two calls, there can be
> +* created and used another libxml2 error context. ...
> 
> Surafel, this typo existed twice in the original commit (357889eb1).
> One instance was removed by Tom in 35cb574aa.  Should we simply fix the typo,
> or borrow Julien/Tom's lanuage?
> +   * Tuple at limit is needed for comparation in subsequent
> +   * execution to detect ties.
>From 5b5fec23af33b25f261a875dcd26c60564df0d89 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 25 Oct 2020 18:28:36 -0500
Subject: [PATCH] pgindent typos

Note that there's two changes to one line in lexi.c
---
 io.c   | 4 ++--
 lexi.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/io.c b/io.c
index fbaa5dd..a4812b6 100644
--- a/io.c
+++ b/io.c
@@ -452,8 +452,8 @@ fill_buffer(void)
  *
  * ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf.
  *
- * PARAMETERS: current		integer		The current column target
- * nteger		The desired column
+ * PARAMETERS: current		integer		The current column
+ * target   integer		The desired column
  *
  * RETURNS: Integer value of the new column.  (If current >= target, no action is
  * taken, and current is returned.
diff --git a/lexi.c b/lexi.c
index d43723c..f01596a 100644
--- a/lexi.c
+++ b/lexi.c
@@ -442,7 +442,7 @@ lexi(struct parser_state *state)
 	 * then following sign is unary */
 	state->last_u_d = true;	/* will make "int a -1" work */
 	return (ident);		/* the ident is not in the list */
-}/* end of procesing for alpanum character */
+}/* end of processing for alphanum character */
 
 /* Scan a non-alphanumeric token */
 
-- 
2.17.0

>From c0f112b0c9a1c4007a8562269b36f1fa21ee5a07 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 25 Oct 2020 13:56:19 -0500
Subject: [PATCH v2 1/6] bulk typos

Using same strategy as here
https://www.postgresql.org/message-id/20180331105640.GK28454%40telsasoft.com
---
 contrib/amcheck/verify_heapam.c  | 2 +-
 src/backend/access/heap/pruneheap.c  | 2 +-
 src/backend/catalog/namespace.c  | 2 +-
 src/backend/catalog/pg_namespace.c   | 2 +-
 src/backend/catalog/storage.c| 2 +-
 src/backend/executor/execExpr.c  | 2 +-
 src/backend/executor/nodeIncrementalSort.c   | 2 +-
 src/backend/optimizer/path/allpaths.c| 2 +-
 src/backend/optimizer/plan/analyzejoins.c| 2 +-
 src/backend/partitioning/partbounds.c| 2 +-
 src/backend/postmaster/interrupt.c   | 2 +-
 src/backend/statistics/dependencies.c| 2 +-
 src/backend/statistics/extended_stats.c  | 2 +-
 src/backend/storage/buffer/bufmgr.c  | 2 +-
 src/backend/utils/adt/varlena.c  | 2 +-
 src/bin/pgbench/pgbench.c| 2 +-
 src/common/pg_lzcompress.c   | 2 +-
 src/interfaces/libpq/fe-connect.c| 2 +-
 src/test/modules/dummy_index_am/dummy_index_am.c | 2 +-
 19 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index 8bb890438a..dbe3134b6b 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -1342,7 +1342,7 @@ fxid_in_cached_range(FullTransactionId fxid, const HeapCheckContext *ctx)
 }
 
 /*
- * Checks wheter a multitransaction ID is in the cached valid range, returning
+ * Checks whether a multitransaction ID is in the cached valid range, returning
  * the nature of the range violation, if any.
  */
 static XidBoundsViolation
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
index bc510e2e9b..9e04bc712c 100644
--- a/src/backend/access/heap/pruneheap.c
+++ b/src/backend/access/heap/pruneheap.c
@@ -385,7 +385,7 @@ heap_page_prune(Relation relation, Buffer buffer,
 
 
 /*
- * Perform visiblity checks for heap pruning.
+ * Perform visibility checks for heap pruning.
  *
  * This is

Re: bulk typos

2020-10-25 Thread Tom Lane
Heikki Linnakangas  writes:
> On 25/10/2020 21:48, Justin Pryzby wrote:
>> Heikki, do you remember what this means ?
>> +++ b/src/backend/catalog/storage.c
>> + * NOTE: the list is kept in TopMemoryContext to be sure it won't disappear
>> + * unbetimes.  It'd probably be OK to keep it in TopTransactionContext,
>> + * but I'm being paranoid.

> Heh, even though I was the last one to touch that line according to git 
> blame, I just moved it from smgr.c. Looks like Tom wrote it in 2004. I 
> guess it means "too early". That would make sense from the context. 

Sorry about that, I was being a little whimsical I suppose.

Doing a bit of research, I see the OED defines "betimes" as

[archaic] Before the usual or expected time; early.
‘next morning I was up betimes’

"unbetimes" doesn't seem to be a recognized word ... and now that I look
at this, if it did exist it would mean "too late" which is backwards.

I'd suggest "untimely" if you want to wax poetic, or "too soon" if
you prefer prose that plods.

regards, tom lane




Re: bulk typos

2020-10-25 Thread Heikki Linnakangas

On 25/10/2020 21:48, Justin Pryzby wrote:

On Sat, Mar 31, 2018 at 05:56:40AM -0500, Justin Pryzby wrote:

I needed another distraction so bulk-checked for typos, limited to comments in
*.[ch].

I'm not passionate about this, but it serves the purpose of reducing the
overhead of fixing them individually.


I happened across this old patch, so ran this again to find new typos.


Nice script.


There's a few that I don't know how best to fix.

Heikki, do you remember what this means ?
+++ b/src/backend/catalog/storage.c
+ * NOTE: the list is kept in TopMemoryContext to be sure it won't disappear
+ * unbetimes.  It'd probably be OK to keep it in TopTransactionContext,
+ * but I'm being paranoid.


Heh, even though I was the last one to touch that line according to git 
blame, I just moved it from smgr.c. Looks like Tom wrote it in 2004. I 
guess it means "too early". That would make sense from the context. 
Google only gives a few hits but they seem to agree with "too early". A 
very rare word, for sure. Might be good to change it to "too early", but 
it's not wrong, and the poet in me kind of likes "unbetimes" :-).


- Heikki




Re: bulk typos

2020-10-25 Thread Justin Pryzby
On Sat, Mar 31, 2018 at 05:56:40AM -0500, Justin Pryzby wrote:
> I needed another distraction so bulk-checked for typos, limited to comments in
> *.[ch].
> 
> I'm not passionate about this, but it serves the purpose of reducing the
> overhead of fixing them individually.

I happened across this old patch, so ran this again to find new typos.

There's a few that I don't know how best to fix.

Heikki, do you remember what this means ?
+++ b/src/backend/catalog/storage.c
+ * NOTE: the list is kept in TopMemoryContext to be sure it won't disappear
+ * unbetimes.  It'd probably be OK to keep it in TopTransactionContext,
+ * but I'm being paranoid.

Pavel, I can't understand this one.
I guess s/producement/producing/ is too simple of a fix.
Please check my proposed language.
+XmlTableFetchRow(TableFuncScanState *state)
+* XmlTable returns table - set of composite values. The error context, 
is
+* used for producement more values, between two calls, there can be
+* created and used another libxml2 error context. ...

Surafel, this typo existed twice in the original commit (357889eb1).
One instance was removed by Tom in 35cb574aa.  Should we simply fix the typo,
or borrow Julien/Tom's lanuage?
+   * Tuple at limit is needed for comparation in subsequent
+   * execution to detect ties.
>From fba47da46875c6c89a52225ac39f40e1993a9b56 Mon Sep 17 00:00:00 2001
From: Justin Pryzby 
Date: Sun, 25 Oct 2020 13:56:19 -0500
Subject: [PATCH 1/6] bulk typos

Using same strategy as here
https://www.postgresql.org/message-id/20180331105640.GK28454%40telsasoft.com
---
 contrib/amcheck/verify_heapam.c  | 2 +-
 src/backend/access/heap/pruneheap.c  | 2 +-
 src/backend/catalog/namespace.c  | 2 +-
 src/backend/catalog/pg_namespace.c   | 2 +-
 src/backend/executor/execExpr.c  | 2 +-
 src/backend/executor/nodeIncrementalSort.c   | 2 +-
 src/backend/optimizer/path/allpaths.c| 2 +-
 src/backend/optimizer/plan/analyzejoins.c| 2 +-
 src/backend/partitioning/partbounds.c| 2 +-
 src/backend/postmaster/interrupt.c   | 2 +-
 src/backend/statistics/dependencies.c| 2 +-
 src/backend/statistics/extended_stats.c  | 2 +-
 src/backend/storage/buffer/bufmgr.c  | 2 +-
 src/backend/utils/adt/varlena.c  | 2 +-
 src/bin/pgbench/pgbench.c| 2 +-
 src/common/pg_lzcompress.c   | 2 +-
 src/interfaces/libpq/fe-connect.c| 2 +-
 src/test/modules/dummy_index_am/dummy_index_am.c | 2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index 8bb890438a..dbe3134b6b 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -1342,7 +1342,7 @@ fxid_in_cached_range(FullTransactionId fxid, const HeapCheckContext *ctx)
 }
 
 /*
- * Checks wheter a multitransaction ID is in the cached valid range, returning
+ * Checks whether a multitransaction ID is in the cached valid range, returning
  * the nature of the range violation, if any.
  */
 static XidBoundsViolation
diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c
index bc510e2e9b..9e04bc712c 100644
--- a/src/backend/access/heap/pruneheap.c
+++ b/src/backend/access/heap/pruneheap.c
@@ -385,7 +385,7 @@ heap_page_prune(Relation relation, Buffer buffer,
 
 
 /*
- * Perform visiblity checks for heap pruning.
+ * Perform visibility checks for heap pruning.
  *
  * This is more complicated than just using GlobalVisTestIsRemovableXid()
  * because of old_snapshot_threshold. We only want to increase the threshold
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index 391a9b225d..740570c566 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -3853,7 +3853,7 @@ recomputeNamespacePath(void)
 	/*
 	 * We want to detect the case where the effective value of the base search
 	 * path variables didn't change.  As long as we're doing so, we can avoid
-	 * copying the OID list unncessarily.
+	 * copying the OID list unnecessarily.
 	 */
 	if (baseCreationNamespace == firstNS &&
 		baseTempCreationPending == temp_missing &&
diff --git a/src/backend/catalog/pg_namespace.c b/src/backend/catalog/pg_namespace.c
index ed85276070..7d2e26fd35 100644
--- a/src/backend/catalog/pg_namespace.c
+++ b/src/backend/catalog/pg_namespace.c
@@ -106,7 +106,7 @@ NamespaceCreate(const char *nspName, Oid ownerId, bool isTemp)
 	/* dependency on owner */
 	recordDependencyOnOwner(NamespaceRelationId, nspoid, ownerId);
 
-	/* dependences on roles mentioned in default ACL */
+	/* dependencies on roles mentioned in default ACL */
 	recordDependencyOnNewAcl(NamespaceRelationId, nspoid, 0, ownerId, nspacl);
 
 	/* dependency on extension ... but not for magic temp s

Re: bulk typos

2018-04-01 Thread Gavin Flower

On 02/04/18 07:03, Tom Lane wrote:

=?UTF-8?Q?F=C3=A9lix_GERZAGUET?=  writes:

On Sat, Mar 31, 2018 at 12:56 PM, Justin Pryzby 
wrote:

I needed another distraction so bulk-checked for typos, limited to
comments in *.[ch].

I think you introduced another one while changing "explcitly" to
"expilcitly" instead of "explicitly" :-)

LGTM for the most part, except for this change:

- * Therefore, we do not whinge about no-such-process.
+ * Therefore, we do not whine about no-such-process.

I think that spelling is intentional, so I didn't change it.
Pushed the rest, with Felix's correction.

regards, tom lane


Me thinks some people are Whinging far too much!

see: https://en.oxforddictionaries.com/definition/whinge


Cheers,
Gavin




Re: bulk typos

2018-04-01 Thread Andres Freund
Hi,

On 2018-03-31 05:56:40 -0500, Justin Pryzby wrote:
> --- a/src/backend/jit/llvm/llvmjit_expr.c
> +++ b/src/backend/jit/llvm/llvmjit_expr.c
> @@ -1768,7 +1768,7 @@ llvm_compile_expr(ExprState *state)
>   
> b_compare_result,
>   b_null);
>  
> - /* build block analying the !NULL 
> comparator result */
> + /* build block analyzing the !NULL 
> comparator result */
>   LLVMPositionBuilderAtEnd(b, 
> b_compare_result);

Hah. I kinda like the previous way too ;)

Greetings,

Andres Freund




Re: bulk typos

2018-04-01 Thread Tom Lane
=?UTF-8?Q?F=C3=A9lix_GERZAGUET?=  writes:
> On Sat, Mar 31, 2018 at 12:56 PM, Justin Pryzby 
> wrote:
>> I needed another distraction so bulk-checked for typos, limited to
>> comments in *.[ch].

> I think you introduced another one while changing "explcitly" to
> "expilcitly" instead of "explicitly" :-)

LGTM for the most part, except for this change:

- * Therefore, we do not whinge about no-such-process.
+ * Therefore, we do not whine about no-such-process.

I think that spelling is intentional, so I didn't change it.
Pushed the rest, with Felix's correction.

regards, tom lane



Re: bulk typos

2018-03-31 Thread Félix GERZAGUET
On Sat, Mar 31, 2018 at 12:56 PM, Justin Pryzby 
wrote:

> I needed another distraction so bulk-checked for typos, limited to
> comments in
> *.[ch].
>

I think you introduced another one while changing "explcitly" to
"expilcitly" instead of "explicitly" :-)

--
Félix


bulk typos

2018-03-31 Thread Justin Pryzby
I needed another distraction so bulk-checked for typos, limited to comments in
*.[ch].

I'm not passionate about this, but it serves the purpose of reducing the
overhead of fixing them individually.

Also I heard something here recently about ugly languages..
time find . -name '*.c' -print0 |xargs -r0 sed -s '/.*\/\*/!d; s///; :l; 
/\*\/.*/!{N;b l}; s///; s/.*/\L&/' |grep -Eo '[[:alpha:]]{3,}' |sort |uniq -c 
|sort -nr |awk '$1==1{print $2}' |grep -xFvf /usr/share/dict/words |less

If any of these are disputed or objectionable, I would summarily discard them,
as I'm sure I missed some and fixing every last typo wasn't really the ghoul.

Justin
diff --git a/contrib/pgcrypto/rijndael.c b/contrib/pgcrypto/rijndael.c
index 4c074ef..6938701 100644
--- a/contrib/pgcrypto/rijndael.c
+++ b/contrib/pgcrypto/rijndael.c
@@ -163,7 +163,7 @@ gen_tabs(void)
q;
 
/* log and power tables for GF(2**8) finite field with  */
-   /* 0x11b as modular polynomial - the simplest prmitive  */
+   /* 0x11b as modular polynomial - the simplest primitive */
/* root is 0x11, used here to generate the tables   */
 
for (i = 0, p = 1; i < 256; ++i)
diff --git a/src/backend/access/common/session.c 
b/src/backend/access/common/session.c
index 617c3e1..ffa7432 100644
--- a/src/backend/access/common/session.c
+++ b/src/backend/access/common/session.c
@@ -60,7 +60,7 @@ InitializeSession(void)
  * Initialize the per-session DSM segment if it isn't already initialized, and
  * return its handle so that worker processes can attach to it.
  *
- * Unlike the per-context DSM segment, this segement and its contents are
+ * Unlike the per-context DSM segment, this segment and its contents are
  * reused for future parallel queries.
  *
  * Return DSM_HANDLE_INVALID if a segment can't be allocated due to lack of
diff --git a/src/backend/access/nbtree/nbtinsert.c 
b/src/backend/access/nbtree/nbtinsert.c
index e85abcf..4011199 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -187,9 +187,9 @@ top:
_bt_relbuf(rel, buf);
 
/*
-* Something did not workout. Just forget about 
the cached
+* Something did not work out. Just forget 
about the cached
 * block and follow the normal path. It might 
be set again if
-* the conditions are favourble.
+* the conditions are favourable.
 */
RelationSetTargetBlock(rel, InvalidBlockNumber);
}
diff --git a/src/backend/executor/execProcnode.c 
b/src/backend/executor/execProcnode.c
index 43a27a9..a3fb449 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -409,7 +409,7 @@ ExecSetExecProcNode(PlanState *node, ExecProcNodeMtd 
function)
 * Add a wrapper around the ExecProcNode callback that checks stack 
depth
 * during the first execution and maybe adds an instrumentation
 * wrapper. When the callback is changed after execution has already 
begun
-* that means we'll superflously execute ExecProcNodeFirst, but that 
seems
+* that means we'll superfluously execute ExecProcNodeFirst, but that 
seems
 * ok.
 */
node->ExecProcNodeReal = function;
diff --git a/src/backend/jit/llvm/llvmjit_expr.c 
b/src/backend/jit/llvm/llvmjit_expr.c
index 0d8c2bd..f37ff82 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -1768,7 +1768,7 @@ llvm_compile_expr(ExprState *state)

b_compare_result,
b_null);
 
-   /* build block analying the !NULL 
comparator result */
+   /* build block analyzing the !NULL 
comparator result */
LLVMPositionBuilderAtEnd(b, 
b_compare_result);
 
/* if results equal, compare next, 
otherwise done */
diff --git a/src/backend/optimizer/geqo/geqo_misc.c 
b/src/backend/optimizer/geqo/geqo_misc.c
index 919d288..0f96912 100644
--- a/src/backend/optimizer/geqo/geqo_misc.c
+++ b/src/backend/optimizer/geqo/geqo_misc.c
@@ -92,7 +92,7 @@ print_gen(FILE *fp, Pool *pool, int generation)
 {
int lowest;
 
-   /* Get index to lowest ranking gene in poplulation. */
+   /* Get index to lowest ranking gene in population. */
/* Use 2nd to last since last is buffer. */
lowest = pool->size > 1 ? pool->size - 2 : 0;
 
diff --git a/src/backend/optimizer/plan/planner.c 
b/src/backend/optimizer/plan/planner.c
index