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

Table value constructor does not work in self join

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.4(EOL)
    • N/A
    • None
    • None
    • Windows 10

    Description

      The following statement does not work:

      WITH t1(wert) AS (VALUES (1), (2))
      SELECT *
      		FROM t1 AS tab1
      	INNER JOIN t1 AS tab2
      	ON tab1.wert = tab2.wert;
      

      It should give the table

      1 1
      2 2

      since self-joins are not forbidden.
      But instead of the correct result, an error message is given:

      SQL Error (1054): Unknown column 'tab2.wert' in 'on clause'.

      Note that table value constructors are documented here.

      The error may occur in other versions besides 10.4 too.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Friedrich Friedrich Spee
            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.