From: | David Rio Deiros <driodeiros(at)gmail(dot)com> |
---|---|
To: | Michael Fuhr <mike(at)fuhr(dot)org> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jaime Casanova <systemguards(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, is04607(at)salleurl(dot)edu |
Subject: | Re: swap relations to be able to execute a left join |
Date: | 2005-12-09 20:09:17 |
Message-ID: | 20051209200917.GA10327@milhouse.digitaria.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, Dec 09, 2005 at 12:29:02PM -0700, Michael Fuhr wrote:
> On Fri, Dec 09, 2005 at 02:17:59PM -0500, Tom Lane wrote:
> > Michael Fuhr <mike(at)fuhr(dot)org> writes:
> > > Hmm...I get errors in MySQL 5.0.16 with the query as posted so I
> > > have to wonder what the real query was.
> >
> > (tries it...) After removing the bogus comma, MySQL 4.1.14 swallows
> > the query without complaint, so it would seem that MySQL finally fixed
> > this bug at 5.0. I wonder what the OP's coworker will say when he tries
> > to migrate his code to 5.0 ...
>
> Here we go:
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> "Before MySQL 5.0.12, the comma operator (,) and JOIN both had the same
> precedence, so the join expression t1, t2 JOIN t3 was intrepreted as
> ((t1, t2) JOIN t3). Now JOIN has higher precedence, so the expression is
> interpreted as (t1, (t2 JOIN t3))."
Michael, Jaime, Tom, thanks for you answers.
Sorry for the bogus comma. The query had initially more fields in the select
but I just removed them to make the query smaller. I missed to remove that
comma.
This is what I am going to send to my coworker:
I think you may want to be interested in the reply that I am going to send
to my coworker:
-----------
Dear Mr I love mysql,
Your query worked in mysql (versions prior to 5.0.12) because Mysql was
not following the sql standard. So you were relying in a bug
and not in a feature. Luckily that bug has been fixed in the latest
mysql release:
http://dev.mysql.com/doc/refman/5.0/en/join.html
"Before MySQL 5.0.12, the comma operator (,) and JOIN both had the same
precedence, so the join expression t1, t2 JOIN t3 was interpreted as
((t1, t2) JOIN t3). Now JOIN has higher precedence, so the expression is
interpreted as (t1, (t2 JOIN t3))."
---------
Thanks again,
David
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Browne | 2005-12-09 20:27:15 | Re: find last day of month |
Previous Message | Michael Fuhr | 2005-12-09 19:29:02 | Re: swap relations to be able to execute a left join |