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

SELECT FOR UPDATE with UNION should not need parenthesis

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

            mpflaum Maria M Pflaum (Inactive) created issue -
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            Key MENT-871 MDEV-23203
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.5 [ 23123 ]
            Affects Version/s 10.4.13-7 [ 24242 ]
            Project MariaDB Enterprise [ 11500 ] MariaDB Server [ 10000 ]
            serg Sergei Golubchik made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            serg Sergei Golubchik made changes -
            Assignee Oleksandr Byelkin [ sanja ]
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            serg Sergei Golubchik made changes -
            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);
            In 10.3 this statement works:
            {code:sql}
            select id1 from t1 for update
            union
            select id2 from t2 for update
            {code}
            But in 10.4 it gives this error:
            {noformat}
            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
            {noformat}
            If I use parenthesis it works:
            {code:sql}
            (select id1 from t1 for update) union (select id2 from t2 for update);
            {code}
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Component/s Parser [ 10201 ]
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Won't Fix [ 2 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 111374 ] MariaDB v4 [ 158106 ]
            Dean T Dean Trower made changes -
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 131867

            People

              sanja Oleksandr Byelkin
              mpflaum Maria M Pflaum (Inactive)
              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.