Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-332

lp:1010729 Unexpected syntax error for a query with UNION of left joins

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.24
    • Fix Version/s: 5.5.25
    • Component/s: None
    • Labels:
      None

      Description

      The following sequence of commands gives us an unexpected error message in MariaDB 5.5:

      CREATE TABLE t1 (a int);
      CREATE TABLE t2 (b int);
      CREATE TABLE t3 (c int);
      SELECT a FROM t1 UNION SELECT b FROM t2 JOIN (t3) ON ( t2.b = t3.c );
      
      MariaDB [test]> SELECT a FROM t1 UNION SELECT b FROM t2 JOIN (t3) ON ( t2.b = t3.c );
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON ( t2.b = t3.c )' at line 1
      

      If we exchange SELECT clauses in the above UNION the query will be accepted though:

      MariaDB [test]> SELECT b FROM t2 JOIN (t3) ON ( t2.b = t3.c ) UNION SELECT a FROM t1;
      Empty set (0.00 sec)
      

      The versions MariaDB 5.2/5.3 are not affected, while mysql-5.5 is affected: see http://bugs.mysql.com/bug.php?id=54382

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            This was fixed and pushed.

            Show
            psergey Sergei Petrunia added a comment - This was fixed and pushed.

              People

              • Assignee:
                igor Igor Babaev
                Reporter:
                serg Sergei Golubchik
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: