Thread: BUG #15022: Multiple + operators when parsing SQL query

BUG #15022: Multiple + operators when parsing SQL query

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      15022
Logged by:          Victoria Nope
Email address:      victoria.nope@mail.com
PostgreSQL version: 10.1
Operating system:   Windows 7
Description:

When executing query like this:

SELECT 1 +++++++ 1;

parser doesn't complain. Shall we consider this as an issue?


Re: BUG #15022: Multiple + operators when parsing SQL query

From
"David G. Johnston"
Date:
On Fri, Jan 19, 2018 at 3:17 PM, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15022
Logged by:          Victoria Nope
Email address:      victoria.nope@mail.com
PostgreSQL version: 10.1
Operating system:   Windows 7
Description:

When executing query like this:

SELECT 1 +++++++ 1;

parser doesn't complain. Shall we consider this as an issue?


​No.

What that really says is (using just 3 + signs)

1 + (+(+1))

Not much different that writing:

1 + (-(-1))

Which is the same as:

1 + - - 1

(you cannot write 1 + --1 since -- is the comment indicator)

David J.