aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson <dgustafsson@postgresql.org>2021-08-18 11:23:43 +0200
committerDaniel Gustafsson <dgustafsson@postgresql.org>2021-08-18 11:23:43 +0200
commit500256d953444628164f0b77ef1ce8c9e05e575f (patch)
treeae229f6cd0dd159785ce21c3fdb7284f39c6e770
parent6b71c925cb817f79cb0d389edacdd033efaa301d (diff)
downloadpostgresql-500256d953444628164f0b77ef1ce8c9e05e575f.tar.gz
postgresql-500256d953444628164f0b77ef1ce8c9e05e575f.zip
Fix pg_amcheck --skip option parameter handling
The skip options set for all-visible and all-frozen were incorrect as they used space rather than hyphen, causing a syntax error when invoked. Also, the option for not skipping any pages at all, none, was documented but not implemented. Backpatch through 14 where pg_amcheck was introduced. Bug: #17149 Reported-by: Chen Jiaoqian <chenjq.jy@fujitsu.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Discussion: https://postgr.es/m/17149-5918ea748da36b15@postgresql.org Backpatch-through: 14
-rw-r--r--src/bin/pg_amcheck/pg_amcheck.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index bcb02db4958..a86a1c09878 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -395,9 +395,11 @@ main(int argc, char *argv[])
break;
case 6:
if (pg_strcasecmp(optarg, "all-visible") == 0)
- opts.skip = "all visible";
+ opts.skip = "all-visible";
else if (pg_strcasecmp(optarg, "all-frozen") == 0)
- opts.skip = "all frozen";
+ opts.skip = "all-frozen";
+ else if (pg_strcasecmp(optarg, "none") == 0)
+ opts.skip = "none";
else
{
pg_log_error("invalid argument for option %s", "--skip");