pgsql: Fix unexpected side-effects of operator_precedence_warning.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix unexpected side-effects of operator_precedence_warning.
Date: 2016-04-22 03:17:47
Message-ID: E1atRbH-0006O3-NT@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix unexpected side-effects of operator_precedence_warning.

The implementation of that feature involves injecting nodes into the
raw parsetree where explicit parentheses appear. Various places in
parse_expr.c that test to see "is this child node of type Foo" need to
look through such nodes, else we'll get different behavior when
operator_precedence_warning is on than when it is off. Note that we only
need to handle this when testing untransformed child nodes, since the
AEXPR_PAREN nodes will be gone anyway after transformExprRecurse.

Per report from Scott Ribe and additional code-reading. Back-patch
to 9.5 where this feature was added.

Report: <ED37E303-1B0A-4CD8-8E1E-B9C4C2DD9A17(at)elevated-dev(dot)com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/abb164655c703a5013b7fcf83f855a071895dc91

Modified Files
--------------
src/backend/parser/parse_expr.c | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2016-04-22 09:22:36 pgsql: Add putenv support for msvcrt from Visual Studio 2013
Previous Message Tom Lane 2016-04-22 00:18:31 Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.