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

Invalid view when its definition uses TVC as single-value subquery

    XMLWordPrintable

Details

    Description

      Select from view fails if definition of view has TVC containing subquery used as a subselect.

      Test:

      create table t1 (a int) engine=myisam;
      insert into t1 values (3), (7), (1);
      create table t2 (b int) engine=myisam;
      insert into t2 values (1), (2);
       
      create view v1 as select (values ((select * from t1 where a > 10))) from t2;
      select * from v1;
       
      drop view v1;
      drop table t1,t2;
      

      Actual result:

      At line 7: query 'select * from v1' failed: 1356: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
      

      Expected result:

      (values ((select * from t1 where a > 10)))
      NULL
      NULL
      

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              lstartseva Lena Startseva
              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.