mirror of
https://github.com/postgres/postgres.git
synced 2026-06-11 01:30:11 -04:00
Fix latent bug in get_stats_option_name()
The function is supposed to look at the passed in 'arg' argument, but peeks at the 'optarg' global variable that's part of getopt() instead. It happened to work anyway, because all callers passed 'optarg' as the argument. Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://www.postgresql.org/message-id/d1da5f0e-0d68-47c9-a882-eb22f462752f@iki.fi
This commit is contained in:
parent
50eb5faea2
commit
c5f7820e57
1 changed files with 2 additions and 2 deletions
|
|
@ -3796,9 +3796,9 @@ get_stats_option_name(const char *arg)
|
|||
switch (arg[0])
|
||||
{
|
||||
case 'p':
|
||||
if (optarg[1] == 'a') /* "parser" */
|
||||
if (arg[1] == 'a') /* "parser" */
|
||||
return "log_parser_stats";
|
||||
else if (optarg[1] == 'l') /* "planner" */
|
||||
else if (arg[1] == 'l') /* "planner" */
|
||||
return "log_planner_stats";
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue