pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Improve scripting language in pgbench
5+ messages / 4 participants
[nested] [flat]

* pgsql: Improve scripting language in pgbench
@ 2018-01-09 15:02 Teodor Sigaev <teodor@sigaev.ru>
  2018-01-10 06:12 ` Re: pgsql: Improve scripting language in pgbench Thomas Munro <thomas.munro@enterprisedb.com>
  2018-01-10 12:36 ` Re: pgsql: Improve scripting language in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 2 replies; 5+ messages in thread

From: Teodor Sigaev @ 2018-01-09 15:02 UTC (permalink / raw)
  To: pgsql-committers

Improve scripting language in pgbench

Added:
 - variable now might contain integer, double, boolean and null values
 - functions ln, exp
 - logical AND/OR/NOT
 - bitwise AND/OR/NOT/XOR
 - bit right/left shift
 - comparison operators
 - IS [NOT] (NULL|TRUE|FALSE)
 - conditional choice (in form of when/case/then)

New operations and functions allow to implement more complicated test scenario.

Author: Fabien Coelho with minor editorization by me
Reviewed-By: Pavel Stehule, Jeevan Ladhe, me
Discussion: https://www.postgresql.org/message-id/flat/alpine.DEB.2.10.1604030742390.31618@sto

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bc7fa0c15c590ddf4872e426abd76c2634f22aca

Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml                | 223 +++++++++++-
src/bin/pgbench/exprparse.y                  | 195 ++++++++++-
src/bin/pgbench/exprscan.l                   |  55 ++-
src/bin/pgbench/pgbench.c                    | 484 +++++++++++++++++++++++----
src/bin/pgbench/pgbench.h                    |  24 +-
src/bin/pgbench/t/001_pgbench_with_server.pl | 171 ++++++++--
6 files changed, 1026 insertions(+), 126 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Improve scripting language in pgbench
  2018-01-09 15:02 pgsql: Improve scripting language in pgbench Teodor Sigaev <teodor@sigaev.ru>
@ 2018-01-10 06:12 ` Thomas Munro <thomas.munro@enterprisedb.com>
  2018-01-10 08:36   ` Re: pgsql: Improve scripting language in pgbench Teodor Sigaev <teodor@sigaev.ru>
  1 sibling, 1 reply; 5+ messages in thread

From: Thomas Munro @ 2018-01-10 06:12 UTC (permalink / raw)
  To: Teodor Sigaev <teodor@sigaev.ru>; +Cc: pgsql-committers

On Wed, Jan 10, 2018 at 4:02 AM, Teodor Sigaev <teodor@sigaev.ru> wrote:
> Improve scripting language in pgbench

Hi Teodor,

I think this commit might have lost a fix from
0aa1d489ea756b96b6d5573692ae9cd5d143c2a5.  bowerbird and jacana now
fail when they see an unexpected "0" before the exponent:

Jan 09 11:49:51 # debug(script=0,command=29): double 1e+030
...
Jan 09 11:49:51 #     doesn't match '(?-xism:command=29.: double 1e\+30\b)'

I think you need to put "0?" back into the pattern like in the attached.

-- 
Thomas Munro
http://www.enterprisedb.com

Attachments:

fix.patch (application/octet-stream, 583B) download diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl index e5793349149..a8b2962bd08 100644 --- a/src/bin/pgbench/t/001_pgbench_with_server.pl +++ b/src/bin/pgbench/t/001_pgbench_with_server.pl @@ -239,7 +239,7 @@ pgbench( qr{command=26.: double -0.125\b}, qr{command=27.: double -0.00032\b}, qr{command=28.: double 8.50705917302346e\+0?37\b}, - qr{command=29.: double 1e\+30\b}, + qr{command=29.: double 1e\+0?30\b}, qr{command=30.: boolean false\b}, qr{command=31.: boolean true\b}, qr{command=32.: int 32\b},
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: pgsql: Improve scripting language in pgbench
  2018-01-09 15:02 pgsql: Improve scripting language in pgbench Teodor Sigaev <teodor@sigaev.ru>
  2018-01-10 06:12 ` Re: pgsql: Improve scripting language in pgbench Thomas Munro <thomas.munro@enterprisedb.com>
@ 2018-01-10 08:36   ` Teodor Sigaev <teodor@sigaev.ru>
  0 siblings, 0 replies; 5+ messages in thread

From: Teodor Sigaev @ 2018-01-10 08:36 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@enterprisedb.com>; +Cc: pgsql-committers

Thank you very much, applied

Thomas Munro wrote:
> On Wed, Jan 10, 2018 at 4:02 AM, Teodor Sigaev <teodor@sigaev.ru> wrote:
>> Improve scripting language in pgbench
> 
> Hi Teodor,
> 
> I think this commit might have lost a fix from
> 0aa1d489ea756b96b6d5573692ae9cd5d143c2a5.  bowerbird and jacana now
> fail when they see an unexpected "0" before the exponent:
> 
> Jan 09 11:49:51 # debug(script=0,command=29): double 1e+030
> ...
> Jan 09 11:49:51 #     doesn't match '(?-xism:command=29.: double 1e\+30\b)'
> 
> I think you need to put "0?" back into the pattern like in the attached.
> 

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Improve scripting language in pgbench
  2018-01-09 15:02 pgsql: Improve scripting language in pgbench Teodor Sigaev <teodor@sigaev.ru>
@ 2018-01-10 12:36 ` Fabien COELHO <coelho@cri.ensmp.fr>
  2018-01-23 17:32   ` Re: pgsql: Improve scripting language in pgbench Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Fabien COELHO @ 2018-01-10 12:36 UTC (permalink / raw)
  To: Teodor Sigaev <teodor@sigaev.ru>; +Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>


Hello Teodor,

I just noticed while rebasing stuff that there is some crust in 
"pgbench/t/001_pgbench_with_server.pl" coming from this patch:

  +=head
  +
  +} });
  +
  +=cut

I cannot find any use for these lines which are ignored by perl execution 
anyway. It may be some leftovers from debugging which got past everyone. 
If so, I think that it is better removed, see the attached cleanup patch.

-- 
Fabien.

Attachments:

pgbench-tap-test-typo.patch (text/x-diff, 392B) download diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl index a8b2962..99286f6 100644 --- a/src/bin/pgbench/t/001_pgbench_with_server.pl +++ b/src/bin/pgbench/t/001_pgbench_with_server.pl @@ -340,12 +340,6 @@ pgbench( SELECT :v0, :v1, :v2, :v3; } }); -=head - -} }); - -=cut - # backslash commands pgbench( '-t 1', 0,
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: pgsql: Improve scripting language in pgbench
  2018-01-09 15:02 pgsql: Improve scripting language in pgbench Teodor Sigaev <teodor@sigaev.ru>
  2018-01-10 12:36 ` Re: pgsql: Improve scripting language in pgbench Fabien COELHO <coelho@cri.ensmp.fr>
@ 2018-01-23 17:32   ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2018-01-23 17:32 UTC (permalink / raw)
  To: Fabien COELHO <coelho@cri.ensmp.fr>; Teodor Sigaev <teodor@sigaev.ru>; +Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>

On 1/10/18 07:36, Fabien COELHO wrote:
> I just noticed while rebasing stuff that there is some crust in 
> "pgbench/t/001_pgbench_with_server.pl" coming from this patch:
> 
>   +=head
>   +
>   +} });
>   +
>   +=cut
> 
> I cannot find any use for these lines which are ignored by perl execution 
> anyway. It may be some leftovers from debugging which got past everyone. 
> If so, I think that it is better removed, see the attached cleanup patch.

fixed

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-01-23 17:32 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 15:02 pgsql: Improve scripting language in pgbench Teodor Sigaev <teodor@sigaev.ru>
2018-01-10 06:12 ` Thomas Munro <thomas.munro@enterprisedb.com>
2018-01-10 08:36   ` Teodor Sigaev <teodor@sigaev.ru>
2018-01-10 12:36 ` Fabien COELHO <coelho@cri.ensmp.fr>
2018-01-23 17:32   ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

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