| 1 |
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; |
| 2 |
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; |
| 3 |
connection master; |
| 4 |
CREATE DATABASE federated; |
| 5 |
connection slave; |
| 6 |
CREATE DATABASE federated; |
| 7 |
# |
| 8 |
# MDEV-32984 Update federated table and column privileges |
| 9 |
# |
| 10 |
connection slave; |
| 11 |
create database db1; |
| 12 |
create user my@localhost identified by '1qaz2wsx'; |
| 13 |
create table db1.t1 ( |
| 14 |
f1 int auto_increment primary key, |
| 15 |
f2 varchar(50), |
| 16 |
f3 varchar(50), |
| 17 |
unique (f2) |
| 18 |
); |
| 19 |
grant insert, select (f1, f2, f3), update (f3) on db1.t1 to my@localhost; |
| 20 |
connection master; |
| 21 |
create table tt1 engine=federated connection='mysql://my:1qaz2wsx@localhost:$SLAVE_MYPORT/db1/t1'; |
| 22 |
insert into tt1 (f2,f3) values ('test','123'); |
| 23 |
select * from tt1; |
| 24 |
f1 f2 f3 |
| 25 |
1 test 123 |
| 26 |
update tt1 set f3='123456' where f2='test'; |
| 27 |
drop table tt1; |
| 28 |
connection slave; |
| 29 |
drop database db1; |
| 30 |
drop user my@localhost; |
| 31 |
connection master; |
| 32 |
DROP TABLE IF EXISTS federated.t1; |
| 33 |
DROP DATABASE IF EXISTS federated; |
| 34 |
connection slave; |
| 35 |
DROP TABLE IF EXISTS federated.t1; |
| 36 |
DROP DATABASE IF EXISTS federated; |