Re: Add tests for object size limits of injection points

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add tests for object size limits of injection points
Date: 2025-11-10 02:30:31
Message-ID: 3A43F33C-B507-4BE9-B7BD-6FBDF0D58B92@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Nov 10, 2025, at 09:11, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> Hi all,
>
> While looking at a recent patch for injection points that has resulted
> in 16a2f706951e, I have been reminded that the point name, library
> name and function name have hardcoded limits, and it is now possible
> to have them tested by SQL.
>
> Attached is a patch to do so. Thoughts?
> --
> Michael
> <0001-injection_points-Add-tests-for-name-limits.patch>

Maybe not a problem of this patch, but

```
+SELECT injection_points_attach(repeat('a', 64), 'injection_notice',
+ 'TestInjectionNoticeFunc', NULL);
+ERROR: injection point name aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa too long (maximum of 64)
```

Is really confused. The error message says “maximum of 64”, but the test right uses a name of length 64. I know that the tricky is the ‘\0’ terminator, but should SQL writer have to keep mind about the ‘\0’ terminator? Should they just consider maximum length as 63?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-11-10 02:30:47 Re: add function argument name to substring and substr
Previous Message Chao Li 2025-11-10 02:06:35 Re: Suggestion to add --continue-client-on-abort option to pgbench