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

ER_DBACCESS_DENIED_ERROR for Spider and Federated tables on test db

    XMLWordPrintable

Details

    Description

      The following testcase will pass before MDEV-5215:

      --let $SOCKET=`SELECT @@global.socket`
      --source include/have_innodb.inc
      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER u@localhost IDENTIFIED BY 'a';
      eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$SOCKET",DATABASE 'test',user 'u',PASSWORD 'a');
      CREATE TABLE ti (c INT) ENGINE=InnoDB;
      CREATE TABLE ts ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "ti"';
      

      But not afterwards, yielding:

      10.11.1 b4e7803a6f4c734fc5f06a0b0d78285510ae0f48

      mysqltest: At line 7: query 'CREATE TABLE ts ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "ti"'' failed: ER_DBACCESS_DENIED_ERROR (1044): Access denied for user 'u'@'localhost' to database 'test'
      

      Adding:

      GRANT ALL ON test.* TO u@localhost;
      

      Directly after the user creation fixes the test on 10.11.

      The same happens for Federated. Testcase (with GRANT present for convenience but commented):

      --let $SOCKET= `SELECT @@global.socket`
      --source include/have_innodb.inc
      INSTALL SONAME 'ha_federatedx.so';
      CREATE USER u@localhost IDENTIFIED BY 'a';
      #GRANT ALL ON test.* TO u@localhost;
      eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$SOCKET",DATABASE 'test',user 'u',PASSWORD 'a');
      CREATE TABLE ti (c INT) ENGINE=InnoDB;
      CREATE TABLE tf CONNECTION='srv/ti' ENGINE=FEDERATED;
      

      Attachments

        Issue Links

          Activity

            People

              Roel Roel Van de Paar
              Roel Roel Van de Paar
              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.