pgbench - very minor bug fix on hash() missing argument

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pgbench - very minor bug fix on hash() missing argument
Date: 2018-07-27 03:16:06
Message-ID: alpine.DEB.2.21.1807262302550.29874@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


While doing something else, I noticed that pgbench's hash() does not fail
gracefully:

sh> cat hash.sql
\set i hash()

sh> pgbench -f hash.sql -t 1
...
cannot coerce (null) to int
client 0 aborted in command 0 (set) of script 0; evaluation of meta-command failed

The message is not very helful. With the attached one-line patch plus
test, it is clearer:

sh> pgbench -f hash.sql -t 1
hash.sql:1: unexpected number of arguments (hash) in command "set"
\set i hash()
^ error found here

Could be backpatched to 11 where hash was introduced.

--
Fabien.

Attachment Content-Type Size
pgbench-hash-nargs-1.patch text/plain 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-07-27 03:22:44 Re: Deprecating, and scheduling removal of, pg_dump's tar format.
Previous Message Christophe Pettus 2018-07-27 03:14:57 Re: Deprecating, and scheduling removal of, pg_dump's tar format.