Re: Suspicious strcmp() in src/backend/parser/parse_expr.c
От | Andrew Gierth |
---|---|
Тема | Re: Suspicious strcmp() in src/backend/parser/parse_expr.c |
Дата | |
Msg-id | 87pnptwl1a.fsf@news-spur.riddles.org.uk обсуждение исходный текст |
Ответ на | Suspicious strcmp() in src/backend/parser/parse_expr.c (Rikard Falkeborn <rikard.falkeborn@gmail.com>) |
Ответы |
Re: Suspicious strcmp() in src/backend/parser/parse_expr.c
|
Список | pgsql-bugs |
>>>>> "Rikard" == Rikard Falkeborn <rikard.falkeborn@gmail.com> writes: Rikard> In src/backend/parser/parse_expr.c the following snippet of code is found Rikard> (lines 3238-3242, rev 765525c8c2c6e55abe): Rikard> if (strcmp(*nodename, "+") == 0 || Rikard> strcmp(*nodename, "-")) // <-- notice the lack of comparisson Rikard> here Rikard> group = 0; Rikard> else Rikard> group = PREC_GROUP_PREFIX_OP; Rikard> Should the second part of the || be strcmp(*nodename, "-") == Rikard> 0? Yes it should. The effect of this bug is to produce a false operator precedence warning when those are enabled, like so: postgres=# set operator_precedence_warning = on; SET postgres=# select -random() is null; WARNING: operator precedence change: IS is now lower precedence than - when in fact "-random() is null" always did parse as "(-random()) is null" making the warning spurious. -- Andrew (irc:RhodiumToad)
В списке pgsql-bugs по дате отправления: