Re: CreateEventTrigStmt copy fix - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: CreateEventTrigStmt copy fix
Date
Msg-id CAB7nPqTRynyLujOMen5ZAEEvVnm4Y-wjfijswoLK=8WvuV11CQ@mail.gmail.com
Whole thread Raw
In response to CreateEventTrigStmt copy fix  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
On Fri, Sep 19, 2014 at 11:09 AM, Petr Jelinek <petr@2ndquadrant.com> wrote:
> Hi hackers,
>
> I was trying to create event trigger inside DO statement inside an extension
> SQL script and noticed that the new event trigger has empty evtevent field.
> After some tinkering with gdb I found out that the memory context switches
> sometimes clear the eventname in CreateEventTrigStmt struct. The reason for
> this is that _copyCreateEventTrigStmt uses COPY_SCALAR_FIELD on eventname
> instead of COPY_STRING_FIELD.
>
> Attached patch fixes this and also the same issue in
> _equalCreateEventTrigStmt.
>
> This should be back-patched to 9.3 where event triggers were introduced.
Nice catch! And no need to care much about outfuncs.c for this Node type.
Regards,
-- 
Michael



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Final Patch for GROUPING SETS
Next
From: Robert Haas
Date:
Subject: Re: removing volatile qualifiers from lwlock.c