1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Fix backwards test in operator_precedence_warning logic.

Warnings about unary minus might have been wrong.  It's a bit
surprising that nobody noticed yet ... probably the precedence-warning
feature hasn't really been used much in the field.

Rikard Falkeborn

Discussion: https://postgr.es/m/CADRDgG6fzA8A2oeygUw4=o7ywo4kvz26NxCSgpq22nMD73Bx4Q@mail.gmail.com
This commit is contained in:
Tom Lane
2019-04-10 19:02:21 -04:00
parent 09630a1e96
commit 62d4953956

View File

@ -2983,7 +2983,7 @@ operator_precedence_group(Node *node, const char **nodename)
*nodename = strVal(linitial(aexpr->name));
/* Ignore if op was always higher priority than IS-tests */
if (strcmp(*nodename, "+") == 0 ||
strcmp(*nodename, "-"))
strcmp(*nodename, "-") == 0)
group = 0;
else
group = PREC_GROUP_PREFIX_OP;