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

Unexpected error message when selecting from view that uses mergeable derived table

Details

    Description

      The following test case demonstrates the problem:

      drop database test;
      create database test;
      create table test.t1 (a int);
      insert into test.t1 values (3),(7),(1);
      create view test.v2 as select * from (select * from test.t1) as t;
      select test.v2.a from test.v2;
      

      MariaDB [(none)]> select test.v2.a from test.v2;
      ERROR 1356 (HY000): View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them                                                                                                                 

      Attachments

        Issue Links

          Activity

            Sanja:
            Most probably the bug exists starting from:

            commit 7166069537a4e18d4c0848655fcbc0c8ee568fd4
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date:   Thu Feb 25 14:55:04 2016 +0100
             
                MDEV-3944: Allow derived tables in VIEWS
            

            I made a checkout for this commit. Yet the tree after this commit was not in a good shape as I got:

            MariaDB [(none)]> create view test.v2 as select * from (select * from test.t1) as t;
            ERROR 1142 (42000): ANY command denied to user ''@'' for table '*'
            

            I marked this bug as "Critical" because MDEV-22781 is marked as 'Critical'.
            MDEV-22781 is crashing, but I checked it against my fix for MDEV-22886 and there I had the same error message as for MDEV-24314.

            igor Igor Babaev (Inactive) added a comment - Sanja: Most probably the bug exists starting from: commit 7166069537a4e18d4c0848655fcbc0c8ee568fd4 Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Thu Feb 25 14:55:04 2016 +0100   MDEV-3944: Allow derived tables in VIEWS I made a checkout for this commit. Yet the tree after this commit was not in a good shape as I got: MariaDB [(none)]> create view test.v2 as select * from (select * from test.t1) as t; ERROR 1142 (42000): ANY command denied to user ''@'' for table '*' I marked this bug as "Critical" because MDEV-22781 is marked as 'Critical'. MDEV-22781 is crashing, but I checked it against my fix for MDEV-22886 and there I had the same error message as for MDEV-24314 .

               if (all_tables)
                  res= check_table_access(thd,
                                          privileges_requested,
                                          all_tables, FALSE, UINT_MAX, FALSE);
                else
            

            correctly assign privileges and detect that all required given

            sanja Oleksandr Byelkin added a comment - if (all_tables) res= check_table_access(thd, privileges_requested, all_tables, FALSE, UINT_MAX, FALSE); else correctly assign privileges and detect that all required given

            OK to push

            sanja Oleksandr Byelkin added a comment - OK to push

            A fix for this bug was pushed into 10.2

            igor Igor Babaev (Inactive) added a comment - A fix for this bug was pushed into 10.2

            People

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