BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: zhanghien(at)qq(dot)com
Subject: BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger
Date: 2024-12-29 08:52:31
Message-ID: 18755-daae8f0ea9618715@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18755
Logged by: Xin Zhang
Email address: zhanghien(at)qq(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 张鑫 2024-12-29 09:37:18 Re: BUG #18755: Using Natts_pg_trigger rather than Natts_pg_event_trigger for event trigger
Previous Message PG Bug reporting form 2024-12-27 12:54:30 BUG #18754: Logical replication cannot restart if client sent a copyDone