BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger
Date
Msg-id 18755-daae8f0ea9618715@postgresql.org
Whole thread Raw
List pgsql-bugs
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.


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18754: Logical replication cannot restart if client sent a copyDone
Next
From: "张鑫"
Date:
Subject: Re: BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger