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

Connect issues ALTER TABLE DISABLE KEYS when inserting data

Details

    Description

      Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

      Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

      I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command. I could not find something similar on the connect documentation page.

      This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

      Above can be tested using the following steps:

      Server 1

      CREATE DATABASE test;
      USE test;
      CREATE TABLE t1 (id INT) ENGINE=InnoDB;
      INSERT INTO `t1` (`id`) VALUES (1);
      INSERT INTO `t1` (`id`) VALUES (2);
      GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';

      Server 2

      CREATE DATABASE test;
      USE test;
      CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1' 
      `table_type`=MYSQL `dbname`=test `tabname`=t1;
      SELECT id FROM t2;
      INSERT INTO t2 (id) VALUES(6);

      Error Code: 1296
      Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT

      See the above error given by connect.

      I have tested it on Debian 8 64bit only.

      Attachments

        Activity

          mchandel Mohit Chandel created issue -
          mchandel Mohit Chandel made changes -
          Field Original Value New Value
          Description Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

          Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

          I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command.

          This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

          Above can be tested using the following steps:

          Server 1
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t1 (id INT) ENGINE=InnoDB;
          INSERT INTO `t1` (`id`) VALUES (1);
          INSERT INTO `t1` (`id`) VALUES (2);
          GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';

          Server 2
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1'
          `table_type`=MYSQL `dbname`=test `tabname`=t1;
          SELECT id FROM t2;
          INSERT INTO t2 (id) VALUES(6);

          Error Code: 1296
          Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT

          See the last error given by connect.
          Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

          Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

          I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command.

          This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

          Above can be tested using the following steps:

          Server 1
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t1 (id INT) ENGINE=InnoDB;
          INSERT INTO `t1` (`id`) VALUES (1);
          INSERT INTO `t1` (`id`) VALUES (2);
          GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';

          Server 2
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1'
          `table_type`=MYSQL `dbname`=test `tabname`=t1;
          SELECT id FROM t2;
          INSERT INTO t2 (id) VALUES(6);

          Error Code: 1296
          Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT

          See the above error given by connect.

          I have tested it on Debian 8 64bit only.
          mchandel Mohit Chandel made changes -
          Description Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

          Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

          I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command.

          This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

          Above can be tested using the following steps:

          Server 1
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t1 (id INT) ENGINE=InnoDB;
          INSERT INTO `t1` (`id`) VALUES (1);
          INSERT INTO `t1` (`id`) VALUES (2);
          GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';

          Server 2
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1'
          `table_type`=MYSQL `dbname`=test `tabname`=t1;
          SELECT id FROM t2;
          INSERT INTO t2 (id) VALUES(6);

          Error Code: 1296
          Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT

          See the above error given by connect.

          I have tested it on Debian 8 64bit only.
          Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

          Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

          I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command. I could not find something similar on the connect documentation page.

          This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

          Above can be tested using the following steps:

          Server 1
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t1 (id INT) ENGINE=InnoDB;
          INSERT INTO `t1` (`id`) VALUES (1);
          INSERT INTO `t1` (`id`) VALUES (2);
          GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';

          Server 2
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1'
          `table_type`=MYSQL `dbname`=test `tabname`=t1;
          SELECT id FROM t2;
          INSERT INTO t2 (id) VALUES(6);

          Error Code: 1296
          Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT

          See the above error given by connect.

          I have tested it on Debian 8 64bit only.
          mchandel Mohit Chandel made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          elenst Elena Stepanova made changes -
          Description Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

          Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

          I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command. I could not find something similar on the connect documentation page.

          This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

          Above can be tested using the following steps:

          Server 1
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t1 (id INT) ENGINE=InnoDB;
          INSERT INTO `t1` (`id`) VALUES (1);
          INSERT INTO `t1` (`id`) VALUES (2);
          GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';

          Server 2
          ========
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1'
          `table_type`=MYSQL `dbname`=test `tabname`=t1;
          SELECT id FROM t2;
          INSERT INTO t2 (id) VALUES(6);

          Error Code: 1296
          Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT

          See the above error given by connect.

          I have tested it on Debian 8 64bit only.
          Connect is issuing "ALTER TABLE DISABLE KEYS" when inserting data to a connect table pointing to a remote table. I think Connect disables keys for speedy insertion of data and then creates key.

          Most of the time users connecting remotely are not having ALTER TABLE privilege. So it becomes impossible for them to insert data using connect.

          I suggest that a flag should be added to connect connection parameters to disable/enable connect issuing ALTER TABLE DISABLE KEYS command. I could not find something similar on the connect documentation page.

          This way all user can insert data to remote connect table, even if they are not having ALTER TABLE privilege.

          Above can be tested using the following steps:

          {noformat:title=Server 1}
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t1 (id INT) ENGINE=InnoDB;
          INSERT INTO `t1` (`id`) VALUES (1);
          INSERT INTO `t1` (`id`) VALUES (2);
          GRANT SELECT, INSERT, UPDATE, DELETE ON test.t1 TO 'user1'@'server2' IDENTIFIED BY PASSWORD 'XXX';
          {noformat}

          {noformat:title=Server 2}
          CREATE DATABASE test;
          USE test;
          CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC CONNECTION='mysql://user1:XXX@server1'
          `table_type`=MYSQL `dbname`=test `tabname`=t1;
          SELECT id FROM t2;
          INSERT INTO t2 (id) VALUES(6);
          {noformat}
          {noformat}
          Error Code: 1296
          Got error 174 '(1142) ALTER command denied to user 'user1'@'server2' for table 't1' [ALTER TABLE `t1` DISABLE KEYS]' from CONNECT
          {noformat}

          See the above error given by connect.

          I have tested it on Debian 8 64bit only.
          elenst Elena Stepanova made changes -
          Fix Version/s 10.1 [ 16100 ]
          Assignee Olivier Bertrand [ bertrandop ]
          bertrandop Olivier Bertrand made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 72311 ] MariaDB v4 [ 144445 ]
          danblack Daniel Black made changes -
          Fix Version/s 10.3.36 [ 27513 ]
          Fix Version/s 10.4.26 [ 27511 ]
          Fix Version/s 10.5.17 [ 27509 ]
          Fix Version/s 10.6.9 [ 27507 ]
          Fix Version/s 10.7.5 [ 27505 ]
          Fix Version/s 10.8.4 [ 27503 ]
          Fix Version/s 10.9.2 [ 27115 ]
          Assignee Olivier Bertrand [ bertrandop ] Daniel Black [ danblack ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.1 [ 16100 ]

          People

            danblack Daniel Black
            mchandel Mohit Chandel
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.