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

User has access to vector info in VECTOR_INDEXES without access to column

    XMLWordPrintable

Details

    Description

      The test compares access to VECTOR_INDEXES vs STATISTICS and TABLE_CONSTRAINTS: in each case a user has access to a column in the table, but not to the indexed column. The data in STATISTICS and TABLE_CONSTRAINTS remains invisible to the user, but VECTOR_INDEXES shows the info.

      create database db;
      create table db.t(
        a int not null,
        b int not null,
        c int not null,
        v vector(1) not null,
        key(b),
        unique(c),
        vector(v)
      );
      create user u;
      grant select(a) on db.t to u;
       
      --connect(con1,localhost,u,,)
      select a from db.t;
      --error ER_COLUMNACCESS_DENIED_ERROR
      select b from db.t;
      --error ER_COLUMNACCESS_DENIED_ERROR
      select c from db.t;
      --error ER_COLUMNACCESS_DENIED_ERROR
      select v from db.t;
      select table_name, index_name from information_schema.statistics
        where table_schema = 'db';
      select table_name, constraint_name from information_schema.table_constraints
        where table_schema = 'db';
      select table_name, index_name from information_schema.vector_indexes
        where table_schema = 'db';
       
      --disconnect con1
      --connection default
      drop database db;
      drop user u;
      

      PR 4955 7a32192edb0a2a48815f2161254d7d282aeece38

      create database db;
      create table db.t(
      a int not null,
      b int not null,
      c int not null,
      v vector(1) not null,
      key(b),
      unique(c),
      vector(v)
      );
      create user u;
      grant select(a) on db.t to u;
      connect con1,localhost,u,,;
      select a from db.t;
      a
      select b from db.t;
      ERROR 42000: SELECT command denied to user 'u'@'localhost' for column 'b' in table 't'
      select c from db.t;
      ERROR 42000: SELECT command denied to user 'u'@'localhost' for column 'c' in table 't'
      select v from db.t;
      ERROR 42000: SELECT command denied to user 'u'@'localhost' for column 'v' in table 't'
      select table_name, index_name from information_schema.statistics
      where table_schema = 'db';
      table_name      index_name
      select table_name, constraint_name from information_schema.table_constraints
      where table_schema = 'db';
      table_name      constraint_name
      select table_name, index_name from information_schema.vector_indexes
      where table_schema = 'db';
      table_name      index_name
      t       v
      disconnect con1;
      connection default;
      drop database db;
      drop user u;
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.