Hello Michaël,
Two rebase attached.
>> - 15-e: prefix selection for -b
> - if (strncmp(builtin_script[i].name, name,
> - strlen(builtin_script[i].name)) == 0)
> + if (strncmp(builtin_script[i].name, name, len) == 0)
>
> I agree with Alvaro here: this should remain unchanged. It seems to be
> a rebase mistake.
I do not understand. I tested it and it works as expected. If I put the
above strlen instead the suffix detection does not work:
fabien@sto:bin/pgbench> git diff diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index
783cbf9..0c33012100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -2684,7 +2684,7 @@
findBuiltin(constchar *name, char **desc)
for (i = 0; i < N_BUILTIN; i++) { - if (strncmp(builtin_script[i].name, name, len) == 0)
+ if (strncmp(builtin_script[i].name, name, strlen(builtin_script[i].name)) == 0) {
*desc = builtin_script[i].desc; commands = builtin_script[i].commands;
./pgbench -b t no builtin script found for name "t" Available builtin scripts: tpcb-like simple-update
select-only
Indeed, then it can only match if the provided "name" is as long as the
recorded len. The point of the "suffix" selection is to align to the short
supplied string.
--
Fabien.