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

SELECT FOR UPDATE with UNION should not need parenthesis

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 10.4, 10.5
    • Fix Version/s: N/A
    • Component/s: Parser
    • Labels:
      None
    • Environment:
      ALL - but found on CentOS Linux release 7.4.1708 (Core)

      Description

      In 10.3 this statement works:

      select id1 from t1 for update
      union
      select id2 from t2 for update
      

      But in 10.4 it gives this error:

      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 'union
      select id2 from t2 for update' at line 2
      

      If I use parenthesis it works:

      (select id1 from t1 for update) union (select id2 from t2 for update);
      

        Attachments

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            mpflaum Maria M Pflaum
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: