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

mysql_ha_read attempts table read after 'Access denied' for server created by CREATE SERVER | Got error 12701 when reading table

Details

    Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock', DATABASE 'test', USER 'Spider', PASSWORD 'PWD123');
      CREATE TABLE t1 (a INT, b CHAR(10), c CHAR(10), filler CHAR(10), PRIMARY KEY(a, b (2)), UNIQUE KEY(a, c (2))) CHARACTER SET ucs2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv", TABLE "t"';
      HANDLER t1 OPEN;
      HANDLER t1 READ a>(1);
      

      Leads to (in the CLI):

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized)

      10.11.0-opt>HANDLER t1 OPEN;
      Query OK, 0 rows affected, 4 warnings (0.006 sec)
       
      10.11.0-opt>HANDLER t1 READ a>(1);
      ERROR 1429 (HY000): Unable to connect to foreign data source: srv
      

      Yet in the error log we see;

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized)

      2022-09-03 10:48:20 25 [Warning] Access denied for user 'Spider'@'localhost' (using password: YES)
      2022-09-03 10:48:20 4 [ERROR] mysql_ha_read: Got error 12701 when reading table 't1'
      

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar added a comment - - edited

            Error 12701 also needs to be added to perror it looks like:

            10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized)

            $ ./bin/perror 12701
            Illegal error code: 12701
            

            Roel Roel Van de Paar added a comment - - edited Error 12701 also needs to be added to perror it looks like: 10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized) $ ./bin/perror 12701 Illegal error code: 12701
            Roel Roel Van de Paar added a comment - - edited

            Interestingly, with the same testcase, on at least one occassion, the 'Access denied' error showed twice?

            10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized)

            2022-09-03 11:06:51 0 [Note] /test/MD190822-mariadb-10.11.0-linux-x86_64-opt/bin/mysqld: ready for connections.
            Version: '10.11.0-MariaDB'  socket: '/test/MD190822-mariadb-10.11.0-linux-x86_64-opt/socket.sock'  port: 12944  MariaDB Server
            2022-09-03 11:06:53 25 [Warning] Access denied for user 'Spider'@'localhost' (using password: YES)
            2022-09-03 11:06:54 26 [Warning] Access denied for user 'Spider'@'localhost' (using password: YES)
            2022-09-03 11:06:54 4 [ERROR] mysql_ha_read: Got error 12701 when reading table 't1'
            

            Roel Roel Van de Paar added a comment - - edited Interestingly, with the same testcase, on at least one occassion, the 'Access denied' error showed twice? 10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized) 2022-09-03 11:06:51 0 [Note] /test/MD190822-mariadb-10.11.0-linux-x86_64-opt/bin/mysqld: ready for connections. Version: '10.11.0-MariaDB' socket: '/test/MD190822-mariadb-10.11.0-linux-x86_64-opt/socket.sock' port: 12944 MariaDB Server 2022-09-03 11:06:53 25 [Warning] Access denied for user 'Spider'@'localhost' (using password: YES) 2022-09-03 11:06:54 26 [Warning] Access denied for user 'Spider'@'localhost' (using password: YES) 2022-09-03 11:06:54 4 [ERROR] mysql_ha_read: Got error 12701 when reading table 't1'
            Roel Roel Van de Paar added a comment - - edited

            Additional testcase

            INSTALL PLUGIN Spider SONAME 'ha_spider.so';
            CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE'',USER'',PASSWORD 'PWD1');
            CREATE TABLE t (a CHAR(1) KEY,b CHAR(1)) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
            HANDLER t OPEN;
            HANDLER t READ NEXT;
            HANDLER t READ NEXT;
            

            Roel Roel Van de Paar added a comment - - edited Additional testcase INSTALL PLUGIN Spider SONAME 'ha_spider.so' ; CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock' , DATABASE '' , USER '' , PASSWORD 'PWD1' ); CREATE TABLE t (a CHAR (1) KEY ,b CHAR (1)) ENGINE=Spider COMMENT= 'WRAPPER "mysql",srv "srv",TABLE "t"' ; HANDLER t OPEN ; HANDLER t READ NEXT ; HANDLER t READ NEXT ;

            People

              holyfoot Alexey Botchkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.