From f031f0ae67d65b1804f028551e48b96bcbcd8dad Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 11 Mar 2014 17:37:46 +0200 Subject: Fixed test failure (5.5 had different test result than 10.0) --- mysql-test/r/stack-crash.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/stack-crash.result b/mysql-test/r/stack-crash.result index be5b6464b9a..d0a25837675 100644 --- a/mysql-test/r/stack-crash.result +++ b/mysql-test/r/stack-crash.result @@ -1,7 +1,7 @@ drop table if exists t1,t2; Warnings: -Note 1051 Unknown table 'test.t1' -Note 1051 Unknown table 'test.t2' +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' CREATE TABLE t1 ( `sspo_id` int(11) NOT NULL AUTO_INCREMENT, `sspo_uid` int(11) NOT NULL DEFAULT '0', -- cgit v1.2.1 From cb5b6c7e3902f28bf1108cbf86734e78a1c1336c Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Tue, 11 Mar 2014 16:45:08 +0100 Subject: MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) (This is attempt at fix #2) (re-commit with fixed typo) - Moved the testcase from partition_test to partition_innodb.test where it can really work. - Made ordered index scans over ha_partition tables to satisfy ROR property for the case where underlying table uses extended keys. --- mysql-test/r/partition.result | 39 ------------------------------ mysql-test/r/partition_innodb.result | 39 ++++++++++++++++++++++++++++++ mysql-test/r/partition_order.result | 6 ++--- mysql-test/t/partition.test | 46 ----------------------------------- mysql-test/t/partition_innodb.test | 47 ++++++++++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 88 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 521d31ae114..4379cf17ec0 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2494,45 +2494,6 @@ i 4 DROP TABLE t1; # -# MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) -# -create table t1 ( -a int not null, -b int not null, -pk int not null, -primary key (pk), -key(a), -key(b) -) partition by hash(pk) partitions 10; -insert into t1 values (1,2,4); -insert into t1 values (1,0,17); -insert into t1 values (1,2,25); -insert into t1 values (10,20,122); -insert into t1 values (10,20,123); -create table t2 (a int); -insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C; -insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a, -10+A.a + 10*B.a + 100*C.a + 1000*D.a, -2000 + A.a + 10*B.a + 100*C.a + 1000*D.a -from t2 A, t2 B, t2 C ,t2 D; -explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY,a,b b 4 const 982 Using where -create temporary table t3 as -select * from t1 where a=1 and b=2 and pk between 1 and 999 ; -select count(*) from t3; -count(*) -802 -drop table t3; -create temporary table t3 as -select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ; -select count(*) from t3; -count(*) -802 -drop table t3; -drop table t1,t2; -# # MDEV-5555: Incorrect index_merge on BTREE indices # CREATE TABLE t1 ( diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 45b406a5ad0..30a225cadeb 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -639,4 +639,43 @@ col1 col2 col3 1 2 2013-03-11 16:33:04 1 2 2013-03-11 16:33:24 DROP TABLE t1; +# +# MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) +# +create table t1 ( +a int not null, +b int not null, +pk int not null, +primary key (pk), +key(a), +key(b) +) engine=innodb partition by hash(pk) partitions 10; +insert into t1 values (1,2,4); +insert into t1 values (1,0,17); +insert into t1 values (1,2,25); +insert into t1 values (10,20,122); +insert into t1 values (10,20,123); +create table t2 (a int); +insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C; +insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a, +10+A.a + 10*B.a + 100*C.a + 1000*D.a, +2000 + A.a + 10*B.a + 100*C.a + 1000*D.a +from t2 A, t2 B, t2 C ,t2 D; +explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge PRIMARY,a,b b,a 4,4 NULL # Using intersect(b,a); Using where; Using index +create temporary table t3 as +select * from t1 where a=1 and b=2 and pk between 1 and 999 ; +select count(*) from t3; +count(*) +802 +drop table t3; +create temporary table t3 as +select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ; +select count(*) from t3; +count(*) +802 +drop table t3; +drop table t1,t2; set global default_storage_engine=default; diff --git a/mysql-test/r/partition_order.result b/mysql-test/r/partition_order.result index 06c1b63a382..cecfc90eefb 100644 --- a/mysql-test/r/partition_order.result +++ b/mysql-test/r/partition_order.result @@ -734,8 +734,8 @@ a b 7 1 35 2 3 3 -2 4 30 4 +2 4 4 5 6 6 select * from t1 force index (b) where b < 10 ORDER BY b; @@ -744,16 +744,16 @@ a b 7 1 35 2 3 3 -2 4 30 4 +2 4 4 5 6 6 select * from t1 force index (b) where b < 10 ORDER BY b DESC; a b 6 6 4 5 -30 4 2 4 +30 4 3 3 35 2 7 1 diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 63f29ffd978..bb67dddf14a 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2495,52 +2495,6 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 2; SELECT * from t1 order by i; DROP TABLE t1; ---echo # ---echo # MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) ---echo # -create table t1 ( - a int not null, - b int not null, - pk int not null, - primary key (pk), - key(a), - key(b) -) partition by hash(pk) partitions 10; - -insert into t1 values (1,2,4); # both -insert into t1 values (1,0,17); # left -insert into t1 values (1,2,25); # both - -insert into t1 values (10,20,122); -insert into t1 values (10,20,123); - -# Now, fill in some data so that the optimizer choses index_merge -create table t2 (a int); -insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); - -insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C; - -insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a, - 10+A.a + 10*B.a + 100*C.a + 1000*D.a, - 2000 + A.a + 10*B.a + 100*C.a + 1000*D.a - from t2 A, t2 B, t2 C ,t2 D; - -# This should show index_merge, using intersect -explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ; -# 794 rows in output -create temporary table t3 as -select * from t1 where a=1 and b=2 and pk between 1 and 999 ; -select count(*) from t3; -drop table t3; - -# 802 rows in output -create temporary table t3 as -select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ; -select count(*) from t3; -drop table t3; - -drop table t1,t2; - --echo # --echo # MDEV-5555: Incorrect index_merge on BTREE indices --echo # diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 7badc143c8a..f6611255eb7 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -716,5 +716,52 @@ GROUP BY 1, 2, 3; DROP TABLE t1; +--echo # +--echo # MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) +--echo # +create table t1 ( + a int not null, + b int not null, + pk int not null, + primary key (pk), + key(a), + key(b) +) engine=innodb partition by hash(pk) partitions 10; + +insert into t1 values (1,2,4); # both +insert into t1 values (1,0,17); # left +insert into t1 values (1,2,25); # both + +insert into t1 values (10,20,122); +insert into t1 values (10,20,123); + +# Now, fill in some data so that the optimizer choses index_merge +create table t2 (a int); +insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C; + +insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a, + 10+A.a + 10*B.a + 100*C.a + 1000*D.a, + 2000 + A.a + 10*B.a + 100*C.a + 1000*D.a + from t2 A, t2 B, t2 C ,t2 D; + +# This should show index_merge, using intersect +--replace_column 9 # +explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ; +# 794 rows in output +create temporary table t3 as +select * from t1 where a=1 and b=2 and pk between 1 and 999 ; +select count(*) from t3; +drop table t3; + +# 802 rows in output +create temporary table t3 as +select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ; +select count(*) from t3; +drop table t3; + +drop table t1,t2; + set global default_storage_engine=default; -- cgit v1.2.1 From 1f2ef5740360148961151a71603faae497919aa6 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 6 Mar 2014 13:56:34 -0800 Subject: Fixed bug mdev-5686. The calls of the function remove_eq_conds() may change the and/or structure of the where conditions. So JOIN::equal_cond should be updated for non-recursive calls of remove_eq_conds(). --- mysql-test/r/subselect4.result | 22 ++++++++++++++++++++++ mysql-test/t/subselect4.test | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 6c314c448cb..6ab62c801f7 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -2375,5 +2375,27 @@ ORDER BY v2.id; id a2 a3 id a2 a3 DROP VIEW v2; DROP TABLE t1,t2; +# +# MDEV-5686: degenerate disjunct in NOT IN subquery +# +CREATE TABLE t1 (a int, b int, c varchar(3)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,1,'CAN'),(2,2,'AUS'); +CREATE TABLE t2 (f int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); +EXPLAIN EXTENDED +SELECT * FROM t2 +WHERE f NOT IN (SELECT b FROM t1 +WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 system NULL NULL NULL NULL 1 100.00 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select 3 AS `f` from `test`.`t2` where (not(<3>((3,(select `test`.`t1`.`b` from `test`.`t1` where (((`test`.`t1`.`c` = 'USA') or (`test`.`t1`.`c` <> 'USA')) and trigcond((((3) = `test`.`t1`.`b`) or isnull(`test`.`t1`.`b`))) and (`test`.`t1`.`b` = `test`.`t1`.`a`)) having trigcond((`test`.`t1`.`b`))))))) +SELECT * FROM t2 +WHERE f NOT IN (SELECT b FROM t1 +WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); +f +3 +DROP TABLE t1,t2; SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 6aa1fd51859..0d029e1bf8f 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -1970,5 +1970,26 @@ ORDER BY v2.id; DROP VIEW v2; DROP TABLE t1,t2; +--echo # +--echo # MDEV-5686: degenerate disjunct in NOT IN subquery +--echo # + +CREATE TABLE t1 (a int, b int, c varchar(3)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,1,'CAN'),(2,2,'AUS'); + +CREATE TABLE t2 (f int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); + +EXPLAIN EXTENDED +SELECT * FROM t2 + WHERE f NOT IN (SELECT b FROM t1 + WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); + +SELECT * FROM t2 + WHERE f NOT IN (SELECT b FROM t1 + WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); + +DROP TABLE t1,t2; + SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; -- cgit v1.2.1 From 321ff25f3d419bc1a1fae2390450d1b4db30b64c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2014 13:57:07 +0200 Subject: MDEV-5740: Assertion `!derived->first_select()->exclude_from_table_unique_test || derived->outer_select()-> exclude_from_table_unique_test' failed on 2nd execution of PS with derived_merge Do not check tables of executed units. Debug info about stages of derived tables execution added. --- mysql-test/r/derived_view.result | 40 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/derived_view.test | 27 +++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index acce2afb124..e958bfbdca4 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -2356,6 +2356,46 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DEPENDENT SUBQUERY pi ref gallery_id gallery_id 4 test.gal.id 4 Using temporary; Using filesort drop table galleries, pictures; # +# MDEV-5740: Assertion +#`!derived->first_select()->exclude_from_table_unique_test || +#derived->outer_select()-> exclude_from_table_unique_test' +#failed on 2nd execution of PS with derived_merge +# +set @save_optimizer_switch5740=@@optimizer_switch; +SET optimizer_switch = 'derived_merge=on'; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +PREPARE stmt FROM ' + INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM (SELECT * FROM t1) AS sq +'; +EXECUTE stmt; +select * from t1; +a +1 +2 +3 +4 +1 +2 +EXECUTE stmt; +select * from t1; +a +1 +2 +3 +4 +1 +2 +3 +4 +1 +2 +deallocate prepare stmt; +drop table t1,t2; +set optimizer_switch=@save_optimizer_switch5740; +# # end of 5.3 tests # set optimizer_switch=@exit_optimizer_switch; diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test index 61e11cebad4..de08b1c4d0d 100644 --- a/mysql-test/t/derived_view.test +++ b/mysql-test/t/derived_view.test @@ -1703,6 +1703,33 @@ ORDER BY gallery_name ASC drop table galleries, pictures; +--echo # +--echo # MDEV-5740: Assertion +--echo #`!derived->first_select()->exclude_from_table_unique_test || +--echo #derived->outer_select()-> exclude_from_table_unique_test' +--echo #failed on 2nd execution of PS with derived_merge +--echo # + +set @save_optimizer_switch5740=@@optimizer_switch; +SET optimizer_switch = 'derived_merge=on'; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +PREPARE stmt FROM ' + INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM (SELECT * FROM t1) AS sq +'; +EXECUTE stmt; +select * from t1; +EXECUTE stmt; +select * from t1; +deallocate prepare stmt; + +drop table t1,t2; +set optimizer_switch=@save_optimizer_switch5740; + --echo # --echo # end of 5.3 tests --echo # -- cgit v1.2.1 From d8ea8a3d13d2a754a1e80d11619ba3347bb7ee5f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Mar 2014 12:34:16 +0200 Subject: MDEV-5717: Server crash with insert statement containing DEFAULT into view Item_default_value::arg can be NULL so walk() should take it into consideration. --- mysql-test/r/view.result | 16 ++++++++++++++++ mysql-test/t/view.test | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 8e5c082c6c1..1435b0c7a97 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4790,6 +4790,22 @@ v1_field1 deallocate prepare my_stmt; DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; +# +#MDEV-5717: Server crash with insert statement containing DEFAULT into +#view +# +CREATE TABLE t1 ( +`id` int(10) unsigned NOT NULL AUTO_INCREMENT, +`test` tinyint(3) unsigned NOT NULL DEFAULT '0', +PRIMARY KEY (`id`) +); +CREATE VIEW v1 AS (select t1.id AS id, t1.test AS test from t1); +INSERT INTO v1 SET test = DEFAULT; +select * from v1; +id test +1 0 +drop view v1; +drop table t1; # ----------------------------------------------------------------- # -- End of 5.3 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index d3a7e098ad8..5a2d90180ea 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4720,6 +4720,25 @@ deallocate prepare my_stmt; DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; +--echo # +--echo #MDEV-5717: Server crash with insert statement containing DEFAULT into +--echo #view +--echo # +CREATE TABLE t1 ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `test` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +); + +CREATE VIEW v1 AS (select t1.id AS id, t1.test AS test from t1); + +INSERT INTO v1 SET test = DEFAULT; + +select * from v1; + +drop view v1; +drop table t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- -- cgit v1.2.1 From 8c04dd33dd7ab1c261bd15ace2009832af7a2f98 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 13 Mar 2014 12:20:57 +0100 Subject: MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON - With big_tables=ON, materialized table will use Aria (or MyISAM) SE, which allows prefix key reads. However, the temp.table has rec_per_key=NULL which causes the optimizer to crash when attempting to read index statistics for a prefix index read. - Fixed by providing a rec_per_key array with zeros (i.e. "no statistics data") --- mysql-test/r/subselect_mat.result | 14 ++++++++++++++ mysql-test/r/subselect_sj_mat.result | 14 ++++++++++++++ mysql-test/t/subselect_sj_mat.test | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index c47881d5434..7743e804f17 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -2041,6 +2041,20 @@ EXECUTE stmt; a DROP TABLE t1, t2; DROP VIEW v2; +# +# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +# +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +SELECT * FROM t1 AS t1_1, t1 AS t1_2 +WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); +a a +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; # End of 5.3 tests set @subselect_mat_test_optimizer_switch_value=null; set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off'; diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result index f267f32c887..9f3cb5ce0b8 100644 --- a/mysql-test/r/subselect_sj_mat.result +++ b/mysql-test/r/subselect_sj_mat.result @@ -2081,4 +2081,18 @@ EXECUTE stmt; a DROP TABLE t1, t2; DROP VIEW v2; +# +# MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +# +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +SELECT * FROM t1 AS t1_1, t1 AS t1_2 +WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); +a a +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; # End of 5.3 tests diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test index bf5360dd4a7..5e7103aa6e9 100644 --- a/mysql-test/t/subselect_sj_mat.test +++ b/mysql-test/t/subselect_sj_mat.test @@ -1726,4 +1726,22 @@ EXECUTE stmt; DROP TABLE t1, t2; DROP VIEW v2; +--echo # +--echo # MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +--echo # +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +SELECT * FROM t1 AS t1_1, t1 AS t1_2 + WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); + +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; + --echo # End of 5.3 tests -- cgit v1.2.1 From 18830d78a3796076747278afe9c85b48531f8f9c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 13 Mar 2014 16:34:34 +0100 Subject: mtr: move if(unix_socket) test to include/have_unix_socket.inc --- mysql-test/include/have_unix_socket.inc | 10 ++++++++++ mysql-test/suite/plugins/t/unix_socket.test | 6 +----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 mysql-test/include/have_unix_socket.inc (limited to 'mysql-test') diff --git a/mysql-test/include/have_unix_socket.inc b/mysql-test/include/have_unix_socket.inc new file mode 100644 index 00000000000..6e4c3b9826b --- /dev/null +++ b/mysql-test/include/have_unix_socket.inc @@ -0,0 +1,10 @@ +--source include/not_embedded.inc + +if (!$AUTH_SOCKET_SO) { + skip No unix_socket plugin; +} + +if (!$USER) { + skip USER variable is undefined; +} + diff --git a/mysql-test/suite/plugins/t/unix_socket.test b/mysql-test/suite/plugins/t/unix_socket.test index fc2e6c5b3c6..3ce1d0323fb 100644 --- a/mysql-test/suite/plugins/t/unix_socket.test +++ b/mysql-test/suite/plugins/t/unix_socket.test @@ -1,8 +1,4 @@ ---source include/not_embedded.inc - -if (!$AUTH_SOCKET_SO) { - skip No auth_socket plugin; -} +--source include/have_unix_socket.inc let $plugindir=`SELECT @@global.plugin_dir`; -- cgit v1.2.1 From 5616bd55973cd1c4f4005e7033e7adff7397214d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 13 Mar 2014 16:35:14 +0100 Subject: unix_socket bypasses make_if_fail by not doing any network reads --- mysql-test/r/failed_auth_unixsocket.result | 12 ++++++++++++ mysql-test/t/failed_auth_unixsocket.test | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 mysql-test/r/failed_auth_unixsocket.result create mode 100644 mysql-test/t/failed_auth_unixsocket.test (limited to 'mysql-test') diff --git a/mysql-test/r/failed_auth_unixsocket.result b/mysql-test/r/failed_auth_unixsocket.result new file mode 100644 index 00000000000..7e2499795cb --- /dev/null +++ b/mysql-test/r/failed_auth_unixsocket.result @@ -0,0 +1,12 @@ +update mysql.user set plugin='unix_socket'; +flush privileges; +connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET); +ERROR HY000: Plugin 'unix_socket' is not loaded +ERROR HY000: Plugin 'unix_socket' is not loaded +install plugin unix_socket soname 'auth_socket.so'; +connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'USER'@'localhost' (using password: NO) +ERROR 28000: Access denied for user 'USER'@'localhost' (using password: NO) +update mysql.user set plugin=''; +flush privileges; +uninstall plugin unix_socket; diff --git a/mysql-test/t/failed_auth_unixsocket.test b/mysql-test/t/failed_auth_unixsocket.test new file mode 100644 index 00000000000..36649312a00 --- /dev/null +++ b/mysql-test/t/failed_auth_unixsocket.test @@ -0,0 +1,29 @@ +--source include/have_unix_socket.inc + +# +# MDEV-3909 remote user enumeration +# unix_socket tests +# +update mysql.user set plugin='unix_socket'; +flush privileges; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT $USER USER +--error ER_PLUGIN_IS_NOT_LOADED +connect (fail,localhost,$USER); + +--error ER_PLUGIN_IS_NOT_LOADED +change_user $USER; + +eval install plugin unix_socket soname '$AUTH_SOCKET_SO'; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT $USER USER +--error ER_ACCESS_DENIED_ERROR +connect (fail,localhost,$USER); + +--error ER_ACCESS_DENIED_ERROR +change_user $USER; + +update mysql.user set plugin=''; +flush privileges; +uninstall plugin unix_socket; + -- cgit v1.2.1 From 8428c116c7cc1fb6a04345637a10084810874dd8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 13 Mar 2014 20:12:50 +0100 Subject: don't run unix_socket tests when $USER is already present in mysql.user (as it's done in 10.0) --- mysql-test/include/have_unix_socket.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/include/have_unix_socket.inc b/mysql-test/include/have_unix_socket.inc index 6e4c3b9826b..4246b138e9d 100644 --- a/mysql-test/include/have_unix_socket.inc +++ b/mysql-test/include/have_unix_socket.inc @@ -8,3 +8,6 @@ if (!$USER) { skip USER variable is undefined; } +if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USER'`) { + skip \$USER=$USER which exists in mysql.user; +} -- cgit v1.2.1 From 5c8ed7dd5473c398f788aba3aff5c168a50df83a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Mar 2014 11:38:17 +0200 Subject: MDEV-5446: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' fails on EXPLAIN EXTENDED with VALUES function field_index should be set correctly for null field created by Item_insert_value::fix_fields(). --- mysql-test/r/func_misc.result | 16 ++++++++++++++++ mysql-test/t/func_misc.test | 15 +++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 56d27ff78be..83513446edf 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -272,3 +272,19 @@ ERROR HY000: Incorrect arguments to NAME_CONST SELECT NAME_CONST('a', -(1)) OR 1; NAME_CONST('a', -(1)) OR 1 1 +# +#MDEV-5446: Assertion `!table || (!table->read_set || +#bitmap_is_set(table->read_set, field_index))' fails on +#EXPLAIN EXTENDED with VALUES function +# +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,10); +CREATE VIEW v1 AS SELECT * FROM t1; +EXPLAIN EXTENDED SELECT VALUES(b) FROM v1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 +Warnings: +Note 1003 select values(10) AS `VALUES(b)` from `test`.`t1` +drop view v1; +drop table t1; +End of 5.3 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index c4cc7734186..5cf316587b3 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -310,3 +310,18 @@ SELECT NAME_CONST('a', -(1 OR 2)) OR 1; SELECT NAME_CONST('a', -(1 AND 2)) AND 1; SELECT NAME_CONST('a', -(1)) OR 1; +--echo # +--echo #MDEV-5446: Assertion `!table || (!table->read_set || +--echo #bitmap_is_set(table->read_set, field_index))' fails on +--echo #EXPLAIN EXTENDED with VALUES function +--echo # +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,10); +CREATE VIEW v1 AS SELECT * FROM t1; + +EXPLAIN EXTENDED SELECT VALUES(b) FROM v1; + +drop view v1; +drop table t1; + +--echo End of 5.3 tests -- cgit v1.2.1 From dd13db6f4ae70f45038c1d000cb1439e17170d98 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 14 Mar 2014 16:29:23 +0200 Subject: MDEV-5829: STOP SLAVE resets global status variables Reason for the bug was an optimization for higher connect speed where we moved when global status was updated, but forgot to update states when slave thread dies. Fixed by adding thd->add_status_to_global() before deleting slave thread's thd. mysys/my_delete.c: Added missing newline sql/mysqld.cc: Use add_status_to_global() sql/slave.cc: Added missing add_status_to_global() sql/sql_class.cc: Use add_status_to_global() sql/sql_class.h: Simplify adding local status to global by adding add_status_to_global() --- mysql-test/suite/rpl/r/rpl_000011.result | 6 ++++++ mysql-test/suite/rpl/t/rpl_000011.test | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_000011.result b/mysql-test/suite/rpl/r/rpl_000011.result index 8a59eb746ad..12859a17f95 100644 --- a/mysql-test/suite/rpl/r/rpl_000011.result +++ b/mysql-test/suite/rpl/r/rpl_000011.result @@ -2,7 +2,13 @@ include/master-slave.inc [connection master] create table t1 (n int); insert into t1 values(1); +show global status like 'com_insert'; +Variable_name Value +Com_insert 1 stop slave; +show global status like 'com_insert'; +Variable_name Value +Com_insert 1 include/wait_for_slave_to_stop.inc start slave; include/wait_for_slave_to_start.inc diff --git a/mysql-test/suite/rpl/t/rpl_000011.test b/mysql-test/suite/rpl/t/rpl_000011.test index 625b0c22c62..faad2242235 100644 --- a/mysql-test/suite/rpl/t/rpl_000011.test +++ b/mysql-test/suite/rpl/t/rpl_000011.test @@ -1,9 +1,17 @@ +# +# Test very simply slave replication (to ensure it works at all) +# In addition, test also: +# MDEV-5829 STOP SLAVE resets global status variables +# + source include/master-slave.inc; create table t1 (n int); insert into t1 values(1); sync_slave_with_master; +show global status like 'com_insert'; stop slave; +show global status like 'com_insert'; --source include/wait_for_slave_to_stop.inc start slave; --source include/wait_for_slave_to_start.inc -- cgit v1.2.1 From 1127d567357418d156822e4ebb9eb99b08514c2d Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 18 Mar 2014 10:26:50 +0200 Subject: Fixed some buildbot failures mysql-test/suite/rpl/t/rpl_000011-master.opt: Added master.opt file to ensure that other tests don't interfere with rpl_000011 plugin/server_audit/server_audit.c: Fixed compiler error on solaris support-files/compiler_warnings.supp: Ignore warning from xtradb --- mysql-test/suite/rpl/t/rpl_000011-master.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/suite/rpl/t/rpl_000011-master.opt (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/t/rpl_000011-master.opt b/mysql-test/suite/rpl/t/rpl_000011-master.opt new file mode 100644 index 00000000000..7c3d2411b28 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_000011-master.opt @@ -0,0 +1 @@ +--verbose=1 -- cgit v1.2.1 From 7b57dcb4634c1212d9eb4cd228167722d542d613 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 18 Mar 2014 16:26:02 +0200 Subject: Fixed buildbot issues mysql-test/suite/rpl/t/rpl_000011-slave.opt: Renamed test case as it's slave that needs to restarted support-files/compiler_warnings.supp: Fixed bad characters in suppression --- mysql-test/suite/rpl/t/rpl_000011-master.opt | 1 - mysql-test/suite/rpl/t/rpl_000011-slave.opt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 mysql-test/suite/rpl/t/rpl_000011-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_000011-slave.opt (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/t/rpl_000011-master.opt b/mysql-test/suite/rpl/t/rpl_000011-master.opt deleted file mode 100644 index 7c3d2411b28..00000000000 --- a/mysql-test/suite/rpl/t/rpl_000011-master.opt +++ /dev/null @@ -1 +0,0 @@ ---verbose=1 diff --git a/mysql-test/suite/rpl/t/rpl_000011-slave.opt b/mysql-test/suite/rpl/t/rpl_000011-slave.opt new file mode 100644 index 00000000000..7c3d2411b28 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_000011-slave.opt @@ -0,0 +1 @@ +--verbose=1 -- cgit v1.2.1 From 63d0918807739dd19578ce9db80acbfd8ea158e6 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sun, 23 Mar 2014 16:02:56 +0400 Subject: MDEV-5783 Assertion `0' failed in make_sortkey(SORTPARAM*, uchar*, uchar*) on ORDER BY HEX( UNCOMPRESSED_LENGTH( pk ) ) --- mysql-test/r/func_compress.result | 20 ++++++++++++++++++++ mysql-test/t/func_compress.test | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 37f7c475148..105f2a53926 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -127,3 +127,23 @@ NULL 825307441 EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s; DROP TABLE t1; End of 5.0 tests +# +# Start of 5.3 tests +# +# +# MDEV-5783 Assertion `0' failed in make_sortkey(SORTPARAM*, uchar*, uchar*) on ORDER BY HEX(UNCOMPRESSED_LENGTH(pk)) +# +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT UNCOMPRESSED_LENGTH(pk) FROM t1; +UNCOMPRESSED_LENGTH(pk) +NULL +NULL +Warnings: +Error 1259 ZLIB: Input data corrupted +Error 1259 ZLIB: Input data corrupted +SELECT * FROM t1 ORDER BY HEX(UNCOMPRESSED_LENGTH(pk)); +DROP TABLE t1; +# +# End of 5.3 tests +# diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 207f3a436d0..eaed0c88fe1 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -115,3 +115,24 @@ DROP TABLE t1; set @@global.max_allowed_packet=default; --enable_result_log --enable_query_log + + +--echo # +--echo # Start of 5.3 tests +--echo # + +--echo # +--echo # MDEV-5783 Assertion `0' failed in make_sortkey(SORTPARAM*, uchar*, uchar*) on ORDER BY HEX(UNCOMPRESSED_LENGTH(pk)) +--echo # +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT UNCOMPRESSED_LENGTH(pk) FROM t1; +# ORDER is not strict, so disable results +--disable_result_log +SELECT * FROM t1 ORDER BY HEX(UNCOMPRESSED_LENGTH(pk)); +--enable_result_log +DROP TABLE t1; + +--echo # +--echo # End of 5.3 tests +--echo # -- cgit v1.2.1 From 097566d61c16590364251fe940c0cb33d641076b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 24 Mar 2014 20:01:45 +0100 Subject: rpl tests: move "include/master-slave.inc" down to be after all possible checks that can skip the test --- mysql-test/suite/rpl/t/rpl_bug37426.test | 2 +- mysql-test/suite/rpl/t/rpl_connection.test | 2 +- mysql-test/suite/rpl/t/rpl_known_bugs_detection.test | 7 ++++--- mysql-test/suite/rpl/t/rpl_mix_found_rows.test | 2 +- mysql-test/suite/rpl/t/rpl_row_find_row_debug.test | 2 +- mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test | 2 +- mysql-test/suite/rpl/t/rpl_row_utf32.test | 2 +- mysql-test/suite/rpl/t/rpl_stm_sql_mode.test | 2 +- mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test | 2 +- mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test | 2 +- 10 files changed, 13 insertions(+), 12 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/t/rpl_bug37426.test b/mysql-test/suite/rpl/t/rpl_bug37426.test index d0a60524fef..18e80a5f806 100644 --- a/mysql-test/suite/rpl/t/rpl_bug37426.test +++ b/mysql-test/suite/rpl/t/rpl_bug37426.test @@ -3,8 +3,8 @@ # RBR breaks for CHAR() UTF8 fields > 85 chars ############################################################# -source include/master-slave.inc; source include/have_binlog_format_row.inc; +source include/master-slave.inc; connection master; CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL); diff --git a/mysql-test/suite/rpl/t/rpl_connection.test b/mysql-test/suite/rpl/t/rpl_connection.test index 1233e28dc86..310240061d1 100644 --- a/mysql-test/suite/rpl/t/rpl_connection.test +++ b/mysql-test/suite/rpl/t/rpl_connection.test @@ -1,6 +1,6 @@ --source include/not_embedded.inc ---source include/master-slave.inc --source include/have_binlog_format_mixed.inc +--source include/master-slave.inc # # BUG#13427949: CHANGE MASTER TO USER='' (EMPTY USER) CAUSES ERRORS ON VALGRING diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index ee41df6592b..ab263ece407 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -8,13 +8,14 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state source include/have_debug.inc; # because of pretend_version_50034_in_binlog the test can't run with checksum source include/have_binlog_checksum_off.inc; -source include/master-slave.inc; - -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); # Currently only statement-based-specific bugs are here -- source include/have_binlog_format_statement.inc +source include/master-slave.inc; + +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); + # # This is to test that slave properly detects if # master may suffer from: diff --git a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test index ed932eb5cea..433280326c7 100644 --- a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test +++ b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test @@ -1,5 +1,5 @@ -source include/master-slave.inc; source include/have_binlog_format_mixed.inc; +source include/master-slave.inc; # It is not possible to replicate FOUND_ROWS() using statement-based # replication, but there is a workaround that stores the result of diff --git a/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test b/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test index af7ccf74295..fb7491b0077 100644 --- a/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test +++ b/mysql-test/suite/rpl/t/rpl_row_find_row_debug.test @@ -1,9 +1,9 @@ # # Bug#11760927: 53375: RBR + NO PK => HIGH LOAD ON SLAVE (TABLE SCAN/CPU) => SLAVE FAILURE # ---source include/master-slave.inc --source include/have_binlog_format_row.inc --source include/have_debug.inc +--source include/master-slave.inc # SETUP # - setup log_warnings and debug diff --git a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test index 9e6485d6630..31eea3a2068 100644 --- a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test +++ b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test @@ -1,5 +1,5 @@ -source include/master-slave.inc; source include/have_binlog_format_mixed.inc; +source include/master-slave.inc; # # Bug #30244: row_count/found_rows does not replicate well diff --git a/mysql-test/suite/rpl/t/rpl_row_utf32.test b/mysql-test/suite/rpl/t/rpl_row_utf32.test index 936d62b09bd..c82cd4e5c2f 100644 --- a/mysql-test/suite/rpl/t/rpl_row_utf32.test +++ b/mysql-test/suite/rpl/t/rpl_row_utf32.test @@ -1,6 +1,6 @@ --- source include/master-slave.inc -- source include/have_binlog_format_row.inc -- source include/have_utf32.inc +-- source include/master-slave.inc # # BUG#51787 Assertion `(n % 4) == 0' on slave upon INSERT into a table with UTF32 diff --git a/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test b/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test index 0eb41d1c6bd..56821621bfe 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test +++ b/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test @@ -1,5 +1,5 @@ --- source include/master-slave.inc -- source include/have_binlog_format_statement.inc +-- source include/master-slave.inc # # Bug #51055 Replication failure on duplicate key + traditional SQL mode diff --git a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test index 84d663298c4..31880d17dfb 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test +++ b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test @@ -2,9 +2,9 @@ # Please, check extra/rpl_tests/rpl_stop_middle_group.test. ################################################################################### -- source include/have_debug.inc --- source include/master-slave.inc -- source include/have_innodb.inc -- source include/have_binlog_format_statement.inc +-- source include/master-slave.inc SET @@session.binlog_direct_non_transactional_updates= FALSE; -- source extra/rpl_tests/rpl_stop_middle_group.test diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index aa22b23925c..e9cc098857e 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -5,8 +5,8 @@ # does not exist' base on myisam engine. # -source include/master-slave.inc; source include/have_binlog_format_row.inc; +source include/master-slave.inc; LET $ENGINE_TYPE= MyISAM; source extra/rpl_tests/rpl_tmp_table_and_DDL.test; -- cgit v1.2.1 From bd4e7dac59f890c0a687a7f96af0fa768e82f180 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 24 Mar 2014 20:02:00 +0100 Subject: mysqltest bug: reset --replace command after every error message (because error messages use replacements) --- mysql-test/t/failed_auth_unixsocket.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/t/failed_auth_unixsocket.test b/mysql-test/t/failed_auth_unixsocket.test index fdde7399fc3..ba31cf6a59f 100644 --- a/mysql-test/t/failed_auth_unixsocket.test +++ b/mysql-test/t/failed_auth_unixsocket.test @@ -20,6 +20,7 @@ eval install plugin unix_socket soname '$AUTH_SOCKET_SO'; --error ER_ACCESS_DENIED_NO_PASSWORD_ERROR connect (fail,localhost,$USER); +--replace_result $USER USER --error ER_ACCESS_DENIED_NO_PASSWORD_ERROR change_user $USER; -- cgit v1.2.1 From ded448d1d035d211c8146141546a08126bb728b6 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 26 Mar 2014 21:58:27 +0200 Subject: MDEV-5905: Creating tmp. memory table kills the server The reason was that a couple of variables that hold number of rows that was used to calculate buffers was uint and caused an overflow. Fixed by changing variables that could hold number of rows from uint to ulong and also added a cast for this test. include/heap.h: Reorder to get better alignment. Changed variables that could hold number of rows from uint to ulong mysql-test/suite/heap/heap.result: Added test case mysql-test/suite/heap/heap.test: Added test case mysql-test/suite/plugins/t/server_audit.test: Added sleep as we want to have disconnect logged before we try a new connect storage/heap/ha_heap.cc: Changed variables that could hold number of rows from uint to ulong Limit number of rows to 4G (as most of the variables that holds rows are ulong anyway) reset records_changed when key_stat_version is changed to not cause increments for every row changed storage/heap/ha_heap.h: changed records_changed to ulong as this can get big storage/heap/hp_create.c: Changed variables that could hold number of rows from uint to ulong Added cast (fixed the original bug) storage/heap/hp_delete.c: Changed variables that could hold number of rows from uint to ulong storage/heap/hp_open.c: Removed not needed cast storage/heap/hp_write.c: Changed variables that could hold number of rows from uint to ulong support-files/compiler_warnings.supp: Removed extra : from supression --- mysql-test/suite/heap/heap.result | 8 ++++++++ mysql-test/suite/heap/heap.test | 15 +++++++++++++++ mysql-test/suite/plugins/t/server_audit.test | 1 + 3 files changed, 24 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result index e61b9bcc2bf..878b4aa7749 100644 --- a/mysql-test/suite/heap/heap.result +++ b/mysql-test/suite/heap/heap.result @@ -810,3 +810,11 @@ select data_length,index_length from information_schema.tables where table_schem data_length index_length 81024 121024 drop table t1; +CREATE TABLE t1 (id INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +SET @@max_heap_table_size = 1024*1024*1024*20; +CREATE TEMPORARY TABLE tmp ENGINE=MEMORY +SELECT id FROM t1; +DROP TEMPORARY TABLE tmp; +drop table t1; diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test index ab2a4f0a6d6..106ece540a4 100644 --- a/mysql-test/suite/heap/heap.test +++ b/mysql-test/suite/heap/heap.test @@ -563,3 +563,18 @@ insert into t1 select rand(100000000) from t1; --replace_result 40512 81024 60512 121024 select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; drop table t1; + +# +# MDEV-5905 Creating tmp. memory table kills the server +# + +CREATE TABLE t1 (id INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); + +SET @@max_heap_table_size = 1024*1024*1024*20; + +CREATE TEMPORARY TABLE tmp ENGINE=MEMORY + SELECT id FROM t1; +DROP TEMPORARY TABLE tmp; +drop table t1; diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index f62980259c0..f63c8022392 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -14,6 +14,7 @@ set global server_audit_logging=on; connect (con1,localhost,root,,mysql); connection default; disconnect con1; +--sleep 2 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR connect (con1,localhost,no_such_user,,mysql); -- cgit v1.2.1 From 44002a34e680c79c01df879b540458c2885e97e8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 26 Mar 2014 19:56:23 +0100 Subject: MDEV-5955 Server crashes in handler::ha_external_lock or assertion `m_lock_type == 2' fails in handler::ha_close on disconnect with a locked temporary table first unlock locked tables, then close and remove temporary --- mysql-test/r/locked_temporary-5955.result | 2 ++ mysql-test/t/locked_temporary-5955.test | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 mysql-test/r/locked_temporary-5955.result create mode 100644 mysql-test/t/locked_temporary-5955.test (limited to 'mysql-test') diff --git a/mysql-test/r/locked_temporary-5955.result b/mysql-test/r/locked_temporary-5955.result new file mode 100644 index 00000000000..8999bdd39c4 --- /dev/null +++ b/mysql-test/r/locked_temporary-5955.result @@ -0,0 +1,2 @@ +CREATE TEMPORARY TABLE tmp (i INT) ENGINE=InnoDB; +LOCK TABLES tmp AS p WRITE; diff --git a/mysql-test/t/locked_temporary-5955.test b/mysql-test/t/locked_temporary-5955.test new file mode 100644 index 00000000000..1ade63f4913 --- /dev/null +++ b/mysql-test/t/locked_temporary-5955.test @@ -0,0 +1,10 @@ +# +# MDEV-5955 Server crashes in handler::ha_external_lock or assertion `m_lock_type == 2' fails in handler::ha_close on disconnect with a locked temporary table +# + +--source include/have_innodb.inc +--connect (con1,localhost,root,,) +CREATE TEMPORARY TABLE tmp (i INT) ENGINE=InnoDB; +LOCK TABLES tmp AS p WRITE; +--disconnect con1 + -- cgit v1.2.1