mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
40c7f723ad
- Additional fixes caused by running without anonymous users mysql-test/r/federated_server.result: There are no default server in mysql.servers anymore The test will create it's own test servers mysql-test/r/rpl_read_only.result: Update result mysql-test/r/rpl_row_USER.result: Update test result, it basically checks that the values return by USER() and CURRENT_USER() are the same on master and slave, so it's doing the correct thing. Since connection m_1 is logged in as ''@localhost% that is what will end up in the log. mysql-test/t/ndb_multi_row.test: Connect as root instead of '' which would pick currently logged in user mysql-test/t/rpl_read_only.test: Add user test with no privs(no anonymous by default anymore)
110 lines
3.1 KiB
Text
110 lines
3.1 KiB
Text
stop slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
reset master;
|
|
reset slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
start slave;
|
|
stop slave;
|
|
DROP DATABASE IF EXISTS federated;
|
|
CREATE DATABASE federated;
|
|
DROP DATABASE IF EXISTS federated;
|
|
CREATE DATABASE federated;
|
|
create database first_db;
|
|
create database second_db;
|
|
use first_db;
|
|
DROP TABLE IF EXISTS first_db.t1;
|
|
Warnings:
|
|
Note 1051 Unknown table 't1'
|
|
CREATE TABLE first_db.t1 (
|
|
`id` int(20) NOT NULL,
|
|
`name` varchar(64) NOT NULL default ''
|
|
)
|
|
DEFAULT CHARSET=latin1;
|
|
use second_db;
|
|
DROP TABLE IF EXISTS second_db.t1;
|
|
Warnings:
|
|
Note 1051 Unknown table 't1'
|
|
CREATE TABLE second_db.t1 (
|
|
`id` int(20) NOT NULL,
|
|
`name` varchar(64) NOT NULL default ''
|
|
)
|
|
DEFAULT CHARSET=latin1;
|
|
drop server if exists 'server_one';
|
|
create server 'server_one' foreign data wrapper 'mysql' options
|
|
(HOST '127.0.0.1',
|
|
DATABASE 'first_db',
|
|
USER 'root',
|
|
PASSWORD '',
|
|
PORT SLAVE_PORT,
|
|
SOCKET '',
|
|
OWNER 'root');
|
|
drop server if exists 'server_two';
|
|
create server 'server_two' foreign data wrapper 'mysql' options
|
|
(HOST '127.0.0.1',
|
|
DATABASE 'second_db',
|
|
USER 'root',
|
|
PASSWORD '',
|
|
PORT SLAVE_PORT,
|
|
SOCKET '',
|
|
OWNER 'root');
|
|
select * from mysql.servers;
|
|
Server_name Host Db Username Password Port Socket Wrapper Owner
|
|
server_one 127.0.0.1 first_db root SLAVE_PORT mysql root
|
|
server_two 127.0.0.1 second_db root SLAVE_PORT mysql root
|
|
DROP TABLE IF EXISTS federated.old;
|
|
Warnings:
|
|
Note 1051 Unknown table 'old'
|
|
CREATE TABLE federated.old (
|
|
`id` int(20) NOT NULL,
|
|
`name` varchar(64) NOT NULL default ''
|
|
)
|
|
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
|
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/first_db/t1';
|
|
INSERT INTO federated.old (id, name) values (1, 'federated.old url');
|
|
SELECT * FROM federated.old;
|
|
id name
|
|
1 federated.old url
|
|
DROP TABLE IF EXISTS federated.old2;
|
|
Warnings:
|
|
Note 1051 Unknown table 'old2'
|
|
CREATE TABLE federated.old2 (
|
|
`id` int(20) NOT NULL,
|
|
`name` varchar(64) NOT NULL default ''
|
|
)
|
|
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
|
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/second_db/t1';
|
|
INSERT INTO federated.old2 (id, name) values (1, 'federated.old2 url');
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
Warnings:
|
|
Note 1051 Unknown table 't1'
|
|
CREATE TABLE federated.t1 (
|
|
`id` int(20) NOT NULL,
|
|
`name` varchar(64) NOT NULL default ''
|
|
)
|
|
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
|
CONNECTION='server_one';
|
|
INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme');
|
|
SELECT * FROM federated.t1;
|
|
id name
|
|
1 federated.old url
|
|
1 server_one, new scheme
|
|
ALTER SERVER 'server_one' options(DATABASE 'second_db');
|
|
flush tables;
|
|
INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme');
|
|
SELECT * FROM federated.t1;
|
|
id name
|
|
1 federated.old2 url
|
|
1 server_two, new scheme
|
|
drop table federated.t1;
|
|
drop server 'server_one';
|
|
drop server 'server_two';
|
|
select * from mysql.servers;
|
|
Server_name Host Db Username Password Port Socket Wrapper Owner
|
|
drop table first_db.t1;
|
|
drop table second_db.t1;
|
|
drop database first_db;
|
|
drop database second_db;
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
DROP DATABASE IF EXISTS federated;
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
DROP DATABASE IF EXISTS federated;
|