pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: zhanghien@qq.com
Subject: BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger
Date: Sun, 29 Dec 2024 08:52:31 +0000
Message-ID: <18755-daae8f0ea9618715@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18755
Logged by:          Xin Zhang
Email address:      zhanghien@qq.com
PostgreSQL version: 17.2
Operating system:   Any
Description:        

In function insert_event_trigger_tuple, the datum array is declared with
length Natts_pg_trigger:
```c
	Datum		values[Natts_pg_trigger];
	bool		nulls[Natts_pg_trigger];
```

Natts_pg_trigger should only be used in pg_trigger tuple and
Natts_pg_event_trigger is for pg_event_trigger?
I think this could be a typo. Maybe the author of function
insert_event_trigger_tuple copied the variables from CreateTriggerFiringOn
but forgot to change the array length to Natts_pg_event_trigger.

The current code works because Natts_pg_trigger is 19 and
Natts_pg_event_trigger is 7, the pg_event_trigger values array is allocated
with some extra items which is never accessed with index >= 7.



view thread (3+ messages)  latest in thread

Message-ID: <18755-daae8f0ea9618715@postgresql.org>
Permalink:  ../18755-daae8f0ea9618715@postgresql.org/
Also on:    postgresql.org/message-id/18755-daae8f0ea9618715@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, zhanghien@qq.com
  Subject: Re: BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger
  In-Reply-To: <18755-daae8f0ea9618715@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox