pgbench: fix segfault with empty sql file

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: db94419ffd6833da27176f6cca843483b4515065
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2016-02-12T20:14:45Z
Releases: 9.6.0
pgbench: fix segfault with empty sql file

Commit 1d0c3b3f8a introduced a bug that causes pgbench to crash if an
empty script file is specified.  Fix it by rejecting such files at
startup, which is the historical and intended behavior.

Reported-By: Jeff Janes
Discussion: https://www.postgresql.org/message-id/CAMkU=1zxKUbLPOt9hQWFp14pTc=V0cGo2GQBbn2GsK2Pu+8ZfA@mail.gmail.com

Files

PathChange+/−
src/bin/pgbench/pgbench.c modified +2 −1

Discussion