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

mtr --view prints Name_exp_1 instead of query body for scalar subquery

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.6
    • N/A
    • Tests
    • None
    • Not for Release Notes

    Description

      Reproduce

      mtr --view for the below test:

      select (
        with recursive r as (
          select * from (
            with a as (
                select * from r
            )
            select 1
          ) y
       
          union
       
          select 1
        )
        (select * from r)
      );
      

      Result

      Instead of query body as column name it prints Name_exp_1:

      select (
      with recursive r as (
      select * from (
      with a as (
      select * from r
      )
      select 1
      ) y
      union
      select 1
      )
      (select * from r)
      );
      Name_exp_1
      1
      

      Diff from result in normal mode:

      --- /home/midenok/src/mariadb/10.5b/src/mysql-test/suite/bug/r/32299-2.result   2025-06-30 13:31:36.554264976 +0300
      +++ /home/midenok/src/mariadb/10.5b/src/mysql-test/suite/bug/r/32299-2.reject   2025-06-30 13:31:43.890156346 +0300
      @@ -11,17 +11,5 @@
       )
       (select * from r)
       );
      -(
      -with recursive r as (
      -select * from (
      -with a as (
      -select * from r
      -)
      -select 1
      -) y
      -union
      -select 1
      -)
      -(select * from r)
      -)
      +Name_exp_1
       1
      

      Notes

      That doesn't happen for short subquery:

      select (
        select 1
      );
      

      results:

      select (
      select 1
      );
      (
      select 1
      )
      1
      

      Attachments

        Activity

          People

            lstartseva Lena Startseva
            midenok Aleksey Midenkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.