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: copy.c.patch
Description: copy.c.patch

Reply via email to