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';
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
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
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}