Re: pgbench - refactor init functions with buffers

From: Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - refactor init functions with buffers
Date: 2019-10-22 11:33:30
Message-ID: CAOgcT0McCGNw5Fo1uPnROVaE72Rhnm59EfQrTSBEixHDX2vuUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 22, 2019 at 4:36 PM Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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(at)eisentraut(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2019-10-22 12:22:58 Re: intermittent test failure on Windows
Previous Message Dilip Kumar 2019-10-22 11:27:58 Re: pgbench - refactor init functions with buffers