Skip site navigation (1) Skip section navigation (2)

Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Josh Kupershmidt <schmiddy(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."
Date: 2010-10-30 18:14:10
Message-ID: AANLkTin-5hUogycbPmivrkfU-uUx2cbocT7U9XtrKY-J@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Thu, Oct 28, 2010 at 5:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I experimented a bit with mysql's behavior, and it seems that (at least
> in 5.1.51) what they do is treat "1and" or "2or" as if it were an
> identifier.  They're definitely not throwing an error, at least not on
>

I guess the eleant question is what the lexical elements section of
the standard says about identifiers. It pretty clearly declares that
they can't start with digits:

<identifier body>    ::=  <identifier start> [ <identifier part>... ]
<identifier part>      ::=   <identifier start>  | <identifier extend>
<identifier start>     ::= !! See the Syntax Rules
<identifier extend> ::= !! See the Syntax Rules

1) An <identifier start> is any character in the Unicode General
Category classes “Lu”, “Ll”, “Lt”, “Lm”, “Lo”, or “Nl”.
NOTE 70 — The Unicode General Category classes “Lu”, “Ll”, “Lt”, “Lm”,
“Lo”, and “Nl” are assigned to Unicode characters that are,
respectively, upper-case letters, lower-case letters, title-case
letters, modifier letters, other letters, and letter numbers.

2) An <identifier extend> is U+00B7, “Middle Dot”, or any character in
the Unicode General Category classes “Mn”, “Mc”, “Nd”, “Pc”, or “Cf”.
NOTE 71 — The Unicode General Category classes “Mn”, “Mc”, “Nd”, “Pc”,
and “Cf” are assigned to Unicode characters that are, respectively,
nonspacing marks, spacing combining marks, decimal numbers, connector
punctuations, and formatting codes.


-- 
greg

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-10-30 18:23:51
Subject: Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."
Previous:From: Dave PageDate: 2010-10-30 17:33:56
Subject: Re: BUG #5735: pg_upgrade thinks that it did not start the old server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group