Loading mysql-test/extra/binlog_tests/blackhole.test +0 −9 Original line number Diff line number Diff line Loading @@ -139,15 +139,6 @@ drop table t1,t2,t3; # table # CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; # NOTE: After exchanging open_ltable() by open_and_lock_tables() in # handle_delayed_insert() to fix problems with MERGE tables (Bug#26379), # problems with INSERT DELAYED and BLACKHOLE popped up. open_ltable() # does not check if the binlogging capabilities of the statement and the # table match. So the below used to succeed. But since INSERT DELAYED # switches to row-based logging in mixed-mode and BLACKHOLE cannot do # row-based logging, it could not really work. Until this problem is # correctly fixed, we have that error here. --error ER_BINLOG_LOGGING_IMPOSSIBLE INSERT DELAYED INTO t1 VALUES(1); DROP TABLE t1; Loading mysql-test/extra/rpl_tests/rpl_blackhole.test 0 → 100644 +32 −0 Original line number Diff line number Diff line # Check replication of one statement assuming that the engine on the # slave is a blackhole engine. # Input: # $statement Statement to evaluate, it is assumed to change t1 # 1. Evaluate statement on master, it is assumed to change t1 # 2. Wait for statement to be processed on slave # 3. SELECT from table t1 to see what was written # 4. Compare position on slave before executing statement and after # executing statement. If difference is >0, then something was # written to the binary log on the slave. connection slave; let $before = query_get_value("SHOW MASTER STATUS", Position, 1); --echo [on master] connection master; eval $statement; --echo [on slave] sync_slave_with_master; --echo # Expect 0 SELECT COUNT(*) FROM t1; let $after = query_get_value("SHOW MASTER STATUS", Position, 1); let $something_written = `select $after - $before != 0`; if ($something_written) { --echo >>> Something was written to binary log <<< } if (!$something_written) { --echo >>> Nothing was written to binary log <<< } mysql-test/lib/mtr_report.pl +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ sub mtr_report_stats ($) { /Slave: According to the master's version/ or /Slave: Column [0-9]* type mismatch/ or /Slave: Error .* doesn't exist/ or /Slave: Error .*Deadlock found/ or /Slave: Deadlock found/ or /Slave: Error .*Unknown table/ or /Slave: Error in Write_rows event: / or /Slave: Field .* of table .* has no default value/ or Loading mysql-test/r/func_group.result +37 −0 Original line number Diff line number Diff line Loading @@ -1416,4 +1416,41 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; AVG(a) CAST(AVG(a) AS DECIMAL) 15 15 DROP TABLE t1; CREATE TABLE derived1 (a bigint(21)); INSERT INTO derived1 VALUES (2); CREATE TABLE D ( pk int(11) NOT NULL AUTO_INCREMENT, int_nokey int(11) DEFAULT NULL, int_key int(11) DEFAULT NULL, filler blob, PRIMARY KEY (pk), KEY int_key (int_key) ); INSERT INTO D VALUES (39,40,4,repeat(' X', 42)), (43,56,4,repeat(' X', 42)), (47,12,4,repeat(' X', 42)), (71,28,4,repeat(' X', 42)), (76,54,4,repeat(' X', 42)), (83,45,4,repeat(' X', 42)), (105,53,12,NULL); SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) 1 DROP TABLE derived1; DROP TABLE D; End of 5.0 tests mysql-test/r/partition.result +70 −0 Original line number Diff line number Diff line Loading @@ -1637,4 +1637,74 @@ select count(*) from t1, t2 where t1.createdDate = t2.createdDate; count(*) 1 drop table t1, t2; create table t1 (s1 int) partition by hash(s1) partitions 2; create index i on t1 (s1); insert into t1 values (1); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; select * from t1; s1 1 1 1 1 1 1 1 1 drop table t1; create table t1 (s1 int) partition by range(s1) (partition pa1 values less than (10), partition pa2 values less than MAXVALUE); create index i on t1 (s1); insert into t1 values (1); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; select * from t1; s1 1 1 1 1 1 1 1 1 drop table t1; create table t1 (s1 int) partition by range(s1) (partition pa1 values less than (10), partition pa2 values less than MAXVALUE); create index i on t1 (s1); insert into t1 values (20); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; select * from t1; s1 20 20 20 20 20 20 20 20 drop table t1; create table t1 (s1 int) partition by range(s1) (partition pa1 values less than (10), partition pa2 values less than MAXVALUE); create index i on t1 (s1); insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; insert into t1 select s1 from t1 where s1=3; select count(*) from t1; count(*) 288 drop table t1; End of 5.1 tests Loading
mysql-test/extra/binlog_tests/blackhole.test +0 −9 Original line number Diff line number Diff line Loading @@ -139,15 +139,6 @@ drop table t1,t2,t3; # table # CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; # NOTE: After exchanging open_ltable() by open_and_lock_tables() in # handle_delayed_insert() to fix problems with MERGE tables (Bug#26379), # problems with INSERT DELAYED and BLACKHOLE popped up. open_ltable() # does not check if the binlogging capabilities of the statement and the # table match. So the below used to succeed. But since INSERT DELAYED # switches to row-based logging in mixed-mode and BLACKHOLE cannot do # row-based logging, it could not really work. Until this problem is # correctly fixed, we have that error here. --error ER_BINLOG_LOGGING_IMPOSSIBLE INSERT DELAYED INTO t1 VALUES(1); DROP TABLE t1; Loading
mysql-test/extra/rpl_tests/rpl_blackhole.test 0 → 100644 +32 −0 Original line number Diff line number Diff line # Check replication of one statement assuming that the engine on the # slave is a blackhole engine. # Input: # $statement Statement to evaluate, it is assumed to change t1 # 1. Evaluate statement on master, it is assumed to change t1 # 2. Wait for statement to be processed on slave # 3. SELECT from table t1 to see what was written # 4. Compare position on slave before executing statement and after # executing statement. If difference is >0, then something was # written to the binary log on the slave. connection slave; let $before = query_get_value("SHOW MASTER STATUS", Position, 1); --echo [on master] connection master; eval $statement; --echo [on slave] sync_slave_with_master; --echo # Expect 0 SELECT COUNT(*) FROM t1; let $after = query_get_value("SHOW MASTER STATUS", Position, 1); let $something_written = `select $after - $before != 0`; if ($something_written) { --echo >>> Something was written to binary log <<< } if (!$something_written) { --echo >>> Nothing was written to binary log <<< }
mysql-test/lib/mtr_report.pl +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ sub mtr_report_stats ($) { /Slave: According to the master's version/ or /Slave: Column [0-9]* type mismatch/ or /Slave: Error .* doesn't exist/ or /Slave: Error .*Deadlock found/ or /Slave: Deadlock found/ or /Slave: Error .*Unknown table/ or /Slave: Error in Write_rows event: / or /Slave: Field .* of table .* has no default value/ or Loading
mysql-test/r/func_group.result +37 −0 Original line number Diff line number Diff line Loading @@ -1416,4 +1416,41 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; AVG(a) CAST(AVG(a) AS DECIMAL) 15 15 DROP TABLE t1; CREATE TABLE derived1 (a bigint(21)); INSERT INTO derived1 VALUES (2); CREATE TABLE D ( pk int(11) NOT NULL AUTO_INCREMENT, int_nokey int(11) DEFAULT NULL, int_key int(11) DEFAULT NULL, filler blob, PRIMARY KEY (pk), KEY int_key (int_key) ); INSERT INTO D VALUES (39,40,4,repeat(' X', 42)), (43,56,4,repeat(' X', 42)), (47,12,4,repeat(' X', 42)), (71,28,4,repeat(' X', 42)), (76,54,4,repeat(' X', 42)), (83,45,4,repeat(' X', 42)), (105,53,12,NULL); SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk LIMIT 1) 1 DROP TABLE derived1; DROP TABLE D; End of 5.0 tests
mysql-test/r/partition.result +70 −0 Original line number Diff line number Diff line Loading @@ -1637,4 +1637,74 @@ select count(*) from t1, t2 where t1.createdDate = t2.createdDate; count(*) 1 drop table t1, t2; create table t1 (s1 int) partition by hash(s1) partitions 2; create index i on t1 (s1); insert into t1 values (1); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; select * from t1; s1 1 1 1 1 1 1 1 1 drop table t1; create table t1 (s1 int) partition by range(s1) (partition pa1 values less than (10), partition pa2 values less than MAXVALUE); create index i on t1 (s1); insert into t1 values (1); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; select * from t1; s1 1 1 1 1 1 1 1 1 drop table t1; create table t1 (s1 int) partition by range(s1) (partition pa1 values less than (10), partition pa2 values less than MAXVALUE); create index i on t1 (s1); insert into t1 values (20); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; select * from t1; s1 20 20 20 20 20 20 20 20 drop table t1; create table t1 (s1 int) partition by range(s1) (partition pa1 values less than (10), partition pa2 values less than MAXVALUE); create index i on t1 (s1); insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8); insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1; insert into t1 select s1 from t1 order by s1 desc; insert into t1 select s1 from t1 where s1=3; select count(*) from t1; count(*) 288 drop table t1; End of 5.1 tests