pgbench: Restore compatibility of --partitions=0
authorMichael Paquier <michael@paquier.xyz>
Wed, 18 May 2022 00:47:38 +0000 (09:47 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 18 May 2022 00:47:38 +0000 (09:47 +0900)
A value of 0 is allowed for this option since its creation, that would
map with the default of having no partitions for pgbench_accounts, but
6f164e6 broke that by enforcing an error.  This commit restores the
original behavior.

Author: Amit Langote
Discussion: https://postgr.es/m/CA+HiwqGAGobiiHR8nH382HJxqm1mzZs8=3oKPXnXivWoFSZmNA@mail.gmail.com

src/bin/pgbench/pgbench.c

index 79c0cd374d35a2ef359bd2ce6b2d94e45c85cd02..fbb74bdc4c4ced61e0c4f6fd4a70ff161e0dd17f 100644 (file)
@@ -6865,7 +6865,7 @@ main(int argc, char **argv)
                                break;
                        case 11:                        /* partitions */
                                initialization_option_set = true;
-                               if (!option_parse_int(optarg, "--partitions", 1, INT_MAX,
+                               if (!option_parse_int(optarg, "--partitions", 0, INT_MAX,
                                                                          &partitions))
                                        exit(1);
                                break;