Typo fixes in src/backend/rewrite/rewriteHandler.c

Started by Etsuro Fujitaover 11 years ago2 messages
#1Etsuro Fujita
fujita.etsuro@lab.ntt.co.jp
1 attachment(s)

Here is the comments in process_matched_tle() in rewriteHandler.c.

883 * such nodes; consider
884 * UPDATE tab SET col.fld1.subfld1 = x, col.fld2.subfld2 = y
885 * The two expressions produced by the parser will look like
886 * FieldStore(col, fld1, FieldStore(placeholder, subfld1, x))
887 * FieldStore(col, fld2, FieldStore(placeholder, subfld2, x))

I think the second one is not correct and should be

FieldStore(col, fld2, FieldStore(placeholder, subfld2, y))

Just like this,

891 * FieldStore(FieldStore(col, fld1,
892 * FieldStore(placeholder, subfld1, x)),
893 * fld2, FieldStore(placeholder, subfld2, x))

should be

FieldStore(FieldStore(col, fld1,
FieldStore(placeholder, subfld1, x)),
fld2, FieldStore(placeholder, subfld2, y))

Patch attached.

Thanks,

Best regards,
Etsuro Fujita

Attachments:

rewriteHandler-typo-fixes.patchtext/x-patch; name=rewriteHandler-typo-fixes.patchDownload
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index cb65c05..93fda07 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -883,13 +883,13 @@ process_matched_tle(TargetEntry *src_tle,
 	 *		UPDATE tab SET col.fld1.subfld1 = x, col.fld2.subfld2 = y
 	 * The two expressions produced by the parser will look like
 	 *		FieldStore(col, fld1, FieldStore(placeholder, subfld1, x))
-	 *		FieldStore(col, fld2, FieldStore(placeholder, subfld2, x))
+	 *		FieldStore(col, fld2, FieldStore(placeholder, subfld2, y))
 	 * However, we can ignore the substructure and just consider the top
 	 * FieldStore or ArrayRef from each assignment, because it works to
 	 * combine these as
 	 *		FieldStore(FieldStore(col, fld1,
 	 *							  FieldStore(placeholder, subfld1, x)),
-	 *				   fld2, FieldStore(placeholder, subfld2, x))
+	 *				   fld2, FieldStore(placeholder, subfld2, y))
 	 * Note the leftmost expression goes on the inside so that the
 	 * assignments appear to occur left-to-right.
 	 *
#2Robert Haas
robertmhaas@gmail.com
In reply to: Etsuro Fujita (#1)
Re: Typo fixes in src/backend/rewrite/rewriteHandler.c

On Thu, Oct 2, 2014 at 2:55 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp> wrote:

Here is the comments in process_matched_tle() in rewriteHandler.c.

883 * such nodes; consider
884 * UPDATE tab SET col.fld1.subfld1 = x, col.fld2.subfld2 = y
885 * The two expressions produced by the parser will look like
886 * FieldStore(col, fld1, FieldStore(placeholder, subfld1, x))
887 * FieldStore(col, fld2, FieldStore(placeholder, subfld2, x))

I think the second one is not correct and should be

FieldStore(col, fld2, FieldStore(placeholder, subfld2, y))

Just like this,

891 * FieldStore(FieldStore(col, fld1,
892 * FieldStore(placeholder, subfld1, x)),
893 * fld2, FieldStore(placeholder, subfld2, x))

should be

FieldStore(FieldStore(col, fld1,
FieldStore(placeholder, subfld1, x)),
fld2, FieldStore(placeholder, subfld2, y))

Patch attached.

Looks right to me. Committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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