Re: pgbench: new feature allowing to launch shell commands - Mailing list pgsql-hackers

From Takahiro Itagaki
Subject Re: pgbench: new feature allowing to launch shell commands
Date
Msg-id 20091210172144.1B72.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: pgbench: new feature allowing to launch shell commands  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: pgbench: new feature allowing to launch shell commands  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-hackers
> Michael Paquier <michael.paquier@gmail.com> wrote:
> > Please find attached the latest version of the patch,
> > with the threading bug corrected and the documentation updated as well.

Please don't describe your-specific usage of shell command in the documentation

> Why do you use BUFFER_SIZE-1 for snprintf?
>    snprintf(commandShell, SHELL_COMMAND_SIZE-1, ...)
> Trailing nulls are also included in the length, so
>    snprintf(commandShell, SHELL_COMMAND_SIZE, ...)
> would be ok. (removed -1)

I found several bugs and matters.
  * The calcuration of the shell command length is wrong.
  * You cannot assign 0 to variables with \setshell meta command.
  * Comparison with "== true" is a bad manner.
  * You called \shell "shell command" and \setsell "shell script",
    but we don't need the difference. I think "shell command" is enough.

Heavily cleaned up patch attached. Please review it.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center


Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: explain output infelicity in psql
Next
From: marcin mank
Date:
Subject: Re: bug: fuzzystrmatch levenshtein is wrong