query works with 4.1.8, but not with 4.1.11
"Annemarie Mayer-Retar" <[email protected]> Thu, 12 May 2005 12:27:57 +0200 (MEST)
| Newsgroups | gmane.comp.db.mysql.bugs |
|---|---|
| Message-ID | <[email protected]> |
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/[email protected]