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

SELECT FOR UPDATE with UNION should not need parenthesis

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Won't Fix
    • 10.4(EOL), 10.5
    • N/A
    • Parser
    • None
    • 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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.