pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: pgbench - minor fix for meta command only scripts
Date: Mon, 11 Jul 2016 07:10:07 +0200 (CEST)
Message-ID: <alpine.DEB.2.20.1607110653460.12659@sto> (raw)
In-Reply-To: <CAB7nPqRZmRbsfdShOLPMGuqU3BeZFbYG5u0jsXv1q+LxLsP5uw@mail.gmail.com>
References: <alpine.DEB.2.20.1607090850120.3412@sto>
	<CAB7nPqRZmRbsfdShOLPMGuqU3BeZFbYG5u0jsXv1q+LxLsP5uw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


Hello Michaƫl,

> You may want to name your patches with .patch or .diff. Using .sql is 
> disturbing style :)

Indeed! :-)

> Indeed, not reporting the progress back to the client in the case of a
> script with only meta commands is non-intuitive.
>
> This looks good to me. I'd just rewrite the comment block with
> something like that, more simplified:

Ok. Here is an updated version, with a better suffix and a simplified 
comment.

Thanks,

-- 
Fabien.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgbench-no-sql-fix-2.patch (text/x-diff, 524B) download diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 87fb006..4e7449e 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -2172,8 +2172,12 @@ top: st->listen = true; } - /* after a meta command, immediately proceed with next command */ - goto top; + /* + * After a meta command immediately proceed with next command, + * but if it is the last command, just leave. + */ + if (commands[st->state + 1] != NULL) + goto top; } return true;

view thread (22+ messages)  latest in thread

Message-ID: <alpine.DEB.2.20.1607110653460.12659@sto>
Permalink:  ../alpine.DEB.2.20.1607110653460.12659@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.20.1607110653460.12659@sto

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: coelho@cri.ensmp.fr, michael.paquier@gmail.com
  Subject: Re: pgbench - minor fix for meta command only scripts
  In-Reply-To: <alpine.DEB.2.20.1607110653460.12659@sto>
  References: <alpine.DEB.2.20.1607090850120.3412@sto> <CAB7nPqRZmRbsfdShOLPMGuqU3BeZFbYG5u0jsXv1q+LxLsP5uw@mail.gmail.com> <alpine.DEB.2.20.1607110653460.12659@sto>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox