[PATCH] pgbench: improve \sleep meta command
miyake_kouta <miyake_kouta@oss.nttdata.com>
From: miyake_kouta <miyake_kouta@oss.nttdata.com>
To: Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-05T01:51:04Z
Lists: pgsql-hackers
Attachments
- v01_pgbench_sleep.patch (text/x-diff) patch v1
Hi. I created a patch to improve \sleep meta command in pgbench. There are two problems with the current pgbench implementation of \sleep. First, when the input is like "\sleep foo s" , this string will be treated as 0 through atoi function, and no error will be raised. Second, when the input is like "\sleep :some_bool s" and some_bool is set to True or False, this bool will be treated as 0 as well. However, I think we should catch this error, so I suggest my patch to detect this and raise errors. Regards. -- Kota Miyake
Commits
-
pgbench: Improve error-handling in \sleep command.
- 8c6eda2d1c92 14.0 landed