Thread

Commits

  1. Remove redundant assignments in copyfrom.c

  1. Suspicious redundant assignment in COPY FROM

    Jingtang Zhang <mrdrivingduck@gmail.com> — 2023-09-08T04:23:17Z

    Hi all, I was reading code of COPY FROM and I found some suspicious
    redundant assignment for tuple descriptor and number of attributes. Is
    it a behavior on purpose, or an accidently involved by the refactor in
    c532d15? Patch is attached.
    
  2. Re: Suspicious redundant assignment in COPY FROM

    Michael Paquier <michael@paquier.xyz> — 2023-09-08T05:41:54Z

    On Fri, Sep 08, 2023 at 12:23:17PM +0800, Jingtang Zhang wrote:
    > Hi all, I was reading code of COPY FROM and I found some suspicious
    > redundant assignment for tuple descriptor and number of attributes. Is
    > it a behavior on purpose, or an accidently involved by the refactor in
    > c532d15? Patch is attached.
    
    This looks like a copy-pasto to me, as the tuple descriptor coming
    from the relation is just used for sanity checks on the attributes
    depending on the options by the caller for the COPY.
    
    The assignment of num_phys_attrs could be kept at the same place as
    on HEAD, a bit closer to the palloc0() where it is used.
    --
    Michael
    
  3. Re: Suspicious redundant assignment in COPY FROM

    Jingtang Zhang <mrdrivingduck@gmail.com> — 2023-09-08T05:54:51Z

    Michael Paquier <michael@paquier.xyz> 于2023年9月8日周五 13:42写道:
    
    Thanks, Michael~
    
    
    > The assignment of num_phys_attrs could be kept at the same place as
    > on HEAD, a bit closer to the palloc0() where it is used.
    >
    
    Agreed with this principle. Patch is modified and attached.
    
    --
    Jingtang
    
  4. Re: Suspicious redundant assignment in COPY FROM

    Michael Paquier <michael@paquier.xyz> — 2023-09-09T12:13:38Z

    On Fri, Sep 08, 2023 at 01:54:51PM +0800, Jingtang Zhang wrote:
    > Agreed with this principle. Patch is modified and attached.
    
    Done as of e434e21e1.
    --
    Michael