Re: pgbench - refactor init functions with buffers - Mailing list pgsql-hackers

From Jeevan Ladhe
Subject Re: pgbench - refactor init functions with buffers
Date
Msg-id CAOgcT0McCGNw5Fo1uPnROVaE72Rhnm59EfQrTSBEixHDX2vuUg@mail.gmail.com
Whole thread Raw
In response to Re: pgbench - refactor init functions with buffers  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgbench - refactor init functions with buffers  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers


On Tue, Oct 22, 2019 at 4:36 PM Fabien COELHO <coelho@cri.ensmp.fr> wrote:

Hello Jeevan,

>> I haven't read the complete patch.  But, I have noticed that many
>> places you changed the variable declaration from c to c++ style (i.e
>> moved the declaration in the for loop).  IMHO, generally in PG, we
>> don't follow this convention.  Is there any specific reason to do
>> this?
>
> +1.

As I said, this C99 feature is already used extensively in pg sources, so
it makes sense to use it when refactoring something and if appropriate,
which IMO is the case here.

Ok, no problem.
 
 
> The patch does not apply on master, needs rebase.

Hmmm. "git apply pgbench-buffer-1.patch" works for me on current master.

> Also, I got some whitespace errors.

It possible, but I cannot see any. Could you be more specific?

For me it failing, see below:

$ git log -1
commit ad4b7aeb84434c958e2df76fa69b68493a889e4a
Author: Peter Eisentraut <peter@eisentraut.org>
Date:   Tue Oct 22 10:35:54 2019 +0200

    Make command order in test more sensible
    
    Through several updates, the CREATE USER command has been separated
    from where the user is actually used in the test.

$ git apply pgbench-buffer-1.patch
pgbench-buffer-1.patch:10: trailing whitespace.
static void append_fillfactor(PQExpBuffer query);
pgbench-buffer-1.patch:18: trailing whitespace.
executeStatementExpect(PGconn *con, const char *sql, const ExecStatusType expected)
pgbench-buffer-1.patch:19: trailing whitespace.
{
pgbench-buffer-1.patch:20: trailing whitespace.
        PGresult   *res;
pgbench-buffer-1.patch:21: trailing whitespace.

error: patch failed: src/bin/pgbench/pgbench.c:599
error: src/bin/pgbench/pgbench.c: patch does not apply

$  

Regards,
Jeevan Ladhe

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: pgbench - refactor init functions with buffers
Next
From: Andrew Dunstan
Date:
Subject: Re: intermittent test failure on Windows