Thread: Guidance Needed for Testing PostgreSQL Patch (CF-5044)

Guidance Needed for Testing PostgreSQL Patch (CF-5044)

From
postgresql_contributors
Date:
Hi,
I recently installed and tested the CF-5044 patch using the query provided on the PostgreSQL community page but could not confirm its functionality. I followed the standard process:
  1. Applied the patch using  git.
  2. Rebuilt PostgreSQL from source (./configure, make, make install).
  3. Tested with the suggested query after restarting PostgreSQL.
I would appreciate your guidance on verifying patch functionality and ensuring compliance with community testing standards. If there are additional steps or tools I should use, please let me know.
Thank you for your support as I represent Newt Global in contributing to the PostgreSQL community.
Best regards,
Team from Newt Global

Re: Guidance Needed for Testing PostgreSQL Patch (CF-5044)

From
Tomas Vondra
Date:
Hi,

On 11/29/24 12:04, postgresql_contributors wrote:
> Hi,
> I recently installed and tested the CF-5044 patch using the query
> provided on the PostgreSQL community page but could not confirm its
> functionality. I followed the standard process:
> 
>  1. Applied the patch using  |git|.
>  2. Rebuilt PostgreSQL from source (|./configure|, |make|, |make install|).
>  3. Tested with the suggested query after restarting PostgreSQL.
> 
> I would appreciate your guidance on verifying patch functionality and
> ensuring compliance with community testing standards. If there are
> additional steps or tools I should use, please let me know.
> Thank you for your support as I represent Newt Global in contributing to
> the PostgreSQL community.

It's not clear to me if you're asking about how to test a particular
patch (I suppose by CF 5044 you mean [1]?), or testing in general.

I don't know what you mean by "suggested query" and why you feel you
could not confirm the functionality of the patch. Can you elaborate?

FWIW the queries mentioned in the e-mail thread are usually included as
a demonstration of what the patch is meant to do, not as a definitive
proof that the patch is working. Likewise, it's not enough to just run
the tests included in the patch - we have automated tools to do that.

Testing a patch usually requires inventing new tests, thinking about
cases the author might not have considered, etc. There's no "standard"
to do that, it's often a surprisingly creative task, and it depends on
what the patch is meant to do.

Maybe start by asking questions about the patch:

- Does the patch address a real problem? Is it useful?

- Does it reliably do what it's supposed to do? Maybe there are false
positives/negatives the author did not consider?

- Could it have some unintended consequences?

- Is is properly testing the change? Maybe it's missing some tests?

- ... and so on ...


Yes, it's going to be very specific to a given patch. I don't think
there's a great "howto" for any patch :-(



Does this answer your question?



[1] https://commitfest.postgresql.org/50/5044/

-- 
Tomas Vondra




Re: Guidance Needed for Testing PostgreSQL Patch (CF-5044)

From
Cédric Villemain
Date:
On 29/11/2024 12:04, postgresql_contributors wrote:
P {margin-top:0;margin-bottom:0;}
Hi,
I recently installed and tested the CF-5044 patch using the query provided on the PostgreSQL community page but could not confirm its functionality. I followed the standard process:
  1. Applied the patch using  git.
  2. Rebuilt PostgreSQL from source (./configure, make, make install).
  3. Tested with the suggested query after restarting PostgreSQL.
I would appreciate your guidance on verifying patch functionality and ensuring compliance with community testing standards. If there are additional steps or tools I should use, please let me know.
Thank you for your support as I represent Newt Global in contributing to the PostgreSQL community.


That's welcome!


Maybe you'll find this wiki of interest:
https://wiki.postgresql.org/wiki/Reviewing_a_Patch in this page there is also a link to https://www.postgresql.org/docs/current/source.html
Which is a nice place to explore probably.


I hope it'll help
---
Cédric Villemain +33 6 20 30 22 52
https://www.Data-Bene.io
PostgreSQL Support, Expertise, Training, R&D

Re: Guidance Needed for Testing PostgreSQL Patch (CF-5044)

From
Andrew Dunstan
Date:


On 2024-12-04 We 3:07 AM, postgresql_contributors wrote:
P {margin-top:0;margin-bottom:0;}Hi pg_hackers,

I hope you are doing well. I am working on reviewing PostgreSQL community tickets and started with the patch cf/5044. 
This patch is in the branch cf/5044, and I pulled the code to test it.
Here’s what I have done so far:
  • Pulled the code from the branch cf/5044.
  • Compiled the code.
  • Set up the database as required.
Tested the query for this patch mentioned in the community chat (https://commitfest.postgresql.org/50/5044/) .
However, I didn’t get the expected output mentioned in the ticket (below mentioned example).

CREATE TABLE foo3(id serial PRIMARY key, txt text);

INSERT INTO foo3 (txt) VALUES ('aaa'),('bbb');
DO $$
DECLARE
    l_cnt int;
BEGIN
    l_cnt := 1
    DELETE FROM foo3 WHERE id=1;
END; $$

-- without reaction - just don't work

(2024-06-16 16:05:55) postgres=# set plpgsql.extra_errors to
'strict_expr_check';
SET
(2024-06-16 16:06:43) postgres=# DO $$

DECLARE
    l_cnt int;
BEGIN
    l_cnt := 1
    DELETE FROM foo3 WHERE id=1;
END; $$;
ERROR:  syntax error at or near "DELETE"
LINE 11:     DELETE FROM foo3 WHERE id=1;
             ^
Please provide guidance on this patch.


Well, it's told you what the problem is - there's a syntax error. And it's pretty glaring: the line


    l_cnt := 1


is missing a trailing semicolon. So I suggest you add that and then keep going.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com