Loading include/my_base.h +2 −1 Original line number Diff line number Diff line Loading @@ -356,8 +356,9 @@ enum ha_base_keytype { #define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ #define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */ #define HA_ERR_TABLE_NEEDS_UPGRADE 160 /* The table changed in storage engine */ #define HA_ERR_TABLE_READONLY 161 /* The table is not writable */ #define HA_ERR_LAST 160 /*Copy last error nr.*/ #define HA_ERR_LAST 161 /*Copy last error nr.*/ /* Add error numbers before HA_ERR_LAST and change it accordingly. */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) Loading mysql-test/r/federated.result +51 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading mysql-test/r/merge.result +12 −0 Original line number Diff line number Diff line Loading @@ -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 mysql-test/t/federated.test +74 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; mysql-test/t/merge.test +16 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
include/my_base.h +2 −1 Original line number Diff line number Diff line Loading @@ -356,8 +356,9 @@ enum ha_base_keytype { #define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ #define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */ #define HA_ERR_TABLE_NEEDS_UPGRADE 160 /* The table changed in storage engine */ #define HA_ERR_TABLE_READONLY 161 /* The table is not writable */ #define HA_ERR_LAST 160 /*Copy last error nr.*/ #define HA_ERR_LAST 161 /*Copy last error nr.*/ /* Add error numbers before HA_ERR_LAST and change it accordingly. */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) Loading
mysql-test/r/federated.result +51 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading
mysql-test/r/merge.result +12 −0 Original line number Diff line number Diff line Loading @@ -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
mysql-test/t/federated.test +74 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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;
mysql-test/t/merge.test +16 −1 Original line number Diff line number Diff line Loading @@ -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