diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-10-29 23:18:02 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-10-29 23:18:02 +0200 |
commit | 310584a849ea5912c23f3260ce0f2eff3128c566 (patch) | |
tree | 87a901f3ee2215cfd43a7f3dbce7f46017b43219 | |
parent | 716f7843757f96649cca1f5dc3df5d9659b17da9 (diff) | |
parent | c6b19ea001965b350df1248c33f709127d2c7e47 (diff) | |
download | mariadb-git-310584a849ea5912c23f3260ce0f2eff3128c566.tar.gz |
merge w/ 5.1
-rw-r--r-- | client/mysqltest.cc | 15 | ||||
-rw-r--r-- | include/keycache.h | 1 | ||||
-rw-r--r-- | mysql-test/r/key_cache.result | 3 | ||||
-rw-r--r-- | mysql-test/r/ps_ddl.result | 1 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_loaddata_symlink.test | 2 | ||||
-rw-r--r-- | mysql-test/t/ps_ddl.test | 4 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 2 | ||||
-rw-r--r-- | sql/mysqld.cc | 1 |
8 files changed, 23 insertions, 6 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 5162d58d02d..635d013eae8 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -610,14 +610,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; @@ -625,7 +625,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)) @@ -635,6 +635,7 @@ public: DBUG_VOID_RETURN; } + IF_DBUG(buf[bytes]= '\0';) DBUG_PRINT("info", ("Read %lu bytes from file, buf: %s", (unsigned long)bytes, buf)); @@ -679,8 +680,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); @@ -723,6 +724,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; diff --git a/include/keycache.h b/include/keycache.h index 21189fe6c6d..acb85522c0e 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -46,6 +46,7 @@ typedef struct st_key_cache_statistics ulonglong blocks_used; /* maximum number of used blocks/buffers */ ulonglong blocks_unused; /* number of currently unused blocks */ ulonglong blocks_changed; /* number of currently dirty blocks */ + ulonglong blocks_warm; /* number of blocks in warm sub-chain */ ulonglong read_requests; /* number of read requests (read hits) */ ulonglong reads; /* number of actual reads from files into buffers */ ulonglong write_requests; /* number of write requests (write hits) */ diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 8ebc8ff1fa0..314b7656322 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -412,6 +412,7 @@ Variable_name Value Key_blocks_not_flushed 0 Key_blocks_unused KEY_BLOCKS_UNUSED Key_blocks_used 4 +Key_blocks_warm 0 Key_read_requests 22 Key_reads 0 Key_write_requests 26 @@ -459,6 +460,7 @@ Variable_name Value Key_blocks_not_flushed 0 Key_blocks_unused KEY_BLOCKS_UNUSED Key_blocks_used 4 +Key_blocks_warm 0 Key_read_requests 22 Key_reads 0 Key_write_requests 26 @@ -501,6 +503,7 @@ Variable_name Value Key_blocks_not_flushed 0 Key_blocks_unused KEY_BLOCKS_UNUSED Key_blocks_used 4 +Key_blocks_warm 0 Key_read_requests 22 Key_reads 0 Key_write_requests 26 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/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) ); 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 diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 9c96d387aa0..00e5f0874a2 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -4906,6 +4906,7 @@ void get_simple_key_cache_statistics(SIMPLE_KEY_CACHE_CB *keycache, keycache_stats->blocks_used= keycache->blocks_used; keycache_stats->blocks_unused= keycache->blocks_unused; keycache_stats->blocks_changed= keycache->global_blocks_changed; + keycache_stats->blocks_warm= keycache->warm_blocks; keycache_stats->read_requests= keycache->global_cache_r_requests; keycache_stats->reads= keycache->global_cache_read; keycache_stats->write_requests= keycache->global_cache_w_requests; @@ -5797,6 +5798,7 @@ get_partitioned_key_cache_statistics(PARTITIONED_KEY_CACHE_CB *keycache, keycache_stats->blocks_used+= partition->blocks_used; keycache_stats->blocks_unused+= partition->blocks_unused; keycache_stats->blocks_changed+= partition->global_blocks_changed; + keycache_stats->blocks_warm+= partition->warm_blocks; keycache_stats->read_requests+= partition->global_cache_r_requests; keycache_stats->reads+= partition->global_cache_read; keycache_stats->write_requests+= partition->global_cache_w_requests; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b824b8ad680..ce70c65636d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7973,6 +7973,7 @@ static int show_default_keycache(THD *thd, SHOW_VAR *var, char *buff) set_one_keycache_var("blocks_not_flushed", blocks_changed); set_one_keycache_var("blocks_unused", blocks_unused); set_one_keycache_var("blocks_used", blocks_used); + set_one_keycache_var("blocks_warm", blocks_warm); set_one_keycache_var("read_requests", read_requests); set_one_keycache_var("reads", reads); set_one_keycache_var("write_requests", write_requests); |