From: | Ranier Vilela <ranier_gyn(at)hotmail(dot)com> |
---|---|
To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | [PATCH] Tiny optmization. |
Date: | 2019-11-22 21:41:44 |
Message-ID: | MN2PR18MB2927DF45F7F53BB76ED4A3F4E3490@MN2PR18MB2927.namprd18.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
Maybe it doesn't matter, but, I think it's worth discussing.
The expression "if(pstate)" is redundant or is possible null dereference.
Best regards.
Ranier Vilela
--- \dll\postgresql-12.0\a\backend\commands\copy.c Mon Sep 30 17:06:55 2019
+++ copy.c Fri Nov 22 18:33:05 2019
@@ -3426,8 +3426,7 @@
cstate->raw_buf_index = cstate->raw_buf_len = 0;
/* Assign range table, we'll need it in CopyFrom. */
- if (pstate)
- cstate->range_table = pstate->p_rtable;
+ cstate->range_table = pstate->p_rtable;
tupDesc = RelationGetDescr(cstate->rel);
num_phys_attrs = tupDesc->natts;
Attachment | Content-Type | Size |
---|---|---|
copy.c.patch | application/octet-stream | 433 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Ranier Vilela | 2019-11-22 21:51:50 | [PATCH] Tiny optmization or is a bug? |
Previous Message | Tom Lane | 2019-11-22 20:46:02 | Re: TAP tests aren't using the magic words for Windows file access |