mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk://anubis/mysql-5.0-engines
into xiphis.org:/home/antony/work2/merge/mysql-5.0 sql/handler.cc: Auto merged
This commit is contained in:
@ -1689,6 +1689,44 @@ id c1 c2
|
||||
9 abc ppc
|
||||
drop table federated.t1, federated.t2;
|
||||
drop table federated.t1, federated.t2;
|
||||
DROP TABLE IF EXISTS federated.test;
|
||||
CREATE TABLE federated.test (
|
||||
`id` int(11) NOT NULL,
|
||||
`val1` varchar(255) NOT NULL,
|
||||
`val2` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.test_local;
|
||||
DROP TABLE IF EXISTS federated.test_remote;
|
||||
CREATE TABLE federated.test_local (
|
||||
`id` int(11) NOT NULL,
|
||||
`val1` varchar(255) NOT NULL,
|
||||
`val2` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
INSERT INTO federated.test_local VALUES (1, 'foo', 'bar'),
|
||||
(2, 'bar', 'foo');
|
||||
CREATE TABLE federated.test_remote (
|
||||
`id` int(11) NOT NULL,
|
||||
`val1` varchar(255) NOT NULL,
|
||||
`val2` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=FEDERATED DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/test';
|
||||
insert into federated.test_remote select * from federated.test_local;
|
||||
select * from federated.test_remote;
|
||||
id val1 val2
|
||||
1 foo bar
|
||||
2 bar foo
|
||||
delete from federated.test_remote where id in (1,2);
|
||||
insert into federated.test_remote select * from federated.test_local;
|
||||
select * from federated.test_remote;
|
||||
id val1 val2
|
||||
2 bar foo
|
||||
1 foo bar
|
||||
DROP TABLE federated.test_local;
|
||||
DROP TABLE federated.test_remote;
|
||||
DROP TABLE federated.test;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (a int, b int, c int);
|
||||
drop table if exists federated.t1;
|
||||
@ -1733,6 +1771,19 @@ id val
|
||||
2 0
|
||||
drop table t1;
|
||||
drop table t1;
|
||||
create table t1 (a longblob not null);
|
||||
create table t1
|
||||
(a longblob not null) engine=federated
|
||||
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
insert into t1 values (repeat('a',5000));
|
||||
select length(a) from t1;
|
||||
length(a)
|
||||
5000
|
||||
select length(a) from t1;
|
||||
length(a)
|
||||
5000
|
||||
drop table t1;
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
|
@ -774,3 +774,15 @@ create table tm (b bit(1)) engine = merge union = (t1,t2);
|
||||
select * from tm;
|
||||
b
|
||||
drop table tm, t1, t2;
|
||||
create table t1 (a int) insert_method = last engine = merge;
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Table 't1' is read only
|
||||
create table t2 (a int) engine = myisam;
|
||||
alter table t1 union (t2);
|
||||
insert into t1 values (1);
|
||||
alter table t1 insert_method = no;
|
||||
insert into t1 values (1);
|
||||
ERROR HY000: Table 't1' is read only
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1365,6 +1365,62 @@ drop table federated.t1, federated.t2;
|
||||
connection slave;
|
||||
drop table federated.t1, federated.t2;
|
||||
|
||||
#
|
||||
# BUG #18764: Delete conditions causing inconsistencies in Federated tables
|
||||
#
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.test;
|
||||
--enable_warnings
|
||||
CREATE TABLE federated.test (
|
||||
`id` int(11) NOT NULL,
|
||||
`val1` varchar(255) NOT NULL,
|
||||
`val2` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS federated.test_local;
|
||||
DROP TABLE IF EXISTS federated.test_remote;
|
||||
--enable_warnings
|
||||
CREATE TABLE federated.test_local (
|
||||
`id` int(11) NOT NULL,
|
||||
`val1` varchar(255) NOT NULL,
|
||||
`val2` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
INSERT INTO federated.test_local VALUES (1, 'foo', 'bar'),
|
||||
(2, 'bar', 'foo');
|
||||
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.test_remote (
|
||||
`id` int(11) NOT NULL,
|
||||
`val1` varchar(255) NOT NULL,
|
||||
`val2` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=FEDERATED DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test';
|
||||
|
||||
insert into federated.test_remote select * from federated.test_local;
|
||||
|
||||
select * from federated.test_remote;
|
||||
|
||||
delete from federated.test_remote where id in (1,2);
|
||||
|
||||
insert into federated.test_remote select * from federated.test_local;
|
||||
|
||||
select * from federated.test_remote;
|
||||
--disable_warnings
|
||||
DROP TABLE federated.test_local;
|
||||
DROP TABLE federated.test_remote;
|
||||
--enable_warnings
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
DROP TABLE federated.test;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Additional test for bug#18437 "Wrong values inserted with a before
|
||||
# update trigger on NDB table". SQL-layer didn't properly inform
|
||||
@ -1425,4 +1481,22 @@ drop table t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #17608: String literals lost during INSERT query on FEDERATED table
|
||||
#
|
||||
connection slave;
|
||||
create table t1 (a longblob not null);
|
||||
connection master;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval create table t1
|
||||
(a longblob not null) engine=federated
|
||||
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||
insert into t1 values (repeat('a',5000));
|
||||
select length(a) from t1;
|
||||
connection slave;
|
||||
select length(a) from t1;
|
||||
drop table t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
source include/federated_cleanup.inc;
|
||||
|
@ -389,4 +389,19 @@ create table tm (b bit(1)) engine = merge union = (t1,t2);
|
||||
select * from tm;
|
||||
drop table tm, t1, t2;
|
||||
|
||||
# End of 5.0 tests
|
||||
#
|
||||
# Bug #17766: The server accepts to create MERGE tables which cannot work
|
||||
#
|
||||
create table t1 (a int) insert_method = last engine = merge;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
insert into t1 values (1);
|
||||
create table t2 (a int) engine = myisam;
|
||||
alter table t1 union (t2);
|
||||
insert into t1 values (1);
|
||||
alter table t1 insert_method = no;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
insert into t1 values (1);
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user