pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ladayaroslav@yandex.ru
Subject: BUG #15273: Lexer bug with UESCAPE
Date: Tue, 10 Jul 2018 17:15:13 +0000
Message-ID: <153124291307.1408.15617588871690313363@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15273
Logged by:          Yaroslav Schekin
Email address:      ladayaroslav@yandex.ru
PostgreSQL version: 10.4
Operating system:   Any
Description:        

Hello. 

Compare this:
> SELECT U&'a' UESCAPE 'x';
----------
 a
(1 row)
To this:
> SELECT U&'a' /*c1*/ UESCAPE /*c2*/ 'x';

ERROR:  syntax error at or near "'x'"
LINE 1: SELECT U&'a' /*c1*/ UESCAPE /*c2*/ 'x';
                                           ^
I think the former is a bug, as, per ISO SQL, a comment is equivalent to
whitespace (with newline), and therefore, should be ignored here.

(Thanks a lot to RhodiumToad who not only initially found and documented
https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL_Standard#Lexing_of_split_string_literals,
but also discussed it with me on IRC and conducted the investigation of
relevant SQL standards.)

-- 
WBR, Yaroslav Schekin.



view thread (6+ messages)  latest in thread

Message-ID: <153124291307.1408.15617588871690313363@wrigleys.postgresql.org>
Permalink:  ../153124291307.1408.15617588871690313363@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/153124291307.1408.15617588871690313363@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, ladayaroslav@yandex.ru
  Subject: Re: BUG #15273: Lexer bug with UESCAPE
  In-Reply-To: <153124291307.1408.15617588871690313363@wrigleys.postgresql.org>
  References: <153124291307.1408.15617588871690313363@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox