mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
This commit is contained in:
12
mysql-test/suite/federated/disabled.def
Normal file
12
mysql-test/suite/federated/disabled.def
Normal file
@@ -0,0 +1,12 @@
|
||||
##############################################################################
|
||||
#
|
||||
# List the test cases that are to be disabled temporarily.
|
||||
#
|
||||
# Separate the test case name and the comment with ':'.
|
||||
#
|
||||
# <testcasename> : BUG#<xxxx> <comment>
|
||||
#
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
federated_transactions : Bug#29523 Transactions do not work
|
16
mysql-test/suite/federated/federated.inc
Normal file
16
mysql-test/suite/federated/federated.inc
Normal file
@@ -0,0 +1,16 @@
|
||||
--source have_federated_db.inc
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
CREATE DATABASE federated;
|
||||
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
CREATE DATABASE federated;
|
2066
mysql-test/suite/federated/federated.result
Normal file
2066
mysql-test/suite/federated/federated.result
Normal file
File diff suppressed because it is too large
Load Diff
1796
mysql-test/suite/federated/federated.test
Normal file
1796
mysql-test/suite/federated/federated.test
Normal file
File diff suppressed because it is too large
Load Diff
41
mysql-test/suite/federated/federated_archive.result
Normal file
41
mysql-test/suite/federated/federated_archive.result
Normal file
@@ -0,0 +1,41 @@
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP TABLE IF EXISTS federated.archive_table;
|
||||
CREATE TABLE federated.archive_table (
|
||||
`id` int(4) NOT NULL,
|
||||
`name` varchar(54) default NULL
|
||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(4) NOT NULL,
|
||||
`name` varchar(54) default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/archive_table';
|
||||
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (2, 'bar');
|
||||
SELECT * FROM federated.t1;
|
||||
id name
|
||||
1 foo
|
||||
2 bar
|
||||
DELETE FROM federated.t1 WHERE id = 1;
|
||||
ERROR HY000: Got error 10000 'Error on remote system: 1031: Table storage engine for 'archive_table' doesn't have this option' from FEDERATED
|
||||
SELECT * FROM federated.t1;
|
||||
id name
|
||||
1 foo
|
||||
2 bar
|
||||
UPDATE federated.t1 SET name='baz' WHERE id = 1;
|
||||
ERROR HY000: Got error 10000 'Error on remote system: 1031: Table storage engine for 'archive_table' doesn't have this option' from FEDERATED
|
||||
SELECT * FROM federated.t1;
|
||||
id name
|
||||
1 foo
|
||||
2 bar
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE federated.archive_table;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
58
mysql-test/suite/federated/federated_archive.test
Normal file
58
mysql-test/suite/federated/federated_archive.test
Normal file
@@ -0,0 +1,58 @@
|
||||
source include/have_archive.inc;
|
||||
source federated.inc;
|
||||
|
||||
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.archive_table;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE federated.archive_table (
|
||||
`id` int(4) NOT NULL,
|
||||
`name` varchar(54) default NULL
|
||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--enable_warnings
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int(4) NOT NULL,
|
||||
`name` varchar(54) default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/archive_table';
|
||||
|
||||
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (2, 'bar');
|
||||
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
--error 1296
|
||||
DELETE FROM federated.t1 WHERE id = 1;
|
||||
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
|
||||
--error 1296
|
||||
UPDATE federated.t1 SET name='baz' WHERE id = 1;
|
||||
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
|
||||
# --error 1296
|
||||
# TRUNCATE federated.t1;
|
||||
#
|
||||
# SELECT * from federated.t1;
|
||||
|
||||
DROP TABLE federated.t1;
|
||||
connection slave;
|
||||
DROP TABLE federated.archive_table;
|
||||
|
||||
|
||||
source federated_cleanup.inc;
|
||||
|
32
mysql-test/suite/federated/federated_bug_13118.result
Normal file
32
mysql-test/suite/federated/federated_bug_13118.result
Normal file
@@ -0,0 +1,32 @@
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP TABLE IF EXISTS federated.bug_13118_table;
|
||||
CREATE TABLE federated.bug_13118_table (
|
||||
`foo` integer,
|
||||
`bar` integer
|
||||
);
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`foo` integer,
|
||||
`bar` integer
|
||||
) ENGINE="FEDERATED"
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/bug_13118_table';
|
||||
SELECT * from federated.t1;
|
||||
foo bar
|
||||
INSERT INTO federated.t1 VALUES (1,1);
|
||||
SELECT * FROM federated.t1;
|
||||
foo bar
|
||||
1 1
|
||||
INSERT INTO federated.t1 VALUES (1,1);
|
||||
SELECT * FROM federated.t1;
|
||||
foo bar
|
||||
1 1
|
||||
1 1
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE federated.bug_13118_table;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
41
mysql-test/suite/federated/federated_bug_13118.test
Normal file
41
mysql-test/suite/federated/federated_bug_13118.test
Normal file
@@ -0,0 +1,41 @@
|
||||
source federated.inc;
|
||||
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.bug_13118_table;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE federated.bug_13118_table (
|
||||
`foo` integer,
|
||||
`bar` integer
|
||||
);
|
||||
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--enable_warnings
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`foo` integer,
|
||||
`bar` integer
|
||||
) ENGINE="FEDERATED"
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/bug_13118_table';
|
||||
|
||||
SELECT * from federated.t1;
|
||||
|
||||
INSERT INTO federated.t1 VALUES (1,1);
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
INSERT INTO federated.t1 VALUES (1,1);
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
|
||||
DROP TABLE federated.t1;
|
||||
connection slave;
|
||||
DROP TABLE federated.bug_13118_table;
|
||||
|
||||
|
||||
source federated_cleanup.inc;
|
||||
|
49
mysql-test/suite/federated/federated_bug_25714.result
Normal file
49
mysql-test/suite/federated/federated_bug_25714.result
Normal file
@@ -0,0 +1,49 @@
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP TABLE IF EXISTS federated.bug_13118_table;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int auto_increment primary key,
|
||||
`value` int
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO federated.t1 SET value=1;
|
||||
INSERT INTO federated.t1 SET value=2;
|
||||
INSERT INTO federated.t1 SET value=2;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int auto_increment primary key,
|
||||
`value` int
|
||||
) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
SELECT * from federated.t1;
|
||||
id value
|
||||
1 1
|
||||
2 2
|
||||
3 2
|
||||
INSERT INTO federated.t1 SET value=4;
|
||||
SELECT LAST_INSERT_ID();
|
||||
LAST_INSERT_ID()
|
||||
4
|
||||
|
||||
5 inserted
|
||||
6 inserted
|
||||
|
||||
7 inserted
|
||||
8 inserted
|
||||
SELECT * from federated.t1;
|
||||
id value
|
||||
1 1
|
||||
2 2
|
||||
3 2
|
||||
4 4
|
||||
5 54
|
||||
6 55
|
||||
7 54
|
||||
8 55
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
51
mysql-test/suite/federated/federated_bug_25714.test
Normal file
51
mysql-test/suite/federated/federated_bug_25714.test
Normal file
@@ -0,0 +1,51 @@
|
||||
source federated.inc;
|
||||
|
||||
# Check that path to the specific test program has been setup
|
||||
if (`select LENGTH("$MYSQL_BUG25714") = 0`)
|
||||
{
|
||||
skip Need bug25714 test program;
|
||||
}
|
||||
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.bug_13118_table;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int auto_increment primary key,
|
||||
`value` int
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO federated.t1 SET value=1;
|
||||
INSERT INTO federated.t1 SET value=2;
|
||||
INSERT INTO federated.t1 SET value=2;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--enable_warnings
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int auto_increment primary key,
|
||||
`value` int
|
||||
) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
SELECT * from federated.t1;
|
||||
|
||||
INSERT INTO federated.t1 SET value=4;
|
||||
|
||||
SELECT LAST_INSERT_ID();
|
||||
|
||||
--exec $MYSQL_BUG25714 $SLAVE_MYPORT
|
||||
--exec $MYSQL_BUG25714 $MASTER_MYPORT
|
||||
|
||||
SELECT * from federated.t1;
|
||||
|
||||
DROP TABLE federated.t1;
|
||||
connection slave;
|
||||
DROP TABLE federated.t1;
|
||||
|
||||
|
||||
source federated_cleanup.inc;
|
||||
|
9
mysql-test/suite/federated/federated_cleanup.inc
Normal file
9
mysql-test/suite/federated/federated_cleanup.inc
Normal file
@@ -0,0 +1,9 @@
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
1
mysql-test/suite/federated/federated_innodb-slave.opt
Normal file
1
mysql-test/suite/federated/federated_innodb-slave.opt
Normal file
@@ -0,0 +1 @@
|
||||
--innodb
|
27
mysql-test/suite/federated/federated_innodb.result
Normal file
27
mysql-test/suite/federated/federated_innodb.result
Normal file
@@ -0,0 +1,27 @@
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
create table federated.t1 (a int primary key, b varchar(64))
|
||||
engine=myisam;
|
||||
create table federated.t1 (a int primary key, b varchar(64))
|
||||
engine=federated
|
||||
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
select * from federated.t1;
|
||||
a b
|
||||
1 Larry
|
||||
2 Curly
|
||||
truncate federated.t1;
|
||||
alter table federated.t1 engine=innodb;
|
||||
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
|
||||
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||
select * from federated.t1;
|
||||
a b
|
||||
drop table federated.t1;
|
||||
drop table federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
34
mysql-test/suite/federated/federated_innodb.test
Normal file
34
mysql-test/suite/federated/federated_innodb.test
Normal file
@@ -0,0 +1,34 @@
|
||||
source federated.inc;
|
||||
source include/have_innodb.inc;
|
||||
|
||||
#
|
||||
# Bug#25513 Federated transaction failures
|
||||
#
|
||||
connection slave;
|
||||
create table federated.t1 (a int primary key, b varchar(64))
|
||||
engine=myisam;
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval create table federated.t1 (a int primary key, b varchar(64))
|
||||
engine=federated
|
||||
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
--error ER_DUP_KEY
|
||||
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
|
||||
select * from federated.t1;
|
||||
|
||||
connection slave;
|
||||
truncate federated.t1;
|
||||
alter table federated.t1 engine=innodb;
|
||||
connection master;
|
||||
|
||||
--error ER_DUP_KEY
|
||||
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
|
||||
select * from federated.t1;
|
||||
|
||||
drop table federated.t1;
|
||||
connection slave;
|
||||
drop table federated.t1;
|
||||
|
||||
|
||||
source federated_cleanup.inc;
|
288
mysql-test/suite/federated/federated_server.result
Normal file
288
mysql-test/suite/federated/federated_server.result
Normal file
@@ -0,0 +1,288 @@
|
||||
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;
|
||||
DROP TABLE IF EXISTS first_db.t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
CREATE TABLE first_db.t2 (
|
||||
`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 TABLE IF EXISTS second_db.t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
CREATE TABLE second_db.t2 (
|
||||
`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-> first_db.t1, url format');
|
||||
SELECT * FROM federated.old;
|
||||
id name
|
||||
1 federated.old-> first_db.t1, url format
|
||||
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/first_db/t2';
|
||||
INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format');
|
||||
SELECT * FROM federated.old2;
|
||||
id name
|
||||
1 federated.old2-> first_db.t2, url format
|
||||
DROP TABLE IF EXISTS federated.urldb2t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'urldb2t1'
|
||||
CREATE TABLE federated.urldb2t1 (
|
||||
`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.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format');
|
||||
SELECT * FROM federated.urldb2t1;
|
||||
id name
|
||||
1 federated.urldb2t1 -> second_db.t1, url format
|
||||
DROP TABLE IF EXISTS federated.urldb2t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'urldb2t2'
|
||||
CREATE TABLE federated.urldb2t2 (
|
||||
`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/t2';
|
||||
INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format');
|
||||
SELECT * FROM federated.urldb2t2;
|
||||
id name
|
||||
1 federated.urldb2t2 -> second_db.t2, url format
|
||||
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, first_db.t1');
|
||||
SELECT * FROM federated.t1;
|
||||
id name
|
||||
1 federated.old-> first_db.t1, url format
|
||||
1 server_one, new scheme, first_db.t1
|
||||
DROP TABLE IF EXISTS federated.whatever;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'whatever'
|
||||
CREATE TABLE federated.whatever (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='server_one/t1';
|
||||
INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1');
|
||||
SELECT * FROM federated.whatever;
|
||||
id name
|
||||
1 federated.old-> first_db.t1, url format
|
||||
1 server_one, new scheme, first_db.t1
|
||||
1 server_one, new scheme, whatever, first_db.t1
|
||||
ALTER SERVER 'server_one' options(DATABASE 'second_db');
|
||||
INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1');
|
||||
SELECT * FROM federated.t1;
|
||||
id name
|
||||
1 federated.urldb2t1 -> second_db.t1, url format
|
||||
1 server_two, new scheme, second_db.t1
|
||||
INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1');
|
||||
SELECT * FROM federated.whatever;
|
||||
id name
|
||||
1 federated.urldb2t1 -> second_db.t1, url format
|
||||
1 server_two, new scheme, second_db.t1
|
||||
1 server_two, new scheme, whatever, second_db.t1
|
||||
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;
|
||||
create database db_legitimate;
|
||||
create database db_bogus;
|
||||
use db_legitimate;
|
||||
CREATE TABLE db_legitimate.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
);
|
||||
INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate');
|
||||
use db_bogus;
|
||||
CREATE TABLE db_bogus.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
;
|
||||
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
|
||||
create server 's1' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'db_legitimate',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT SLAVE_PORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
create user guest_select@localhost;
|
||||
grant select on federated.* to guest_select@localhost;
|
||||
create user guest_super@localhost;
|
||||
grant select,SUPER,RELOAD on *.* to guest_super@localhost;
|
||||
create user guest_usage@localhost;
|
||||
grant usage on *.* to guest_usage@localhost;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
) ENGINE = FEDERATED CONNECTION = 's1';
|
||||
select * from federated.t1;
|
||||
id name
|
||||
1 this is legitimate
|
||||
alter server s1 options (database 'db_bogus');
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
id name
|
||||
1 this is legitimate
|
||||
alter server s1 options (database 'db_bogus');
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
id name
|
||||
1 this is legitimate
|
||||
alter server s1 options (database 'db_bogus');
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
id name
|
||||
2 this is bogus
|
||||
drop server if exists 's1';
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
create server 's1' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'db_legitimate',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT SLAVE_PORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
ERROR 42000: Access denied; you need the SUPER privilege for this operation
|
||||
drop server 's1';
|
||||
create server 's1' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'db_legitimate',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT SLAVE_PORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
id name
|
||||
1 this is legitimate
|
||||
drop database db_legitimate;
|
||||
drop database db_bogus;
|
||||
drop user guest_super@localhost;
|
||||
drop user guest_usage@localhost;
|
||||
drop user guest_select@localhost;
|
||||
drop table federated.t1;
|
||||
drop server 's1';
|
||||
create server 's1' foreign data wrapper 'mysql' options (port 3306);
|
||||
alter server 's1' options
|
||||
(host 'localhost', database '', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
alter server 's1' options
|
||||
(host 'localhost', database 'database1', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
drop server 's1';
|
||||
# End of 5.1 tests
|
||||
use test;
|
||||
create procedure p1 ()
|
||||
begin
|
||||
DECLARE v INT DEFAULT 0;
|
||||
DECLARE e INT DEFAULT 0;
|
||||
DECLARE i INT;
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
|
||||
SET i = sleep(5);
|
||||
WHILE v < 10000 do
|
||||
CREATE SERVER s
|
||||
FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
|
||||
ALTER SERVER s OPTIONS (USER 'Remote');
|
||||
DROP SERVER s;
|
||||
SET v = v + 1;
|
||||
END WHILE;
|
||||
SELECT e > 0;
|
||||
END//
|
||||
use test;
|
||||
call p1();
|
||||
call p1();
|
||||
e > 0
|
||||
1
|
||||
e > 0
|
||||
1
|
||||
drop procedure p1;
|
||||
drop server if exists s;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
334
mysql-test/suite/federated/federated_server.test
Normal file
334
mysql-test/suite/federated/federated_server.test
Normal file
@@ -0,0 +1,334 @@
|
||||
# WL #3031 This test tests the new servers table as well as
|
||||
# if federated can utilise the servers table
|
||||
-- source federated.inc
|
||||
|
||||
connection slave;
|
||||
create database first_db;
|
||||
create database second_db;
|
||||
|
||||
use first_db;
|
||||
|
||||
DROP TABLE IF EXISTS first_db.t1;
|
||||
CREATE TABLE first_db.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
DROP TABLE IF EXISTS first_db.t2;
|
||||
CREATE TABLE first_db.t2 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
use second_db;
|
||||
DROP TABLE IF EXISTS second_db.t1;
|
||||
CREATE TABLE second_db.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
DROP TABLE IF EXISTS second_db.t2;
|
||||
CREATE TABLE second_db.t2 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
|
||||
drop server if exists 'server_one';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval create server 'server_one' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'first_db',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT $SLAVE_MYPORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
|
||||
drop server if exists 'server_two';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval create server 'server_two' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'second_db',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT $SLAVE_MYPORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval select * from mysql.servers;
|
||||
|
||||
DROP TABLE IF EXISTS federated.old;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval 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_MYPORT/first_db/t1';
|
||||
|
||||
INSERT INTO federated.old (id, name) values (1, 'federated.old-> first_db.t1, url format');
|
||||
|
||||
SELECT * FROM federated.old;
|
||||
|
||||
DROP TABLE IF EXISTS federated.old2;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval 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_MYPORT/first_db/t2';
|
||||
|
||||
INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format');
|
||||
SELECT * FROM federated.old2;
|
||||
|
||||
DROP TABLE IF EXISTS federated.urldb2t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.urldb2t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t1';
|
||||
INSERT INTO federated.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format');
|
||||
SELECT * FROM federated.urldb2t1;
|
||||
|
||||
DROP TABLE IF EXISTS federated.urldb2t2;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.urldb2t2 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t2';
|
||||
INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format');
|
||||
SELECT * FROM federated.urldb2t2;
|
||||
|
||||
DROP TABLE IF EXISTS federated.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, first_db.t1');
|
||||
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
DROP TABLE IF EXISTS federated.whatever;
|
||||
CREATE TABLE federated.whatever (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='server_one/t1';
|
||||
INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1');
|
||||
SELECT * FROM federated.whatever;
|
||||
|
||||
ALTER SERVER 'server_one' options(DATABASE 'second_db');
|
||||
|
||||
# FLUSH TABLES is now unneccessary
|
||||
|
||||
INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1');
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1');
|
||||
SELECT * FROM federated.whatever;
|
||||
|
||||
drop table federated.t1;
|
||||
|
||||
drop server 'server_one';
|
||||
drop server 'server_two';
|
||||
select * from mysql.servers;
|
||||
|
||||
connection slave;
|
||||
drop table first_db.t1;
|
||||
drop table second_db.t1;
|
||||
drop database first_db;
|
||||
drop database second_db;
|
||||
|
||||
#
|
||||
# Bug#25671 - CREATE/DROP/ALTER SERVER should require privileges
|
||||
#
|
||||
# Changes to SERVER declarations should require SUPER privilege.
|
||||
# Based upon test case by Giuseppe Maxia
|
||||
|
||||
create database db_legitimate;
|
||||
create database db_bogus;
|
||||
|
||||
use db_legitimate;
|
||||
CREATE TABLE db_legitimate.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
);
|
||||
INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate');
|
||||
|
||||
use db_bogus;
|
||||
CREATE TABLE db_bogus.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
)
|
||||
;
|
||||
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
|
||||
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval create server 's1' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'db_legitimate',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT $SLAVE_MYPORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
|
||||
create user guest_select@localhost;
|
||||
grant select on federated.* to guest_select@localhost;
|
||||
|
||||
create user guest_super@localhost;
|
||||
grant select,SUPER,RELOAD on *.* to guest_super@localhost;
|
||||
|
||||
create user guest_usage@localhost;
|
||||
grant usage on *.* to guest_usage@localhost;
|
||||
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(64) NOT NULL default ''
|
||||
) ENGINE = FEDERATED CONNECTION = 's1';
|
||||
|
||||
select * from federated.t1;
|
||||
|
||||
connect (conn_select,127.0.0.1,guest_select,,federated,$MASTER_MYPORT);
|
||||
connect (conn_usage,127.0.0.1,guest_usage,,,$MASTER_MYPORT);
|
||||
connect (conn_super,127.0.0.1,guest_super,,,$MASTER_MYPORT);
|
||||
|
||||
connection conn_select;
|
||||
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
alter server s1 options (database 'db_bogus');
|
||||
|
||||
connection master;
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
|
||||
connection conn_usage;
|
||||
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
alter server s1 options (database 'db_bogus');
|
||||
|
||||
connection master;
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
|
||||
connection conn_super;
|
||||
alter server s1 options (database 'db_bogus');
|
||||
|
||||
connection master;
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
|
||||
connection conn_select;
|
||||
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
drop server if exists 's1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
eval create server 's1' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'db_legitimate',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT $SLAVE_MYPORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
|
||||
connection conn_super;
|
||||
drop server 's1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval create server 's1' foreign data wrapper 'mysql' options
|
||||
(HOST '127.0.0.1',
|
||||
DATABASE 'db_legitimate',
|
||||
USER 'root',
|
||||
PASSWORD '',
|
||||
PORT $SLAVE_MYPORT,
|
||||
SOCKET '',
|
||||
OWNER 'root');
|
||||
|
||||
connection master;
|
||||
flush tables;
|
||||
select * from federated.t1;
|
||||
|
||||
# clean up test
|
||||
connection slave;
|
||||
drop database db_legitimate;
|
||||
drop database db_bogus;
|
||||
|
||||
disconnect conn_select;
|
||||
disconnect conn_usage;
|
||||
disconnect conn_super;
|
||||
|
||||
connection master;
|
||||
drop user guest_super@localhost;
|
||||
drop user guest_usage@localhost;
|
||||
drop user guest_select@localhost;
|
||||
drop table federated.t1;
|
||||
drop server 's1';
|
||||
|
||||
#
|
||||
# Bug#30671 - ALTER SERVER causes the server to crash
|
||||
#
|
||||
create server 's1' foreign data wrapper 'mysql' options (port 3306);
|
||||
alter server 's1' options
|
||||
(host 'localhost', database '', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
# The next statement would crash unpatched server
|
||||
alter server 's1' options
|
||||
(host 'localhost', database 'database1', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
drop server 's1';
|
||||
|
||||
--echo # End of 5.1 tests
|
||||
|
||||
|
||||
#
|
||||
# Bug#25721 - deadlock with ALTER/CREATE SERVER
|
||||
#
|
||||
connect (other,localhost,root,,);
|
||||
connection master;
|
||||
use test;
|
||||
delimiter //;
|
||||
create procedure p1 ()
|
||||
begin
|
||||
DECLARE v INT DEFAULT 0;
|
||||
DECLARE e INT DEFAULT 0;
|
||||
DECLARE i INT;
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
|
||||
SET i = sleep(5);
|
||||
WHILE v < 10000 do
|
||||
CREATE SERVER s
|
||||
FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
|
||||
ALTER SERVER s OPTIONS (USER 'Remote');
|
||||
DROP SERVER s;
|
||||
SET v = v + 1;
|
||||
END WHILE;
|
||||
SELECT e > 0;
|
||||
END//
|
||||
delimiter ;//
|
||||
connection other;
|
||||
use test;
|
||||
send call p1();
|
||||
connection master;
|
||||
call p1();
|
||||
connection other;
|
||||
reap;
|
||||
drop procedure p1;
|
||||
drop server if exists s;
|
||||
|
||||
|
||||
source federated_cleanup.inc;
|
@@ -0,0 +1 @@
|
||||
--loose-innodb
|
49
mysql-test/suite/federated/federated_transactions.result
Normal file
49
mysql-test/suite/federated/federated_transactions.result
Normal file
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1 ENGINE=innodb;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
set autocommit=0;
|
||||
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
|
||||
COMMIT;
|
||||
INSERT INTO federated.t1 (id, name) VALUES (3, 'fie');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (4, 'fum');
|
||||
ROLLBACK;
|
||||
set autocommit=1;
|
||||
INSERT INTO federated.t1 (id, name) VALUES (5, 'foe');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (6, 'fig');
|
||||
SELECT * FROM federated.t1;
|
||||
id name
|
||||
1 foo
|
||||
2 fee
|
||||
5 foe
|
||||
6 fig
|
||||
DELETE FROM federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
38
mysql-test/suite/federated/federated_transactions.test
Normal file
38
mysql-test/suite/federated/federated_transactions.test
Normal file
@@ -0,0 +1,38 @@
|
||||
source include/have_innodb.inc;
|
||||
source federated.inc;
|
||||
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
#SHOW ENGINES;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
)
|
||||
DEFAULT CHARSET=latin1 ENGINE=innodb;
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
# # correct connection, same named tables
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL,
|
||||
`name` varchar(32) NOT NULL default ''
|
||||
)
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
set autocommit=0;
|
||||
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
|
||||
COMMIT;
|
||||
INSERT INTO federated.t1 (id, name) VALUES (3, 'fie');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (4, 'fum');
|
||||
ROLLBACK;
|
||||
set autocommit=1;
|
||||
INSERT INTO federated.t1 (id, name) VALUES (5, 'foe');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (6, 'fig');
|
||||
|
||||
SELECT * FROM federated.t1;
|
||||
DELETE FROM federated.t1;
|
||||
|
||||
source federated_cleanup.inc;
|
6
mysql-test/suite/federated/have_federated_db.inc
Normal file
6
mysql-test/suite/federated/have_federated_db.inc
Normal file
@@ -0,0 +1,6 @@
|
||||
if (!`SELECT count(*) FROM information_schema.engines WHERE
|
||||
(support = 'YES' OR support = 'DEFAULT') AND
|
||||
engine = 'federated'`)
|
||||
{
|
||||
skip Need federated engine;
|
||||
}
|
12
mysql-test/suite/federated/my.cnf
Normal file
12
mysql-test/suite/federated/my.cnf
Normal file
@@ -0,0 +1,12 @@
|
||||
# Use default setting for mysqld processes
|
||||
!include include/default_mysqld.cnf
|
||||
|
||||
[mysqld.1]
|
||||
log-bin= master-bin
|
||||
|
||||
[mysqld.2]
|
||||
|
||||
|
||||
[ENV]
|
||||
MASTER_MYPORT= @mysqld.1.port
|
||||
SLAVE_MYPORT= @mysqld.2.port
|
Reference in New Issue
Block a user