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

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

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

            lstartseva Lena Startseva created issue -
            lstartseva Lena Startseva made changes -
            Field Original Value New Value
            lstartseva Lena Startseva made changes -
            Labels view-protocol
            lstartseva Lena Startseva made changes -
            Assignee Lena Startseva [ JIRAUSER50478 ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Igor Babaev [ igor ]
            sanja Oleksandr Byelkin made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            igor Igor Babaev (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            igor Igor Babaev (Inactive) made changes -
            Summary Select from view fails if definition of view has TVC containing subquery used as a subselect Invalid view when its definition uses TVC as single-value subquery
            igor Igor Babaev (Inactive) made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.10 [ 27530 ]
            igor Igor Babaev (Inactive) made changes -
            Assignee Igor Babaev [ igor ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Igor Babaev [ igor ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            igor Igor Babaev (Inactive) made changes -
            Component/s Views [ 10111 ]
            Fix Version/s 10.4.29 [ 28510 ]
            Fix Version/s 10.5.20 [ 28512 ]
            Fix Version/s 10.6.13 [ 28514 ]
            Fix Version/s 10.8.8 [ 28518 ]
            Fix Version/s 10.9.6 [ 28520 ]
            Fix Version/s 10.10.4 [ 28522 ]
            Fix Version/s 10.11.3 [ 28524 ]
            Fix Version/s 11.0.2 [ 28706 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

              igor Igor Babaev (Inactive)
              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.