From 8b41f491c82063382bc76d8a8c266b83b0ab8fe0 Mon Sep 17 00:00:00 2001 From: Chaithra Gopalareddy Date: Thu, 10 Jan 2013 16:17:13 +0530 Subject: Bug#11760726: LEFT JOIN OPTIMIZED INTO JOIN LEADS TO INCORRECT RESULTS This is a backport of fix for Bug#13068506. mysql-test/r/join_outer.result: Added test result for Bug#13068506 mysql-test/t/join_outer.test: Added test case for Bug#13068506 sql/item.h: Implement Item_outer_ref::not_null_tables() --- mysql-test/r/join_outer.result | 32 ++++++++++++++++++++++++++++++++ mysql-test/t/join_outer.test | 30 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index d8a734a7158..f745e953331 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1485,4 +1485,36 @@ EXECUTE prep_stmt; f 1 DROP TABLE t1; +# +# Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS +# WRONG RESULT +# +CREATE TABLE t1 (i1 int); +INSERT INTO t1 VALUES (100), (101); +CREATE TABLE t2 (i2 int, i3 int); +INSERT INTO t2 VALUES (20,1),(10,2); +CREATE TABLE t3 (i4 int(11)); +INSERT INTO t3 VALUES (1),(2); + +SELECT ( +SELECT MAX( t2.i2 ) +FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 ) +WHERE t2.i3 <> t1.i1 +) AS field1 +FROM t1;; +field1 +20 +20 + +SELECT ( +SELECT MAX( t2.i2 ) +FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 ) +WHERE t2.i3 <> t1.i1 +) AS field1 +FROM t1 GROUP BY field1;; +field1 +20 + +drop table t1,t2,t3; +# End of test for Bug#13068506 End of 5.1 tests diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 1ba29fdd4cf..13811731dad 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -1067,5 +1067,35 @@ EXECUTE prep_stmt; DROP TABLE t1; +--echo # +--echo # Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS +--echo # WRONG RESULT +--echo # + +CREATE TABLE t1 (i1 int); +INSERT INTO t1 VALUES (100), (101); + +CREATE TABLE t2 (i2 int, i3 int); +INSERT INTO t2 VALUES (20,1),(10,2); + +CREATE TABLE t3 (i4 int(11)); +INSERT INTO t3 VALUES (1),(2); + +let $query= SELECT ( + SELECT MAX( t2.i2 ) + FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 ) + WHERE t2.i3 <> t1.i1 +) AS field1 +FROM t1; + +--echo +--eval $query; +--echo +--eval $query GROUP BY field1; + +--echo +drop table t1,t2,t3; + +--echo # End of test for Bug#13068506 --echo End of 5.1 tests -- cgit v1.2.1 From 01208b5b0f3d175408c01afc1e06b07019ca7c2f Mon Sep 17 00:00:00 2001 From: Anirudh Mangipudi Date: Wed, 16 Jan 2013 18:26:27 +0530 Subject: BUG#14117025: UNABLE TO RESTORE DUMP Problem: When a view, with a specific character set and collation, is created on another view with a different character set and collation the dump restoration results in an illegal mix of collations error. SOLUTION: To avoid this confusion of collations, the create table datatype being used is hardcoded as "tinyint NOT NULL". This will not matter as the table created will be dropped at runtime and specifically tinyint is used to avoid hitting the row size conflicts. --- mysql-test/r/mysqldump.result | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index fac94e855a4..bc5b5095196 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1988,7 +1988,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2082,7 +2082,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -2156,7 +2156,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2270,9 +2270,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -2280,7 +2280,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v3`; @@ -2288,9 +2288,9 @@ DROP TABLE IF EXISTS `v3`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v3` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -3027,9 +3027,9 @@ DROP TABLE IF EXISTS `v0`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v0` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v1`; @@ -3037,9 +3037,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -3047,9 +3047,9 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3429,7 +3429,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3489,7 +3489,7 @@ USE `mysqldump_views`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `nasishnasifu` ( - `id` bigint(20) unsigned + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3882,7 +3882,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `c` int(11) + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -4299,7 +4299,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; -- cgit v1.2.1 From e7283ceaf034072dcd9ad01b2377ee2101eb1b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 21 Jan 2013 14:59:49 +0200 Subject: Bug#16067973 DROP TABLE SLOW WHEN IT DECOMPRESS COMPRESSED-ONLY PAGES buf_page_get_gen(): Do not attempt to decompress a compressed-only page when mode == BUF_PEEK_IF_IN_POOL. This mode is only being used by btr_search_drop_page_hash_when_freed(). There cannot be any adaptive hash index pointing to a page that does not exist in uncompressed format in the buffer pool. innodb_buffer_pool_evict_update(): New function for debug builds, to handle SET GLOBAL innodb_buffer_pool_evicted='uncompressed' by evicting all uncompressed page frames of compressed tablespaces from the buffer pool. rb#1873 approved by Jimmy Yang --- .../suite/sys_vars/r/innodb_buffer_pool_evict_basic.result | 7 +++++++ .../suite/sys_vars/t/innodb_buffer_pool_evict_basic.test | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result create mode 100644 mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result new file mode 100644 index 00000000000..459ad95bdc6 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result @@ -0,0 +1,7 @@ +SELECT @@global.innodb_buffer_pool_evict; +@@global.innodb_buffer_pool_evict + +SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; +SELECT @@global.innodb_buffer_pool_evict; +@@global.innodb_buffer_pool_evict + diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test new file mode 100644 index 00000000000..2350d55c57b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test @@ -0,0 +1,10 @@ +-- source include/have_innodb_plugin.inc +# This is a debug variable for now +-- source include/have_debug.inc + +SELECT @@global.innodb_buffer_pool_evict; + +SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; + +# Should always be empty. +SELECT @@global.innodb_buffer_pool_evict; -- cgit v1.2.1 From 7e0901b97fa087e4458f32ffd165103f31a1fef8 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Mon, 28 Jan 2013 14:41:54 +0530 Subject: Bug#16084594 USER_VAR ITEM IN 'LOAD FILE QUERY' WAS NOT PROPERLY QUOTED IN BINLOG FILE Problem: In load data file query, User variables are allowed inside "Into_list" and "Set_list". These user variables used inside these two lists are not properly guarded with backticks while server is writting into binlog. Hence user variable names like a` cannot be used in this context. Fix: Properly quote these variables while writting into binlog mysql-test/r/func_compress.result: changing result file mysql-test/r/variables.result: changing result file mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result: changing result file sql/item_func.cc: Quote the user variable items --- mysql-test/r/func_compress.result | 4 ++-- mysql-test/r/variables.result | 2 +- mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index b4e61d0e4fc..37f7c475148 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -11,7 +11,7 @@ explain extended select uncompress(compress(@test_compress_string)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))` +Note 1003 select uncompress(compress((@`test_compress_string`))) AS `uncompress(compress(@test_compress_string))` select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string); uncompressed_length(compress(@test_compress_string))=length(@test_compress_string) 1 @@ -19,7 +19,7 @@ explain extended select uncompressed_length(compress(@test_compress_string))=len id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` +Note 1003 select (uncompressed_length(compress((@`test_compress_string`))) = length((@`test_compress_string`))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)` select uncompressed_length(compress(@test_compress_string)); uncompressed_length(compress(@test_compress_string)) 117 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 8cff6e99d4f..858c2baf1d4 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -77,7 +77,7 @@ explain extended select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3` +Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@`t1`) AS `@t1`,(@`t2`) AS `@t2`,(@`t3`) AS `@t3` select @t5; @t5 1.23456 diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index d2f47e56c61..7f92744180c 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -631,7 +631,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`=((@`b`) + `bug27417`(2)) ;file_id=# master-bin.000001 # Query # # ROLLBACK /* the output must denote there is the query */; drop trigger trg_del_t2; @@ -869,7 +869,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`=((@`b`) + `bug27417`(2)) ;file_id=# master-bin.000001 # Query # # ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; -- cgit v1.2.1 From e1ee9581cb4a4cac085d0ad6eedadb73de187deb Mon Sep 17 00:00:00 2001 From: Chaithra Gopalareddy Date: Thu, 31 Jan 2013 06:39:15 +0530 Subject: Bug#14096619: UNABLE TO RESTORE DATABASE DUMP Backport of Bug#13581962 mysql-test/r/cast.result: Added test result for Bug#13581962,Bug#14096619 mysql-test/t/cast.test: Added test case for Bug#13581962,Bug#14096619 sql/item_func.h: limit max length by MY_INT64_NUM_DECIMAL_DIGITS --- mysql-test/r/cast.result | 18 ++++++++++++++++++ mysql-test/t/cast.test | 13 +++++++++++++ 2 files changed, 31 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index d7a7503707b..fc0d79e9568 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -477,4 +477,22 @@ WHERE CAST(a as BINARY)=x'62736D697468' AND CAST(a AS BINARY)=x'65736D697468'; a DROP TABLE t1; +# +# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH +# LONGTEXT, UNION, USER VARIABLE +# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP +# +CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)), +CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED)); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999' +Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varbinary(21) NOT NULL DEFAULT '', + `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# End of test for Bug#13581962, Bug#14096619 End of 5.1 tests diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 4474736200c..27eb5e88c54 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -309,4 +309,17 @@ WHERE CAST(a as BINARY)=x'62736D697468' DROP TABLE t1; +--echo # +--echo # Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH +--echo # LONGTEXT, UNION, USER VARIABLE +--echo # Bug#14096619 UNABLE TO RESTORE DATABASE DUMP +--echo # + +CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)), + CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED)); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--echo # End of test for Bug#13581962, Bug#14096619 + --echo End of 5.1 tests -- cgit v1.2.1 From c3d2803c43d4076428763c50632217cb70c751d5 Mon Sep 17 00:00:00 2001 From: Yasufumi Kinoshita Date: Thu, 31 Jan 2013 12:42:43 +0900 Subject: Bug #16220051 : INNODB_BUG12400341 FAILS ON VALGRIND WITH TOO MANY ACTIVE CONCURRENT TRANSACTION innodb_bug12400341.test is disabled for valgrind daily test. It might be affected by the previous test's undo slots existing, because of slower execution. --- mysql-test/suite/innodb/t/innodb_bug12400341.test | 4 ++++ mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test index 2ab1be81f6d..ab69e20c495 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -7,6 +7,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n --skip Test requires InnoDB built with UNIV_DEBUG definition. } +# Don't test under valgrind, undo slots of the previous test might exist still +# and cause unstable result. +--source include/not_valgrind.inc + call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); --disable_query_log diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test index b9e40e0dff3..2ecf30edfa7 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test @@ -7,6 +7,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n --skip Test requires InnoDB built with UNIV_DEBUG definition. } +# Don't test under valgrind, undo slots of the previous test might exist still +# and cause unstable result. +--source include/not_valgrind.inc + call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); --disable_query_log -- cgit v1.2.1 From ddb60a719b219980c5ac1103d687f475f734db26 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Feb 2013 20:25:30 +0530 Subject: Bug #16190704: MTR STILL LOSES THE FAILED RUN LOGS AT RETRY-FAIL --- mysql-test/mysql-test-run.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2f545b05c3c..11280f70161 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -617,9 +617,11 @@ sub run_test_server ($$$) { mtr_report("\nRetrying test $tname, ". "attempt($retries/$opt_retry)...\n"); #saving the log file as filename.failed in case of retry - my $worker_logdir= $result->{savedir}; - my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; - rename $log_file_name,$log_file_name.".failed"; + if ( $result->is_failed() ) { + my $worker_logdir= $result->{savedir}; + my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; + rename $log_file_name,$log_file_name.".failed"; + } delete($result->{result}); $result->{retries}= $retries+1; $result->write_test($sock, 'TESTCASE'); -- cgit v1.2.1 From a2be7d26a8c69e6068f32b2152099edc0194839e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Feb 2013 11:58:21 +0530 Subject: BUG #13625278 - PB2 SHOULD PROVIDE MORE USEFUL INFORMATION FOR TIMEOUTS --- mysql-test/mysql-test-run.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 11280f70161..4b29fba9120 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3622,6 +3622,7 @@ sub run_testcase ($) { my $test= start_mysqltest($tinfo); # Set only when we have to keep waiting after expectedly died server my $keep_waiting_proc = 0; + my $print_timeout= start_timer($print_freq * 60); while (1) { @@ -3646,7 +3647,22 @@ sub run_testcase ($) { } if (! $keep_waiting_proc) { - $proc= My::SafeProcess->wait_any_timeout($test_timeout); + if($test_timeout > $print_timeout) + { + $proc= My::SafeProcess->wait_any_timeout($print_timeout); + if ( $proc->{timeout} ) + { + #print out that the test is still on + mtr_print("Test still running: $tinfo->{name}"); + #reset the timer + $print_timeout= start_timer($print_freq * 60); + next; + } + } + else + { + $proc= My::SafeProcess->wait_any_timeout($test_timeout); + } } # Will be restored if we need to keep waiting -- cgit v1.2.1 From 3d7f52255b0d09191ac975c843a5e8fd6add2217 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Feb 2013 13:02:14 +0530 Subject: BUG #13625278 - PB2 SHOULD PROVIDE MORE USEFUL INFORMATION FOR TIMEOUTS --- mysql-test/mysql-test-run.pl | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 4b29fba9120..44d86bbae68 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3467,6 +3467,7 @@ my %old_env; sub run_testcase ($) { my $tinfo= shift; + my $print_freq=20; mtr_verbose("Running test:", $tinfo->{name}); -- cgit v1.2.1 From 06400b63e70963a9ebaab8222d678609a5cb2009 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Thu, 7 Feb 2013 17:23:37 +0530 Subject: Bug#16247322- MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1 SYS_VARS suite is not enabled in MTR by default run. Enabling it with this check-in. mysql-test/suite/sys_vars/t/disabled.def: Till the bugs are fixed, disabling the failed test scripts --- mysql-test/mysql-test-run.pl | 4 ++-- mysql-test/suite/sys_vars/t/disabled.def | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 44d86bbae68..fbfbd7e2198 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -157,7 +157,7 @@ my $path_config_file; # The generated config file, var/my.cnf # executables will be used by the test suite. our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; -my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb,innodb,innodb_plugin"; +my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb,innodb_plugin"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def index 866172fb51a..c0a343c92ef 100644 --- a/mysql-test/suite/sys_vars/t/disabled.def +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -9,5 +9,15 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -sys_vars.max_binlog_cache_size_basic_64 : bug#11763668 2010-08-31 Horst -sys_vars.max_binlog_cache_size_basic_32 : bug#11763668 2010-08-31 Horst +sys_vars.max_allowed_packet_basic : bug#16295372 2013-02-09 veduggir +sys_vars.max_allowed_packet_func : bug#16295372 2013-02-09 veduggir +sys_vars.net_buffer_length_basic : bug#16295372 2013-02-09 veduggir +sys_vars.insert_id_basic : bug#16295418 2013-02-09 veduggir +sys_vars.key_cache_age_threshold_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.key_cache_block_size_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.key_cache_division_limit_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.identity_basic : bug#16295418 2013-02-09 veduggir +sys_vars.key_buffer_size_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.key_buffer_size_func : bug#16295418 2013-02-09 veduggir +sys_vars.timestamp_basic_64 : bug#16295457 2013-02-09 veduggir +sys_vars.rpl_init_slave_func : bug#16295518 2013-02-09 veduggir -- cgit v1.2.1 From 7557fc6c0fe36d2b73d7bbb6778d90368f1bf3c9 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Fri, 8 Feb 2013 15:41:18 +0530 Subject: BUG#16247322-MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1 Problem: Sys_vars suite is disabled in mysql-5.1 branch. Fix: To enable sys_vars suite in mysql-5.1, add it in mysql-test-run.pl file and also sys_vars suite should be added to Makefile.am inorder to get that test directory --- mysql-test/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 10b1ade81c2..d3e43996c9f 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -103,7 +103,8 @@ TEST_DIRS = t r include std_data std_data/parts collections \ suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \ suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \ suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \ - suite/engines/rr_trx/t + suite/engines/rr_trx/t \ + suite/sys_vars # Used by dist-hook and install-data-local to copy all # test files into either dist or install directory -- cgit v1.2.1 From b0f78ea2780858ef8e4501b40611c20efb9e5f9f Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Fri, 8 Feb 2013 16:34:32 +0530 Subject: BUG#16247322-MTR NOT RUNNING SYS_VARS TEST SUITE FOR 5.1 Reverting back the previous changes as they are causing issues in PB2. --- mysql-test/Makefile.am | 3 +-- mysql-test/mysql-test-run.pl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index d3e43996c9f..9cb9ca8a275 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -103,8 +103,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \ suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \ suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \ suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \ - suite/engines/rr_trx/t \ - suite/sys_vars + suite/engines/rr_trx/t # Used by dist-hook and install-data-local to copy all # test files into either dist or install directory diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fbfbd7e2198..bcc43a97cdf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -157,7 +157,7 @@ my $path_config_file; # The generated config file, var/my.cnf # executables will be used by the test suite. our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; -my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb,innodb_plugin"; +my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb,innodb,innodb_plugin"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose -- cgit v1.2.1 From eb3814b0b346a57a3ed0b79e10f2fe18515b8494 Mon Sep 17 00:00:00 2001 From: Shivji Kumar Jha Date: Fri, 15 Feb 2013 00:38:42 +0530 Subject: BUG#12359942- REPLICATION TEST FROM ENGINE SUITE RPL_ROW_UNTIL TIMES OUT post push fix: rpl_stm_until.test was disabled because of this bug. Enabled and fixed it. Removed a part of the test that was obsolete. It tested replication from 4.0 master to 5.0 slave. --- mysql-test/suite/rpl/r/rpl_stm_until.result | 11 ----------- mysql-test/suite/rpl/t/disabled.def | 1 - mysql-test/suite/rpl/t/rpl_stm_until.test | 30 ----------------------------- 3 files changed, 42 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index a71746d7fba..00d54ae9f9d 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -93,15 +93,4 @@ one 1 drop table t1; start slave; -include/rpl_reset.inc -flush logs; -stop slave; -reset slave; -start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */; -include/wait_for_slave_sql_to_stop.inc -show tables /* t1 must exist */; -Tables_in_test -t1 -drop table t1; -stop slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index d33f85091ff..86ecbb09594 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,5 +12,4 @@ rpl_row_create_table : Bug#11759274 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock -rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out rpl_row_until @macosx : BUG#15965353 RPL.RPL_ROW_UNTIL FAILS ON PB2 , PLATFORM= MACOSX10.6 X86_64 MAX diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index 7f041ae5123..7a534be7335 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -183,36 +183,6 @@ connection slave; start slave; sync_with_master; - # Bug #47142 "slave start until" stops 1 event too late in 4.1 to 5.0 replication -# -# testing fixes that refine the start position of prior-5.0 master's event -# and by that provide correct execution of -# START SLAVE UNTIL ... master_log_pos= x; -# Keep the test at the end of the file because it manipulates with binlog files -# to substitute the genuine one with a prepared on 4.1 server. -# - ---source include/rpl_reset.inc - -connection master; -flush logs; -let $MYSQLD_DATADIR= `select @@datadir`; ---remove_file $MYSQLD_DATADIR/master-bin.000001 ---copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001 - -connection slave; -stop slave; -reset slave; -start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */; ---source include/wait_for_slave_sql_to_stop.inc - -show tables /* t1 must exist */; - -# clean-up of Bug #47142 testing - -drop table t1; # drop on slave only, master does not have t1. -stop slave; - # End of tests --let $rpl_only_running_threads= 1 --source include/rpl_end.inc -- cgit v1.2.1 From 5fcf40a2aa28850ec84ed26f44aa8258c9f7bf9b Mon Sep 17 00:00:00 2001 From: Shivji Kumar Jha Date: Sun, 17 Feb 2013 01:42:28 +0530 Subject: BUG#15965353- RPL.RPL_ROW_UNTIL FAILS ON PB2, PLATFORM= MACOSX10.6 X86_64 MAX Problem: The test was failing on pb2's mac machine because it was not cleaned up properly. The test checks if the command 'start slave until' throws a proper error when issued with a wrong number/type of parameters. After this,the replication stream was stopped using the include file 'rpl_end.inc'. The errors thrown earlier left the slave in an inconsistent state to be closed by the include file which was caught by the mac machine. Fix: Started slave by invoking start_slave.inc to have a working slave before calling rpl_reset.inc Problem: The test file was not in a good shape. It tested start slave until relay log file/pos combination wrongly. A couple of commands were executed at master and replicated at slave. Next, the coordinates in terms of relay log file and pos were noted down followed by reset slave and start slave until saved relay log file/pos. Reset slave deletes all relay log files and makes the slave forget its replication position. So, using the saved coordiantes after reset slave is wrong. Fix: Split the test in two parts: a) Test for start slave until master log file/pos and checking for correct errors in the failure scenarios. b) Test for start slave until relay log file/pos. Problem: The variables auto_increment_increment and auto_increment_offset were set in the the include file rpl_init.inc. This was only configured for some connections that are rarely used by test cases, so likely that it will cause confusion. If replication tests want to setup these variables they should do so explicitly. Fix: a) Removed code to set the variables auto_increment_increment and auto_increment_offset in the include file. b) Updated tests files using the same. --- mysql-test/include/rpl_init.inc | 3 - .../suite/rpl/r/rpl_circular_for_4_hosts.result | 12 ++++ mysql-test/suite/rpl/r/rpl_row_until.result | 22 ++++--- mysql-test/suite/rpl/t/disabled.def | 1 - .../suite/rpl/t/rpl_circular_for_4_hosts.test | 12 ++++ mysql-test/suite/rpl/t/rpl_row_until.test | 75 +++++++++++++++------- 6 files changed, 90 insertions(+), 35 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc index 3cf78dc2979..8325b2937b6 100644 --- a/mysql-test/include/rpl_init.inc +++ b/mysql-test/include/rpl_init.inc @@ -7,7 +7,6 @@ # well as extra connections server_1_1, server_2_1, ..., # server_N_1. server_I and server_I_1 are connections to the same # server. -# - Sets up @@auto_increment_increment and @@auto_increment_increment. # - Verifies that @@server_id of all servers are different. # - Calls RESET MASTER, RESET SLAVE, USE test, CHANGE MASTER, START SLAVE. # - Sets the connection to server_1 before exiting. @@ -179,8 +178,6 @@ while ($_rpl_server) RESET MASTER; RESET SLAVE; } - eval SET auto_increment_increment= $rpl_server_count; - eval SET auto_increment_offset= $_rpl_server; --dec $_rpl_server } diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index 412021d6446..66974762ebc 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -1,6 +1,18 @@ *** Set up circular replication on four servers *** include/rpl_init.inc [topology=1->2->3->4->1] +[connection server_4] +SET auto_increment_increment= 4; +SET auto_increment_offset= 4; +[connection server_3] +SET auto_increment_increment= 4; +SET auto_increment_offset= 3; +[connection server_2] +SET auto_increment_increment= 4; +SET auto_increment_offset= 2; +[connection server_1] +SET auto_increment_increment= 4; +SET auto_increment_offset= 1; *** Preparing data *** CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM; CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result index be8f17c6f01..5ab39a00946 100644 --- a/mysql-test/suite/rpl/r/rpl_row_until.result +++ b/mysql-test/suite/rpl/r/rpl_row_until.result @@ -27,12 +27,6 @@ n 3 4 include/check_slave_param.inc [Exec_Master_Log_Pos] -include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2; -n -1 -2 -include/check_slave_param.inc [Exec_Master_Log_Pos] START SLAVE; include/wait_for_slave_to_start.inc include/stop_slave.inc @@ -54,6 +48,18 @@ START SLAVE; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; Warnings: Note 1254 Slave is already running -include/stop_slave.inc -RESET SLAVE; +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +include/rpl_reset.inc +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +include/stop_slave_sql.inc +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +include/sync_slave_io_with_master.inc +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [table t1 should have two rows.] +include/start_slave.inc +DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 86ecbb09594..d3339c1bfe8 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,4 +12,3 @@ rpl_row_create_table : Bug#11759274 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock -rpl_row_until @macosx : BUG#15965353 RPL.RPL_ROW_UNTIL FAILS ON PB2 , PLATFORM= MACOSX10.6 X86_64 MAX diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 1380b3d97cf..f1d42089869 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -20,6 +20,18 @@ --source include/rpl_init.inc --echo +#set auto inc variables at each server +--let $_rpl_server= $rpl_server_count +while ($_rpl_server) +{ + --let $rpl_connection_name= server_$_rpl_server + --source include/rpl_connection.inc + eval SET auto_increment_increment= $rpl_server_count; + eval SET auto_increment_offset= $_rpl_server; + + --dec $_rpl_server +} + # Preparing data. --echo *** Preparing data *** --connection server_1 diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index eaa99c29694..1e5bc341b1a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -2,7 +2,13 @@ -- source include/have_binlog_format_row.inc -- source include/master-slave.inc -# Note: The test is dependent on binlog positions +############################################################################## +# The test is dependent on binlog positions. The test is divided into two +# sections. The first section checks START SLAVE UNTIL MASTER_LOG_FILE = +# 'log_name', MASTER_LOG_POS = log_pos followed by a couple of failure +# scenarios. The second section checks START SLAVE UNTIL RELAY_LOG_FILE = +# 'log_name', RELAY_LOG_POS = log_pos. +############################################################################## # Create some events on master connection master; @@ -22,14 +28,8 @@ let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8); INSERT INTO t2 VALUES (1),(2); save_master_pos; # Save master log position for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12); -sync_slave_with_master; - -# Save relay log position for query INSERT INTO t2 VALUES (1),(2); -let $relay_log_file= query_get_value(show slave status, Relay_Log_File,1); -let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1); +let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1); -connection master; INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; # Save master log position for query INSERT INTO t2 VALUES (1),(2); @@ -68,17 +68,6 @@ SELECT * FROM t1; --let $slave_param_value= $master_pos_drop_t1 --source include/check_slave_param.inc -# Try replicate all up to and not including the second insert to t2; ---disable_query_log -eval START SLAVE UNTIL RELAY_LOG_FILE='$relay_log_file', RELAY_LOG_POS=$relay_pos_insert1_t2; ---enable_query_log ---source include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2; - ---let $slave_param= Exec_Master_Log_Pos ---let $slave_param_value= $master_pos_insert1_t2 ---source include/check_slave_param.inc - # clean up START SLAVE; --source include/wait_for_slave_to_start.inc @@ -119,9 +108,49 @@ START SLAVE; --replace_result 740 MASTER_LOG_POS START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; ---source include/stop_slave.inc -# Clear slave IO error. -RESET SLAVE; +--source include/start_slave.inc + +############################################################################## +# The second section - checks START SLAVE UNTIL RELAY_LOG_FILE =# 'log_name', +# RELAY_LOG_POS = log_pos. This section of the test does the following: +# 1) At master, create a table and inserts a value. Let slave replicate this. +# 2) Stop slave sql thread. +# 3) Insert some more values at master. Note that io thread copies this insert +# 4) Use start slave until to start the sql thread and check if it +# stops at the correct position. +############################################################################## ---let $rpl_only_running_threads= 1 +--source include/rpl_reset.inc + +--connection master +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); + +--sync_slave_with_master +--source include/stop_slave_sql.inc + +--connection master +INSERT INTO t1 VALUES (2); +--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +INSERT INTO t1 VALUES (3); + +--source include/sync_slave_io_with_master.inc + +--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1) +--source include/get_relay_log_pos.inc + +--disable_query_log +--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos +--enable_query_log +--source include/wait_for_slave_sql_to_stop.inc + +--let $assert_cond= COUNT(*) = 2 FROM t1 +--let $assert_text= table t1 should have two rows. +--source include/assert.inc + +#cleanup +--source include/start_slave.inc +--connection master +DROP TABLE t1; +--sync_slave_with_master --source include/rpl_end.inc -- cgit v1.2.1 From 053d7e775c3b369debbb71e26244fc4c76688f48 Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Mon, 25 Feb 2013 15:26:00 +0100 Subject: Updated/added copyright headers. --- mysql-test/include/default_my.cnf | 2 +- mysql-test/include/default_mysqld.cnf | 2 +- mysql-test/lib/My/Find.pm | 2 +- mysql-test/lib/My/SafeProcess/CMakeLists.txt | 2 +- mysql-test/lib/My/SafeProcess/safe_process.cc | 2 +- mysql-test/lib/mtr_cases.pm | 2 +- mysql-test/lib/mtr_match.pm | 2 +- mysql-test/lib/v1/mysql-test-run.pl | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index f4c9a617cd9..111c2704da2 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -1,4 +1,4 @@ -# Copyright (c) 2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc. +# Copyright (c) 2007 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 8990bcbb5c0..7f7a14f38f6 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -1,4 +1,4 @@ -# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm index 2730f83a496..4fcbb756575 100644 --- a/mysql-test/lib/My/Find.pm +++ b/mysql-test/lib/My/Find.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 5150fcaafff..8a5338a20be 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008 MySQL AB +# Copyright (c) 2007 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index 3abda6e7f67..e95a2c4a91e 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 522e516c6e7..dd5485e6799 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_match.pm b/mysql-test/lib/mtr_match.pm index 6fc9832ac43..b5f512d77e0 100644 --- a/mysql-test/lib/mtr_match.pm +++ b/mysql-test/lib/mtr_match.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2008 MySQL AB +# Copyright (c) 2004, 2006, 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 3065892c968..12792b297ac 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2008, 2009 Sun Microsystems, Inc. +# Copyright (c) 2008-2010 Sun Microsystems, Inc. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify -- cgit v1.2.1 From fe85f546405b16259ab97721610c9b5a64c53e22 Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Tue, 19 Mar 2013 13:29:12 +0100 Subject: Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER --- mysql-test/purify.supp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/purify.supp b/mysql-test/purify.supp index 74ed8c42181..f23f6f2beaf 100644 --- a/mysql-test/purify.supp +++ b/mysql-test/purify.supp @@ -12,8 +12,8 @@ # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm suppress UMR my_end; main -- cgit v1.2.1 From 9be9f11f90a4add0a2580630766202f84b9f0bdc Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 22 Mar 2013 15:29:57 +0530 Subject: Bug#12671635 : Fixing test cases. --- mysql-test/suite/funcs_1/r/is_columns_mysql.result | 8 ++++---- mysql-test/suite/funcs_1/r/is_tables_mysql.result | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 2b285d7cc56..090eeff9f07 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -66,7 +66,7 @@ NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NUL NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI select,insert,update,references NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references -NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references +NULL mysql help_category url 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references @@ -76,7 +76,7 @@ NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_gen NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references -NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references +NULL mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -348,7 +348,7 @@ NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned -3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned 3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned @@ -358,7 +358,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text 1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text -3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text 3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result index 4b33009904f..25a5d158d72 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result @@ -133,7 +133,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# -- cgit v1.2.1 From 7a4c361552f27ff5c27f7f7ec4bbddd1d2192f3b Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 22 Mar 2013 20:00:40 +0530 Subject: Bug#12671635 : Updating embedded tests. --- mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result | 8 ++++---- mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 983f9dd833e..8cc2db6d12f 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -66,7 +66,7 @@ NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NUL NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned -NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) +NULL mysql help_category url 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI @@ -76,7 +76,7 @@ NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_gen NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI -NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) +NULL mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -348,7 +348,7 @@ NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned -3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned 3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned @@ -358,7 +358,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text 1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text -3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text 3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result index 393a588288d..df7a1ea5e37 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result @@ -133,7 +133,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -678,7 +678,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# -- cgit v1.2.1 From 0e763f4db5e024e75fdedb9bc3c3cbd1a45ed9e5 Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Wed, 27 Mar 2013 11:53:01 +0530 Subject: Bug#11829838: ALTER TABLE NOT BINLOGGED WITH --BINLOG-IGNORE-DB AND FULLY QUALIFIED TABLE Problem: ======= An ALTER TABLE statement is not written to binlog if server started with "--binlog-ignore-db some database" and 'fully qualified' table names are used in the ALTER TABLE statement altering table different from current database context. Analysis: ======== The above mentioned problem not only affects "ALTER TABLE" statements but also to all kind of statements. Once the current default database becomes "NULL" none of the statements will be binlogged. The current behaviour is such that if the user has specified restrictions on which database needs to be replicated and the default db is not specified, then do not replicate. This means that "NULL" is considered to be equivalent to everything (default db = null implied ignore don't log the statement). Fix: === "NULL" should not be considered as equivalent to everything. Since the filtering criteria is not equal to "NULL" the statement should be logged into binlog. mysql-test/suite/rpl/r/rpl_loaddata_m.result: Earlier when defalut database was "NULL" DROP TABLE was not getting logged. Post this fix it will be logged and the DROP will fail at slave as the table creation was skipped by master as --binlog-ignore-db=test. mysql-test/suite/rpl/t/rpl_loaddata_m.test: Earlier when defalut database was "NULL" DROP TABLE was not getting logged. Post this fix it will be logged and the DROP will fail at slave as the table creation was skipped by master as --binlog-ignore-db=test. sql/rpl_filter.cc: Replaced DBUG_RETURN(0) with DBUG_RETURN(1). --- mysql-test/suite/rpl/r/rpl_loaddata_m.result | 2 +- mysql-test/suite/rpl/t/rpl_loaddata_m.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result index ad9fb6e0896..58339811a1a 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result @@ -32,5 +32,5 @@ SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test index bbe11bbb887..034fefa95f5 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test @@ -46,7 +46,7 @@ SELECT COUNT(*) FROM mysqltest.t1; # Cleanup connection master; DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; sync_slave_with_master; # End of test -- cgit v1.2.1 From 40fbf8bc28c5db76ee5820707258470aff03dbf8 Mon Sep 17 00:00:00 2001 From: sayantan dutta Date: Thu, 16 May 2013 14:32:09 +0530 Subject: Bug #16813007 - MTR IS NOT TAKING MYSQLTEST CLIENT USING THE ENV VARIABLE MYSQL_TEST --- mysql-test/mysql-test-run.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index bcc43a97cdf..c8675b03e25 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1785,7 +1785,17 @@ sub executable_setup () { } else { - $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest"); + if ( defined $ENV{'MYSQL_TEST'} ) + { + $exe_mysqltest=$ENV{'MYSQL_TEST'}; + print "===========================================================\n"; + print "WARNING:The mysqltest binary is fetched from $exe_mysqltest\n"; + print "===========================================================\n"; + } + else + { + $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest"); + } } } -- cgit v1.2.1 From e8a0b9f943981f96b2b8d08bd543a0902b0d7ec3 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Fri, 24 May 2013 14:25:00 +0530 Subject: Bug#16765278 DELETE SQL_LOAD_MB* FILE (TEMP FILE) CREATED BY BINLOG_KILLED_SIMULATE.TEST 'mysqbinlog' tool creates a temporary file while preparing LOAD DATA QUERY. These files needs to be deleted at the end of the test script otherwise these files are left out in the daily-run machines, causing "no space on device issues" Fix: Delete them at the end of these test scripts 1) execute mysqlbinlog with --local-load option to create these files in a specified tmpdir 2) delete the tmpdir at the end of the test script --- mysql-test/suite/binlog/t/binlog_killed_simulate.test | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test index b87d47559fe..fcedd884183 100644 --- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -20,11 +20,9 @@ reset master; update t1 set a=2 /* will be "killed" after work has been done */; # a proof the query is binlogged with no error -#todo: introduce a suite private macro that provides numeric values -# for some constants like the offset of the first real event -# that is different between severs versions. +--let $binlog_load_data= query_get_value(SHOW BINLOG EVENTS, Pos, 2) let $MYSQLD_DATADIR= `select @@datadir`; ---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_load_data $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) @@ -48,11 +46,12 @@ reset master; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; +--let $binlog_load_data= query_get_value(SHOW BINLOG EVENTS, Pos, 2) # a proof the query is binlogged with an error - source include/show_binlog_events.inc; ---exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--mkdir $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 +--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 --force-if-open --start-position=$binlog_load_data $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) @@ -64,6 +63,8 @@ eval select $error_code /* must return 0 to mean the killed query is in */; # cleanup for the sub-case remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; +--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 * +--rmdir $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 drop table t1,t2; -- cgit v1.2.1 From dfb6f63bcf379dcefda43808a2d9f0d80254e3ad Mon Sep 17 00:00:00 2001 From: Aditya A Date: Fri, 14 Jun 2013 11:22:05 +0530 Subject: Bug#13548704 ALGORITHM USED FOR DROPPING PARTITIONED TABLE CAN LEAD TO INCONSISTENCY PROBLEM -------- When we drop a partitoned table , we first gather the information about partitions in the table from the table_name.par file and store it in an internal data structure.Then we delete this file and the data in the table. If the server crashes after deleting the file,then after recovering we cannot access the table .Even we cannot drop the table ,because drop algorithm requires par file to read the partition information. FIX --- 1. We move the part of deleting par file after deleting all the table data from the storage egine. 2. During drop operation if we detect that the par file is missing then we delete the .frm file,since there is no way of recovering without par file. [Approved by Mattias rb#2576 ] --- mysql-test/r/partition_error.result | 4 ++-- mysql-test/t/partition_error.test | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 269b6875430..e5ac1371a9b 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -662,8 +662,8 @@ test.t1 check Error Incorrect information in file: './test/t1.frm' test.t1 check error Corrupt SELECT * FROM t1; ERROR HY000: Failed to read from the .par file -# Note that it is currently impossible to drop a partitioned table -# without the .par file +# Note that we will remove the frm file when we detect that +# .par file has been deleted. DROP TABLE t1; ERROR 42S02: Unknown table 't1' # diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 7e574fd6a42..746e52bd623 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -698,11 +698,10 @@ FLUSH TABLES; CHECK TABLE t1; --error ER_UNKNOWN_ERROR SELECT * FROM t1; ---echo # Note that it is currently impossible to drop a partitioned table ---echo # without the .par file +--echo # Note that we will remove the frm file when we detect that +--echo # .par file has been deleted. --error ER_BAD_TABLE_ERROR DROP TABLE t1; ---remove_file $MYSQLD_DATADIR/test/t1.frm --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD -- cgit v1.2.1 From 977d58f6143a7227804367a41cd88da2da8cce7f Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 1 Jul 2013 15:30:55 +0200 Subject: Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail and Cleanup test case (left outfile in data dir) --- mysql-test/r/func_str.result | 4 ++-- mysql-test/t/func_str.test | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 8f4038e1239..0b08474693f 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2617,13 +2617,13 @@ Warning 1292 Truncated incorrect DECIMAL value: '' # and other crashes # CREATE TABLE t1 ( a TEXT ); -SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt'; +SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt';; SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ) x Warnings: Warning 1292 Truncated incorrect INTEGER value: 'b' -LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;; SELECT * FROM t1; a aaaaaaaaaaaaaa diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 92c4bae5327..09d27d07f49 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1374,9 +1374,11 @@ SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); --echo # and other crashes --echo # CREATE TABLE t1 ( a TEXT ); -SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt'; SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); -LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1; SELECT * FROM t1; DROP TABLE t1; -- cgit v1.2.1 From c088c9c4c5f84b7f9f0b1d8bc49d1fce89317c88 Mon Sep 17 00:00:00 2001 From: sayantan dutta Date: Wed, 17 Jul 2013 14:24:02 +0530 Subject: Bug #17035577 - MTR V1 FAILS TO START SERVER MTR_VERSION=1 PERL MYSQL-TEST-RUN.PL 1ST --- mysql-test/lib/v1/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 12792b297ac..857a28d648f 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -4088,7 +4088,7 @@ sub mysqld_arguments ($$$$) { } mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); - mtr_add_arg($args, "%s--sort_buffer=256K", $prefix); + mtr_add_arg($args, "%s--sort_buffer_size=256K", $prefix); mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); if ( $opt_ssl_supported ) -- cgit v1.2.1 From c38ddd971e95cfec0a723fabf91be753dacc894b Mon Sep 17 00:00:00 2001 From: Astha Pareek Date: Tue, 23 Jul 2013 18:13:43 +0530 Subject: BUG#16295518 - SYS_VARS.RPL_INIT_SLAVE_FUNC IS FAILING ON MYSQL-5.1 BUG#12535301- SYS_VARS.RPL_INIT_SLAVE_FUNC MISMATCHES IN DAILY-5.5 Problem: sys_vars.rpl_init_slave_func test was not recorded after the last edit. It was disabled on 5.1 after seeing failures due to the above reason. No old failures as this suite never ran with pb2 on 5.1 Fix: Added assert condition after wait for checks. Recorded test and enabled it. --- .../suite/sys_vars/r/rpl_init_slave_func.result | 21 +++++++-------------- mysql-test/suite/sys_vars/t/disabled.def | 1 - .../suite/sys_vars/t/rpl_init_slave_func.test | 10 ++++++---- 3 files changed, 13 insertions(+), 19 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result index bdb586e84c2..ede412c28b7 100644 --- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result +++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result @@ -1,9 +1,5 @@ -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; +include/master-slave.inc +[connection master] connection slave SET @start_max_connections= @@global.max_connections; SET @start_init_slave= @@global.init_slave; @@ -18,23 +14,19 @@ SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connec @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1' 1 Expect 1 -SELECT @@global.max_connections= @start_max_connections; -@@global.max_connections= @start_max_connections -1 -Expect 1 +include/assert.inc [@@global.max_connections = @start_max_connections] STOP SLAVE; RESET MASTER; RESET SLAVE; START SLAVE; -SELECT @@global.max_connections = @start_max_connections + 1; -@@global.max_connections = @start_max_connections + 1 -1 -Expect 1 +include/wait_for_slave_to_start.inc +include/assert.inc [@@global.max_connections = @start_max_connections + 1] SET @@global.init_slave = "SET @a=5"; STOP SLAVE; RESET MASTER; RESET SLAVE; START SLAVE; +include/wait_for_slave_to_start.inc SHOW VARIABLES LIKE 'init_slave'; Variable_name Value init_slave SET @a=5 @@ -44,3 +36,4 @@ NULL Expect NULL SET @@global.max_connections= @start_max_connections; SET @@global.init_slave= @start_init_slave; +include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def index c0a343c92ef..98625a2ec54 100644 --- a/mysql-test/suite/sys_vars/t/disabled.def +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -20,4 +20,3 @@ sys_vars.identity_basic : bug#16295418 2013-02-09 veduggir sys_vars.key_buffer_size_basic_64 : bug#16295418 2013-02-09 veduggir sys_vars.key_buffer_size_func : bug#16295418 2013-02-09 veduggir sys_vars.timestamp_basic_64 : bug#16295457 2013-02-09 veduggir -sys_vars.rpl_init_slave_func : bug#16295518 2013-02-09 veduggir diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test index d4607dc6bf1..edc77816c9c 100644 --- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test +++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test @@ -59,8 +59,9 @@ let $wait_timeout= 240; let $wait_condition= SELECT @@global.max_connections = @start_max_connections; --source include/wait_condition_sp.inc # check that the action in init_slave does not happen immediately -SELECT @@global.max_connections= @start_max_connections; ---echo Expect 1 +--let $assert_text= @@global.max_connections = @start_max_connections +--let $assert_cond= @@global.max_connections = @start_max_connections +--source include/assert.inc # # reset of the server STOP SLAVE; @@ -75,8 +76,9 @@ let $wait_timeout= 90; let $wait_condition= SELECT @@global.max_connections = @start_max_connections + 1; --source include/wait_condition_sp.inc # check that the action in init_slave was executed and had the intended effect -SELECT @@global.max_connections = @start_max_connections + 1; ---echo Expect 1 +--let $assert_text= @@global.max_connections = @start_max_connections + 1 +--let $assert_cond= @@global.max_connections = @start_max_connections + 1 +--source include/assert.inc # # Setting a variable(which is local to a session) and must not be visible SET @@global.init_slave = "SET @a=5"; -- cgit v1.2.1 From 3b1e98d21844b0f32f6e5fe9df447046eb471453 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Wed, 21 Aug 2013 10:39:40 +0530 Subject: Bug#11765252 - READ OF FREED MEMORY WHEN "USE DB" AND "SHOW PROCESSLIST" Analysis: ---------- The problem here is, if one connection changes its default db and at the same time another connection executes "SHOW PROCESSLIST", when it wants to read db of the another connection then there is a chance of accessing the invalid memory. The db name stored in THD is not guarded while changing user DB and while reading the user DB in "SHOW PROCESSLIST". So, if THD.db is freed by thd "owner" thread and if another thread executing "SHOW PROCESSLIST" statement tries to read and copy THD.db at the same time then we may endup in the issue reported here. Fix: ---------- Used mutex "LOCK_thd_data" to guard THD.db while freeing it and while copying it to processlist. --- mysql-test/include/have_valgrind.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 mysql-test/include/have_valgrind.inc (limited to 'mysql-test') diff --git a/mysql-test/include/have_valgrind.inc b/mysql-test/include/have_valgrind.inc new file mode 100644 index 00000000000..8374c2ed4f0 --- /dev/null +++ b/mysql-test/include/have_valgrind.inc @@ -0,0 +1,11 @@ +# include/have_valgrind.inc +# +# If some test should be run with only valgrind then skip it while running test +# without it. +# + +if (!$VALGRIND_TEST) { + --skip Need "--valgrind" +} + + -- cgit v1.2.1 From aff9f26290277baa97ce3ce74829d8c1cf870e45 Mon Sep 17 00:00:00 2001 From: Libing Song Date: Tue, 10 Sep 2013 16:12:25 +0800 Subject: Bug#17402313 DUMP THREAD SENDS SOME EVENTS MORE THAN ONCE Postfix, suppress the new warning generated by the bug's fix. --- mysql-test/suite/rpl/r/rpl_log_pos.result | 1 + mysql-test/suite/rpl/t/rpl_log_pos.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index b2224dcd725..b3f68157211 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 484ffa52a44..87be576c285 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -12,6 +12,7 @@ source include/master-slave.inc; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); source include/show_master_status.inc; sync_slave_with_master; source include/stop_slave.inc; -- cgit v1.2.1 From 59402fe0a76bae115c622cc241995180c4bdf4c9 Mon Sep 17 00:00:00 2001 From: Satya Bodapati Date: Wed, 11 Sep 2013 16:57:02 +0530 Subject: Bug#16752251 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE OPERATION IF IT IS DONE IN-PLACE With change buffer enabled, InnoDB doesn't write a transaction log record when it merges a record from the insert buffer to an secondary index page if the insertion is performed as an update-in-place. Fixed by logging the 'update-in-place' operation on secondary index pages. Approved by Marko. rb#2429 --- .../include/have_innodb_change_buffering.inc | 6 ++ mysql-test/include/search_pattern_in_file.inc | 66 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 mysql-test/include/have_innodb_change_buffering.inc create mode 100644 mysql-test/include/search_pattern_in_file.inc (limited to 'mysql-test') diff --git a/mysql-test/include/have_innodb_change_buffering.inc b/mysql-test/include/have_innodb_change_buffering.inc new file mode 100644 index 00000000000..aadad84c6a1 --- /dev/null +++ b/mysql-test/include/have_innodb_change_buffering.inc @@ -0,0 +1,6 @@ +if (!`SHOW VARIABLES LIKE 'innodb_change_buffering_debug'`) +{ + # innodb_change_buffering_debug is enabled by UNIV_DEBUG or + # UNIV_IBUF_DEBUG + --skip Test requires binary with UNIV_DEBUG enabled +} diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc new file mode 100644 index 00000000000..c047b5bc499 --- /dev/null +++ b/mysql-test/include/search_pattern_in_file.inc @@ -0,0 +1,66 @@ +# Purpose: +# Simple search with Perl for a pattern in some file. +# +# The advantages compared to thinkable auxiliary constructs using the +# mysqltest language and SQL are: +# 1. We do not need a running MySQL server. +# 2. SQL causes "noise" during debugging and increases the size of logs. +# Perl code does not disturb at all. +# +# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set +# before sourcing this routine. +# +# In case of +# - SEARCH_FILE and/or SEARCH_PATTERN is not set +# - SEARCH_FILE cannot be opened +# - SEARCH_FILE does not contain SEARCH_PATTERN +# the test will abort immediate. +# MTR will report something like +# .... +# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 +# main.1st [ pass ] 3 +# innodb.innodb_page_size [ fail ] +# Test ended at 2011-11-11 18:15:58 +# +# CURRENT_TEST: innodb.innodb_page_size +# # ERROR: The file '' does not contain the expected pattern +# mysqltest: In included file "./include/search_pattern_in_file.inc": +# included from ./include/search_pattern_in_file.inc at line 36: +# At line 25: command "perl" failed with error 255. my_errno=175 +# +# The result from queries just before the failure was: +# ... +# - saving '' to '' +# main.1st [ pass ] 2 +# +# Typical use case (check invalid server startup options): +# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; +# --error 0,1 +# --remove_file $error_log +# let SEARCH_FILE= $error_log; +# # Stop the server +# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +# --exec echo "wait" > $restart_file +# --shutdown_server 10 +# --source include/wait_until_disconnected.inc +# +# --error 1 +# --exec $MYSQLD_CMD > $error_log 2>&1 +# # The server restart aborts +# let SEARCH_PATTERN= \[ERROR\] Aborting; +# --source include/search_pattern_in_file.inc +# +# Created: 2011-11-11 mleich +# + +perl; + use strict; + my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set"; + my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set"; + open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n"); + read(FILE, my $file_content, 50000, 0); + close(FILE); + if ( not $file_content =~ m{$search_pattern} ) { + die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n"); + } +EOF -- cgit v1.2.1 From 3399194cefc7fcffcba4c304bbb3badec1afc21e Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Mon, 14 Oct 2013 15:45:12 +0100 Subject: WL#7266: Dump-thread additional concurrency tests This worklog aims at testing the two following scenarios: 1) Whenever the mysql_binlog_send method (dump thread) reaches the end of file when reading events from the binlog, before checking if it should wait for more events, there was a test to check if the file being read was still active, i.e, it was the last known binlog. However, it was possible that something was written to the binary log and then a rotation would happen, after EOF was detected and before the check for active was performed. In this case, the end of the binary log would not be read by the dump thread, and this would cause the slave to lose updates. This test verifies that the problem has been fixed. It waits during this window while forcing a rotation in the binlog. 2) Verify dump thread can send events in active file, correctly after encountering an IO error. --- .../suite/rpl/r/rpl_dump_events_twice_bug.result | 15 +++++++ .../suite/rpl/r/rpl_lost_events_on_rotate.result | 14 ++++++ .../suite/rpl/t/rpl_dump_events_twice_bug.test | 28 ++++++++++++ .../suite/rpl/t/rpl_lost_events_on_rotate.test | 51 ++++++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result create mode 100644 mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result create mode 100644 mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test create mode 100644 mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result b/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result new file mode 100644 index 00000000000..8e6c8c122b5 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result @@ -0,0 +1,15 @@ +include/master-slave.inc +[connection master] +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); +SET @debug_saved= @@GLOBAL.DEBUG; +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES(1); +[connection master] +SET GLOBAL debug='+d,dump_fake_io_error'; +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); +include/diff_tables.inc [master:t1, slave:t1] +[connection master] +SET @@GLOBAL.DEBUG= @debug_saved; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result new file mode 100644 index 00000000000..eee2effccea --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +SET @debug_saved= @@GLOBAL.DEBUG; +CREATE TABLE t (i INT); +SET GLOBAL DEBUG= "d,wait_after_binlog_EOF"; +INSERT INTO t VALUES (1); +INSERT INTO t VALUES (2); +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; +include/diff_tables.inc [master:t,slave:t] +SET @@GLOBAL.DEBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test b/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test new file mode 100644 index 00000000000..de82769010e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test @@ -0,0 +1,28 @@ +# +# Verify dump thread can send events in active file, correctly after +# encountering an IO error. +# +--source include/have_debug.inc +--source include/master-slave.inc + +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); +SET @debug_saved= @@GLOBAL.DEBUG; + +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES(1); + +--sync_slave_with_master + +--source include/rpl_connection_master.inc +SET GLOBAL debug='+d,dump_fake_io_error'; +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); + +--sync_slave_with_master +--let $diff_tables= master:t1, slave:t1 +--source include/diff_tables.inc + +--source include/rpl_connection_master.inc +SET @@GLOBAL.DEBUG= @debug_saved; +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test new file mode 100644 index 00000000000..08884ee8e26 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test @@ -0,0 +1,51 @@ +# +# Whenever the mysql_binlog_send method (dump thread) reaches the +# end of file when reading events from the binlog, before checking +# if it should wait for more events, there was a test to check if +# the file being read was still active, i.e, it was the last known +# binlog. However, it was possible that something was written to +# the binary log and then a rotation would happen, after EOF was +# detected and before the check for active was performed. In this +# case, the end of the binary log would not be read by the dump +# thread, and this would cause the slave to lose updates. +# +# This test verifies that the problem has been fixed. It waits +# during this window while forcing a rotation in the binlog. +# +--source include/have_debug.inc +--source include/master-slave.inc + +--connection master + +SET @debug_saved= @@GLOBAL.DEBUG; + +CREATE TABLE t (i INT); + +# When reaching the EOF the dump thread will wait before deciding if +# it should move to a new binlong file. +SET GLOBAL DEBUG= "d,wait_after_binlog_EOF"; + +INSERT INTO t VALUES (1); + +--sleep 1 + +# A insert and a rotate happens before the decision +INSERT INTO t VALUES (2); +FLUSH LOGS; + +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; + +--sync_slave_with_master + +# All the rows should be sent to the slave. +--let $diff_tables=master:t,slave:t +--source include/diff_tables.inc + +##Clean up +--connection master + +SET @@GLOBAL.DEBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; + +DROP TABLE t; +--source include/rpl_end.inc -- cgit v1.2.1