query works with 4.1.8, but not with 4.1.11

query works with 4.1.8, but not with 4.1.11

am 12.05.2005 12:27:57 von Annemarie Mayer

I found a difference in SQL parsing between MySQL versions 4.1.7 and 4.1.11,
running on a Windows 2003 server, concerning queries with joins, a subquery
and (actually unnecessary) parentheses around the from clause.

To reproduce, execute the following script:

----

CREATE TABLE IF NOT EXISTS T1
( ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
DATA VARCHAR(5) NOT NULL,

PRIMARY KEY (ID)
) ENGINE=INNODB;

CREATE TABLE IF NOT EXISTS T2
( ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
DATA VARCHAR(5) NOT NULL,
FID INT UNSIGNED NOT NULL,

PRIMARY KEY (ID),
FOREIGN KEY (FID)
REFERENCES T1 (ID)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=INNODB;

# works
SELECT A.* FROM (T1 inner join (SELECT * FROM T2) AS A on T1.ID = A.FID);

# works with 4.1.7-nt-max
# throws an SQL parse error with 4.1.11-nt-max
SELECT T2.* FROM ((SELECT * FROM T1) AS A inner join T2 on A.ID = T2.FID);

# works
SELECT T2.* FROM (SELECT * FROM T1) AS A inner join T2 on A.ID = T2.FID;


----

Version 4.1.11 parses the query correctly if the paretheses around the from
clause are removed.

Is this difference intended?

Thank you,
Annemarie Mayer-Retar

--
+++ Neu: Echte DSL-Flatrates von GMX - Surfen ohne Limits +++
Always online ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: query works with 4.1.8, but not with 4.1.11

am 12.05.2005 13:11:02 von Hartmut Holzgraefe

Hello Annemarie,
> I found a difference in SQL parsing between MySQL versions 4.1.7 and 4.1.11,
> running on a Windows 2003 server, concerning queries with joins, a subquery
> and (actually unnecessary) parentheses around the from clause.
[...]
> Is this difference intended?

i don't think that this change was intended. The 4.1.11 behavior is not
valid as far as i can tell.

I have converted your mail into a bug report:

http://bugs.mysql.com/10586

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org