From 010733cb1323c7a88f8d15d0834dd98258274bca Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Oct 2010 16:58:52 +0200 Subject: [PATCH 1/5] Make the skip-on-windows check as the first one, as the master-slave include fails on windows. --- mysql-test/suite/rpl/t/rpl_loaddata_symlink.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test index 63e65834e5b..69b481bddd1 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test @@ -3,8 +3,8 @@ # This test verifies if loading data infile will work fine # if the path of the load data file is a symbolic link. # ---source include/master-slave.inc --source include/not_windows.inc +--source include/master-slave.inc --source include/have_binlog_format_statement.inc create table t1(a int not null auto_increment, b int, primary key(a) ); From 2e02037288fcf179f498780de24773c59191d801 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 20 Oct 2010 21:42:17 +0200 Subject: [PATCH 2/5] Show the number of warm keycache blocks in SHOW STATUS --- sql/mysqld.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 64cefa0f928..97b405b6354 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7929,6 +7929,7 @@ SHOW_VAR status_vars[]= { {"Key_blocks_not_flushed", (char*) offsetof(KEY_CACHE, global_blocks_changed), SHOW_KEY_CACHE_LONG}, {"Key_blocks_unused", (char*) offsetof(KEY_CACHE, blocks_unused), SHOW_KEY_CACHE_LONG}, {"Key_blocks_used", (char*) offsetof(KEY_CACHE, blocks_used), SHOW_KEY_CACHE_LONG}, + {"Key_blocks_warm", (char*) offsetof(KEY_CACHE, warm_blocks), SHOW_KEY_CACHE_LONG}, {"Key_read_requests", (char*) offsetof(KEY_CACHE, global_cache_r_requests), SHOW_KEY_CACHE_LONGLONG}, {"Key_reads", (char*) offsetof(KEY_CACHE, global_cache_read), SHOW_KEY_CACHE_LONGLONG}, {"Key_write_requests", (char*) offsetof(KEY_CACHE, global_cache_w_requests), SHOW_KEY_CACHE_LONGLONG}, From 1d8ad7e54ce672b2bfa28cc1e0cdef3aee3e8eb1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 22 Oct 2010 10:32:54 +0200 Subject: [PATCH 3/5] workaround for MySQL BUG#57491 --- client/mysqltest.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 6dd6252c64a..60b7501b0cd 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -722,6 +722,10 @@ void handle_no_error(struct st_command*); #ifdef EMBEDDED_LIBRARY +/* workaround for MySQL BUG#57491 */ +#undef MY_WME +#define MY_WME 0 + /* attributes of the query thread */ pthread_attr_t cn_thd_attrib; From 4cb9a326cfc286a3e57f5f3901b14ad9064d8557 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2010 10:41:45 +0200 Subject: [PATCH 4/5] Fix test failure (timeout) in --valgrind tests in Buildbot. The main.ps_ddl test does SELECT * FROM mysql.general_log; that can be really expensive with --valgrind if previous test cases put lots of data in the general log since last server restart. Fix by truncating the log at test start. --- mysql-test/r/ps_ddl.result | 1 + mysql-test/t/ps_ddl.test | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result index 375f31ef9c4..a5e71e114ca 100644 --- a/mysql-test/r/ps_ddl.result +++ b/mysql-test/r/ps_ddl.result @@ -4,6 +4,7 @@ drop procedure if exists p_verify_reprepare_count; drop procedure if exists p1; drop function if exists f1; drop view if exists v1, v2; +TRUNCATE TABLE mysql.general_log; create procedure p_verify_reprepare_count(expected int) begin declare old_reprepare_count int default @reprepare_count; diff --git a/mysql-test/t/ps_ddl.test b/mysql-test/t/ps_ddl.test index 1543c757908..10a96285451 100644 --- a/mysql-test/t/ps_ddl.test +++ b/mysql-test/t/ps_ddl.test @@ -58,6 +58,10 @@ drop function if exists f1; drop view if exists v1, v2; --enable_warnings +# Avoid selecting from a huge table possibly left over from previous tests, +# as this really hurts --valgrind testing. +TRUNCATE TABLE mysql.general_log; + delimiter |; create procedure p_verify_reprepare_count(expected int) begin From c6b19ea001965b350df1248c33f709127d2c7e47 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2010 09:56:45 +0200 Subject: [PATCH 5/5] mysqltest: Fix reversed error check, causing truncated output when testcase fails. Also fix missing zero termination in DBUG_PRINT, causing garbage output in --debug output. --- client/mysqltest.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 60b7501b0cd..fbd76445e37 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -609,14 +609,14 @@ public: lines++; int show_offset= 0; - char buf[256]; + char buf[256+1]; /* + zero termination for DBUG_PRINT */ size_t bytes; bool found_bof= false; /* Search backward in file until "lines" newline has been found */ while (lines && !found_bof) { - show_offset-= sizeof(buf); + show_offset-= sizeof(buf)-1; while(fseek(m_file, show_offset, SEEK_END) != 0 && show_offset < 0) { found_bof= true; @@ -624,7 +624,7 @@ public: show_offset++; } - if ((bytes= fread(buf, 1, sizeof(buf), m_file)) <= 0) + if ((bytes= fread(buf, 1, sizeof(buf)-1, m_file)) <= 0) { // ferror=0 will happen here if no queries executed yet if (ferror(m_file)) @@ -634,6 +634,7 @@ public: DBUG_VOID_RETURN; } + IF_DBUG(buf[bytes]= '\0';) DBUG_PRINT("info", ("Read %lu bytes from file, buf: %s", (unsigned long)bytes, buf)); @@ -678,8 +679,8 @@ public: } } - while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0) - if (fwrite(buf, 1, bytes, stderr)) + while ((bytes= fread(buf, 1, sizeof(buf)-1, m_file)) > 0) + if (bytes != fwrite(buf, 1, bytes, stderr)) die("Failed to write to '%s', errno: %d", m_file_name, errno);