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

Got error 1227 when reading table and ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation on SELECT or HANDLER READ when using spider_internal_sql_log_off=0

    XMLWordPrintable

Details

    Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER Spider@localhost IDENTIFIED BY 'PWD123';
      GRANT ALL ON test.* TO Spider@localhost;
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock', DATABASE 'test', USER 'Spider', PASSWORD 'PWD123');
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      SET spider_internal_sql_log_off=0;
      CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
      SELECT LEFT('a', SUM(a)) FROM t1;
      

      Leads to:

      10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

      10.11.0-dbg>SELECT LEFT('a', SUM(a)) FROM t1;
      ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation
      

      10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

      Version: '10.11.0-MariaDB-debug'  socket: '/test/MD190922-mariadb-10.11.0-linux-x86_64-dbg/socket.sock'  port: 12223  MariaDB Server
      2022-09-28 20:34:12 4 [ERROR] Got error 1227 when reading table './test/t1'
      

      Bug confirmed present in:
      MariaDB: 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt), 10.10.0 (dbg), 10.10.0 (opt), 10.10.2 (dbg), 10.10.2 (opt), 10.11.0 (dbg), 10.11.0 (opt)

      Perror for ERROR 1227:

      $ ./bin/perror 1227
      MariaDB error code 1227 (ER_SPECIFIC_ACCESS_DENIED_ERROR): Access denied; you need (at least one of) the %-.128s privilege(s) for this operation
      

      Attachments

        Issue Links

          Activity

            People

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