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

Connect issues ALTER TABLE DISABLE KEYS when inserting data

    XMLWordPrintable

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

          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.