Re: pgbench - refactor init functions with buffers

Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>

From: Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2019-10-22T09:21:47Z
Lists: pgsql-hackers
>
>
> 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.

The patch does not apply on master, needs rebase.
Also, I got some whitespace errors.

I think you can also refactor the function tryExecuteStatement(), and
call your newly added function executeStatementExpect() by passing
an additional flag something like "errorOK".

Regards,
Jeevan Ladhe

Commits

  1. pgbench: Use PQExpBuffer to simplify code that constructs SQL.

  2. Make command order in test more sensible