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

ERROR 1060 (42S21) Duplicate column name 'id'

Details

    Description

      Union sql returns an error when there are brackets and does not return an error when there are no brackets.

      Preparing:

      CREATE TABLE del (`id` bigint(20));
      INSERT INTO del VALUES(1);
      

      Error "ERROR 1060 (42S21) Duplicate column name 'id'":

      (
          (select a.id, b.id from del a join del b on a.id=b.id)
               union all
          (select a.id, b.id from del a join del b on a.id=b.id)
      )
        union all
      (select a.id, b.id from del a join del b on a.id=b.id);
      

      No error:

      (select a.id, b.id from del a join del b on a.id=b.id)
              union all
      (select a.id, b.id from del a join del b on a.id=b.id)
              union all
      (select a.id, b.id from del a join del b on a.id=b.id);
      

      Attachments

        Activity

          max begemot max begemot added a comment -

          mysql does not return an error

          max begemot max begemot added a comment - mysql does not return an error

          People

            sanja Oleksandr Byelkin
            max begemot max begemot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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