Re: CreateEventTrigStmt copy fix

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Petr Jelinek <petr(at)2ndquadrant(dot)com>
Cc: "-ha >> PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CreateEventTrigStmt copy fix
Date: 2014-09-19 17:57:44
Message-ID: CAB7nPqTRynyLujOMen5ZAEEvVnm4Y-wjfijswoLK=8WvuV11CQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 19, 2014 at 11:09 AM, Petr Jelinek <petr(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-09-19 17:58:17 Re: removing volatile qualifiers from lwlock.c
Previous Message Josh Berkus 2014-09-19 17:37:40 Re: Final Patch for GROUPING SETS