List:Commits« Previous MessageNext Message »
From:Marc Alff Date:November 5 2011 12:40pm
Subject:bzr push into mysql-trunk-marc branch (marc.alff:3560 to 3562)
View as plain text  
 3562 Marc Alff	2011-11-05
      benchmark tests

    modified:
      storage/perfschema/unittest/pfs_benchmark-t.cc
 3561 Marc Alff	2011-11-05 [merge]
      Merge mysql-trunk --> mysql-trunk-marc

    modified:
      mysql-test/include/join_cache.inc
      mysql-test/r/join_cache_bka.result
      mysql-test/r/join_cache_bka_nixbnl.result
      mysql-test/r/join_cache_bkaunique.result
      mysql-test/r/join_cache_bnl.result
      mysql-test/r/join_cache_nojb.result
      mysql-test/valgrind.supp
      sql/field.h
      sql/field_conv.cc
      sql/sql_select.cc
 3560 Marc Alff	2011-11-04 [merge]
      Merge mysql-trunk --> mysql-trunk-marc

    removed:
      BUILD/compile-alpha-debug
      BUILD/compile-darwin-mwcc
      BUILD/compile-irix-mips64-mipspro
      BUILD/compile-pentium-icc
      BUILD/compile-pentium-icc-valgrind-max
      BUILD/compile-pentium-icc-yassl
      BUILD/compile-pentium-pgcc
      mysys/my_new.cc
    added:
      mysys/my_isnan.c
      unittest/gunit/stdcxx-t.cc
    renamed:
      mysys/psi_noop.cc => mysys/psi_noop.c
      sql/udf_example.c => sql/udf_example.cc
    modified:
      BUILD/SETUP.sh
      BUILD/build_mccge.sh
      BUILD/compile-dist
      BUILD/compile-solaris-amd64
      BUILD/compile-solaris-amd64-forte
      BUILD/compile-solaris-amd64-forte-debug
      BUILD/compile-solaris-sparc
      BUILD/compile-solaris-sparc-debug
      BUILD/compile-solaris-sparc-forte
      BUILD/compile-solaris-sparc-purify
      client/CMakeLists.txt
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqlbinlog.cc
      client/mysqldump.c
      client/mysqltest.cc
      client/sql_string.cc
      cmake/build_configurations/mysql_release.cmake
      cmake/configure.pl
      cmake/info_macros.cmake.in
      cmake/os/Windows.cmake
      cmake/readline.cmake
      config.h.cmake
      configure.cmake
      dbug/dbug.c
      include/m_string.h
      include/my_global.h
      include/my_pthread.h
      include/mysql.h
      include/mysql/psi/mysql_thread.h
      include/mysql/psi/psi.h
      include/mysql/psi/psi_abi_v1.h
      include/mysql_com.h
      include/waiting_threads.h
      libmysql/libmysql.c
      libmysqld/lib_sql.cc
      mysql-test/mysql-test-run.pl
      mysql-test/r/udf.result
      mysql-test/suite/funcs_1/t/storedproc.test
      mysql-test/suite/perfschema/t/socket_instances_func.test
      mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
      mysql-test/suite/rpl/t/rpl_temporary.test
      mysql-test/t/csv.test
      mysql-test/t/disabled.def
      mysql-test/t/information_schema_parameters.test
      mysql-test/t/information_schema_routines.test
      mysql-test/t/lock.test
      mysql-test/t/mysql_plugin.test
      mysql-test/t/mysqlbinlog2.test
      mysql-test/t/ps.test
      mysql-test/t/ps_ddl.test
      mysql-test/t/sp-error.test
      mysql-test/t/sp.test
      mysql-test/t/trigger.test
      mysql-test/t/udf.test
      mysql-test/t/view_grant.test
      mysys/CMakeLists.txt
      mysys/array.c
      mysys/default.c
      mysys/lf_alloc-pin.c
      mysys/lf_dynarray.c
      mysys/mf_format.c
      mysys/mf_iocache.c
      mysys/my_alloc.c
      mysys/my_bitmap.c
      mysys/my_compare.c
      mysys/my_compress.c
      mysys/my_file.c
      mysys/stacktrace.c
      mysys/waiting_threads.c
      sql-common/client.c
      sql-common/client_plugin.c
      sql-common/my_time.c
      sql/CMakeLists.txt
      sql/binlog.cc
      sql/debug_sync.cc
      sql/field.cc
      sql/field.h
      sql/filesort.cc
      sql/ha_partition.cc
      sql/handler.cc
      sql/handler.h
      sql/item.cc
      sql/item_buff.cc
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_func.h
      sql/item_strfunc.cc
      sql/item_strfunc.h
      sql/item_sum.cc
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/key.cc
      sql/log.cc
      sql/log_event.cc
      sql/log_event.h
      sql/log_event_old.cc
      sql/mdl.cc
      sql/mdl.h
      sql/mysqld.cc
      sql/net_serv.cc
      sql/opt_range.cc
      sql/opt_range.h
      sql/opt_trace.cc
      sql/opt_trace.h
      sql/protocol.cc
      sql/rpl_mi.cc
      sql/rpl_record.cc
      sql/rpl_rli.cc
      sql/rpl_slave.cc
      sql/rpl_utility.cc
      sql/rpl_utility.h
      sql/set_var.cc
      sql/set_var.h
      sql/sp_head.cc
      sql/spatial.h
      sql/sql_acl.cc
      sql/sql_analyse.cc
      sql/sql_cache.cc
      sql/sql_class.cc
      sql/sql_client.cc
      sql/sql_connect.cc
      sql/sql_const.h
      sql/sql_error.cc
      sql/sql_join_cache.cc
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_plugin.h
      sql/sql_prepare.cc
      sql/sql_profile.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_show.cc
      sql/sql_string.cc
      sql/sql_table.cc
      sql/sql_table.h
      sql/sql_yacc.yy
      sql/thr_malloc.cc
      sql/tztime.cc
      sql/udf_example.def
      sql/unireg.cc
      storage/csv/ha_tina.cc
      storage/federated/ha_federated.cc
      storage/heap/hp_create.c
      storage/heap/hp_static.c
      storage/heap/hp_test2.c
      storage/innobase/sync/sync0rw.c
      storage/myisam/ha_myisam.cc
      storage/myisam/mi_cache.c
      storage/myisam/mi_check.c
      storage/myisam/mi_create.c
      storage/myisam/mi_dynrec.c
      storage/myisam/mi_extra.c
      storage/myisam/mi_open.c
      storage/myisam/mi_packrec.c
      storage/myisam/mi_static.c
      storage/myisam/myisamlog.c
      storage/myisam/myisampack.c
      storage/myisam/rt_mbr.c
      storage/myisam/sort.c
      storage/myisammrg/ha_myisammrg.cc
      strings/ctype-big5.c
      strings/ctype-bin.c
      strings/ctype-gbk.c
      strings/ctype-mb.c
      strings/ctype-simple.c
      strings/ctype-tis620.c
      strings/ctype-uca.c
      strings/ctype-ucs2.c
      strings/ctype-utf8.c
      strings/ctype.c
      strings/decimal.c
      strings/dtoa.c
      strings/my_vsnprintf.c
      support-files/mysql.spec.sh
      tests/mysql_client_test.c
      unittest/gunit/CMakeLists.txt
      unittest/gunit/gunit_test_main.cc
      unittest/gunit/item-t.cc
      unittest/mysys/lf-t.c
      unittest/mysys/my_atomic-t.c
      unittest/mysys/thr_template.c
      unittest/mysys/waiting_threads-t.c
      vio/viosocket.c
      win/create_def_file.js
      mysys/psi_noop.c
      sql/udf_example.cc
=== modified file 'mysql-test/include/join_cache.inc'
--- a/mysql-test/include/join_cache.inc	2011-08-08 14:16:20 +0000
+++ b/mysql-test/include/join_cache.inc	2011-11-04 15:20:13 +0000
@@ -1961,3 +1961,26 @@ eval EXPLAIN $query;
 eval $query;
 
 DROP TABLE t1, t2, t3, t4;
+
+--echo #
+--echo # Bug#12997905: VALGRIND: SYSCALL PARAM PWRITE64(BUF) 
+--echo #               POINTS TO UNINITIALISED BYTE(S)
+--echo #
+
+CREATE TABLE t1 (
+  col1 varchar(10),
+  col2 varchar(1024)
+) ENGINE=innodb;
+
+INSERT INTO t1 VALUES ('a','a');
+
+CREATE TABLE t2 (i varchar(10)) ENGINE=innodb;
+INSERT INTO t2 VALUES ('a');
+
+SELECT t1.col1
+FROM t1 JOIN t2 ON t1.col1 = t2.i 
+GROUP BY t1.col2;
+
+DROP TABLE t1,t2;
+
+--echo # End of Bug#12997905

=== modified file 'mysql-test/r/join_cache_bka.result'
--- a/mysql-test/r/join_cache_bka.result	2011-10-27 08:52:27 +0000
+++ b/mysql-test/r/join_cache_bka.result	2011-11-04 15:20:13 +0000
@@ -2681,4 +2681,22 @@ col_int
 NULL
 NULL
 DROP TABLE t1, t2, t3, t4;
+#
+# Bug#12997905: VALGRIND: SYSCALL PARAM PWRITE64(BUF) 
+#               POINTS TO UNINITIALISED BYTE(S)
+#
+CREATE TABLE t1 (
+col1 varchar(10),
+col2 varchar(1024)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('a','a');
+CREATE TABLE t2 (i varchar(10)) ENGINE=innodb;
+INSERT INTO t2 VALUES ('a');
+SELECT t1.col1
+FROM t1 JOIN t2 ON t1.col1 = t2.i 
+GROUP BY t1.col2;
+col1
+a
+DROP TABLE t1,t2;
+# End of Bug#12997905
 set optimizer_switch = default;

=== modified file 'mysql-test/r/join_cache_bka_nixbnl.result'
--- a/mysql-test/r/join_cache_bka_nixbnl.result	2011-10-27 08:52:27 +0000
+++ b/mysql-test/r/join_cache_bka_nixbnl.result	2011-11-04 15:20:13 +0000
@@ -2681,4 +2681,22 @@ col_int
 NULL
 NULL
 DROP TABLE t1, t2, t3, t4;
+#
+# Bug#12997905: VALGRIND: SYSCALL PARAM PWRITE64(BUF) 
+#               POINTS TO UNINITIALISED BYTE(S)
+#
+CREATE TABLE t1 (
+col1 varchar(10),
+col2 varchar(1024)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('a','a');
+CREATE TABLE t2 (i varchar(10)) ENGINE=innodb;
+INSERT INTO t2 VALUES ('a');
+SELECT t1.col1
+FROM t1 JOIN t2 ON t1.col1 = t2.i 
+GROUP BY t1.col2;
+col1
+a
+DROP TABLE t1,t2;
+# End of Bug#12997905
 set optimizer_switch = default;

=== modified file 'mysql-test/r/join_cache_bkaunique.result'
--- a/mysql-test/r/join_cache_bkaunique.result	2011-10-27 08:52:27 +0000
+++ b/mysql-test/r/join_cache_bkaunique.result	2011-11-04 15:20:13 +0000
@@ -2682,4 +2682,22 @@ col_int
 NULL
 NULL
 DROP TABLE t1, t2, t3, t4;
+#
+# Bug#12997905: VALGRIND: SYSCALL PARAM PWRITE64(BUF) 
+#               POINTS TO UNINITIALISED BYTE(S)
+#
+CREATE TABLE t1 (
+col1 varchar(10),
+col2 varchar(1024)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('a','a');
+CREATE TABLE t2 (i varchar(10)) ENGINE=innodb;
+INSERT INTO t2 VALUES ('a');
+SELECT t1.col1
+FROM t1 JOIN t2 ON t1.col1 = t2.i 
+GROUP BY t1.col2;
+col1
+a
+DROP TABLE t1,t2;
+# End of Bug#12997905
 set optimizer_switch = default;

=== modified file 'mysql-test/r/join_cache_bnl.result'
--- a/mysql-test/r/join_cache_bnl.result	2011-10-27 08:52:27 +0000
+++ b/mysql-test/r/join_cache_bnl.result	2011-11-04 15:20:13 +0000
@@ -2682,4 +2682,22 @@ col_int
 NULL
 NULL
 DROP TABLE t1, t2, t3, t4;
+#
+# Bug#12997905: VALGRIND: SYSCALL PARAM PWRITE64(BUF) 
+#               POINTS TO UNINITIALISED BYTE(S)
+#
+CREATE TABLE t1 (
+col1 varchar(10),
+col2 varchar(1024)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('a','a');
+CREATE TABLE t2 (i varchar(10)) ENGINE=innodb;
+INSERT INTO t2 VALUES ('a');
+SELECT t1.col1
+FROM t1 JOIN t2 ON t1.col1 = t2.i 
+GROUP BY t1.col2;
+col1
+a
+DROP TABLE t1,t2;
+# End of Bug#12997905
 set optimizer_switch = default;

=== modified file 'mysql-test/r/join_cache_nojb.result'
--- a/mysql-test/r/join_cache_nojb.result	2011-10-27 08:52:27 +0000
+++ b/mysql-test/r/join_cache_nojb.result	2011-11-04 15:20:13 +0000
@@ -2682,4 +2682,22 @@ NULL
 3
 NULL
 DROP TABLE t1, t2, t3, t4;
+#
+# Bug#12997905: VALGRIND: SYSCALL PARAM PWRITE64(BUF) 
+#               POINTS TO UNINITIALISED BYTE(S)
+#
+CREATE TABLE t1 (
+col1 varchar(10),
+col2 varchar(1024)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('a','a');
+CREATE TABLE t2 (i varchar(10)) ENGINE=innodb;
+INSERT INTO t2 VALUES ('a');
+SELECT t1.col1
+FROM t1 JOIN t2 ON t1.col1 = t2.i 
+GROUP BY t1.col2;
+col1
+a
+DROP TABLE t1,t2;
+# End of Bug#12997905
 set optimizer_switch = default;

=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2011-10-07 06:03:14 +0000
+++ b/mysql-test/valgrind.supp	2011-11-04 15:22:50 +0000
@@ -1023,35 +1023,3 @@
    fun:_Z*10write_keysP10Sort_paramPPhjP11st_io_cacheS4_
    fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPyS7_
 }
-
-# Syscall param write(buf) points to uninitialised byte(s)
-# The '...' wildcard is for 'fun:inline_mysql_file_write' which *may*
-# be inlined.
-{
-   Bug#12879084 VALGRIND FAILURE IN INNODB.INNODB_BUFFER_POOL_LOAD / one
-   Memcheck:Param
-   write(buf)
-   obj:*/libpthread*.so
-   fun:my_write
-   ...
-   fun:my_b_flush_io_cache
-   fun:end_io_cache
-   fun:mi_extra
-   fun:_ZN9ha_myisam5extraE17ha_extra_function
-}
-
-{
-   Bug#12879084 VALGRIND FAILURE IN INNODB.INNODB_BUFFER_POOL_LOAD / two
-   Memcheck:Param
-   write(buf)
-   obj:*/libpthread*.so
-   fun:my_write
-   fun:my_b_flush_io_cache
-   fun:_my_b_write
-   fun:_mi_write_part_record
-   fun:write_dynamic_record
-   fun:_mi_write_blob_record
-   fun:mi_write
-   fun:_ZN9ha_myisam9write_rowEPh
-   fun:_ZN7handler12ha_write_rowEPh
-}

=== modified file 'sql/field.h'
--- a/sql/field.h	2011-10-11 04:27:52 +0000
+++ b/sql/field.h	2011-11-04 15:20:13 +0000
@@ -2454,6 +2454,23 @@ public:
   uchar *from_null_ptr,*to_null_ptr;
   my_bool *null_row;
   uint	from_bit,to_bit;
+  /**
+    Number of bytes in the fields pointed to by 'from_ptr' and
+    'to_ptr'. Usually this is the number of bytes that are copied from
+    'from_ptr' to 'to_ptr'.
+
+    For variable-length fields (VARCHAR), the first byte(s) describe
+    the actual length of the text. For VARCHARs with length 
+       < 256 there is 1 length byte 
+       >= 256 there is 2 length bytes
+    Thus, if from_field is VARCHAR(10), from_length (and in most cases
+    to_length) is 11. For VARCHAR(1024), the length is 1026. @see
+    Field_varstring::length_bytes
+
+    Note that for VARCHARs, do_copy() will be do_varstring*() which
+    only copies the length-bytes (1 or 2) + the actual length of the
+    text instead of from/to_length bytes. @see get_copy_func()
+  */
   uint from_length,to_length;
   Field *from_field,*to_field;
   String tmp;					// For items

=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc	2011-07-28 10:54:44 +0000
+++ b/sql/field_conv.cc	2011-11-04 15:20:13 +0000
@@ -709,7 +709,7 @@ Copy_field::get_copy_func(Field *to,Fiel
         if (((Field_varstring*) to)->length_bytes !=
             ((Field_varstring*) from)->length_bytes)
           return do_field_string;
-        if (to_length != from_length)
+        else
           return (((Field_varstring*) to)->length_bytes == 1 ?
                   (from->charset()->mbmaxlen == 1 ? do_varstring1 :
                                                     do_varstring1_mb) :

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-11-03 16:03:34 +0000
+++ b/sql/sql_select.cc	2011-11-04 15:20:13 +0000
@@ -18468,6 +18468,8 @@ bool instantiate_tmp_table(TABLE *table,
     if (create_myisam_tmp_table(table, keyinfo, start_recinfo, recinfo,
                                 options, big_tables))
       return TRUE;
+    // Make empty record so random data is not written to disk
+    empty_record(table);
   }
   if (open_tmp_table(table))
     return TRUE;

=== modified file 'storage/perfschema/unittest/pfs_benchmark-t.cc'
--- a/storage/perfschema/unittest/pfs_benchmark-t.cc	2011-11-04 01:12:21 +0000
+++ b/storage/perfschema/unittest/pfs_benchmark-t.cc	2011-11-05 12:39:20 +0000
@@ -390,194 +390,252 @@ void benchmark_file_open(uint count, con
        count, timer_cycles, timer_cycles/count);
 }
 
-void fake_TABLE_SHARE(TABLE_SHARE *fake)
+void fake_TABLE_SHARE(TABLE_SHARE *fake, bool alive)
 {
-  fake->db.str = (char*) "test";
-  fake->db.length = 4;
-  fake->table_name.str = (char*) "t1";
-  fake->table_name.length = 2;
-  fake->keys= 0;
+  if (alive)
+  {
+    /* ENABLED in SETUP_OBJECTS */
+    fake->db.str = (char*) "test";
+    fake->db.length = 4;
+    fake->table_name.str = (char*) "t1";
+    fake->table_name.length = 2;
+    fake->keys= 0;
+  }
+  else
+  {
+    /* DISABLED in SETUP_OBJECTS */
+    fake->db.str = (char*) "mysql";
+    fake->db.length = 5;
+    fake->table_name.str = (char*) "user";
+    fake->table_name.length = 4;
+    fake->keys= 0;
+  }
 }
 
 void benchmark_create_table_share(uint count, const char *test)
 {
-  ulonglong timer_start;
-  ulonglong timer_end;
-  ulonglong timer_cycles;
-
-  TABLE_SHARE table_share;
-  fake_TABLE_SHARE(& table_share);
-
-  PSI_table_share *that;
-
-  timer_start= my_timer_cycles();
-
-  uint i;
-  start_some_work();
-  for (i= 0 ; i<count; i++)
+  int l;
+  for (l=1; l<=2; l++)
   {
-    that= PSI_CALL(get_table_share)(false, &table_share);
-    do_some_work();
-    PSI_CALL(drop_table_share)("test", 4, "t1", 2);
+    bool alive= (l == 1);
+    ulonglong timer_start;
+    ulonglong timer_end;
+    ulonglong timer_cycles;
+
+    TABLE_SHARE table_share;
+    fake_TABLE_SHARE(& table_share, alive);
+
+    PSI_table_share *that;
+
+    timer_start= my_timer_cycles();
+
+    uint i;
+    start_some_work();
+    for (i= 0 ; i<count; i++)
+    {
+      that= PSI_CALL(get_table_share)(false, &table_share);
+      do_some_work();
+      PSI_CALL(drop_table_share)(table_share.db.str, table_share.db.length,
+                                 table_share.table_name.str, table_share.table_name.length);
+    }
+
+    timer_end= my_timer_cycles();
+    timer_cycles= timer_end-timer_start;
+    // ok(get_work_done() == count, "work done");
+
+    diag("CREATE_TABLE_SHARE benchmark: %s, object %s, %d calls, %13llu cycles, %13llu avg",
+         test,
+         (alive ? "alive" : "dead"),
+         count, timer_cycles, timer_cycles/count);
   }
-
-  timer_end= my_timer_cycles();
-  timer_cycles= timer_end-timer_start;
-  // ok(get_work_done() == count, "work done");
-
-  diag("CREATE_TABLE_SHARE benchmark: %s, %d calls, %13llu cycles, %13llu avg",
-       test,
-       count, timer_cycles, timer_cycles/count);
 }
 
 void benchmark_find_table_share(uint count, const char *test)
 {
-  ulonglong timer_start;
-  ulonglong timer_end;
-  ulonglong timer_cycles;
-
-  TABLE_SHARE table_share;
-  fake_TABLE_SHARE(& table_share);
-
-  PSI_table_share *that_1;
-  PSI_table_share *that_2;
-
-  timer_start= my_timer_cycles();
-
-  uint i;
-  start_some_work();
-  that_1= PSI_CALL(get_table_share)(false, &table_share);
-  for (i= 0 ; i<count; i++)
+  int l;
+  for (l=1; l<=2; l++)
   {
-    that_2= PSI_CALL(get_table_share)(false, &table_share);
-    do_some_work();
-    PSI_CALL(release_table_share)(that_2);
+    bool alive= (l == 1);
+    ulonglong timer_start;
+    ulonglong timer_end;
+    ulonglong timer_cycles;
+
+    TABLE_SHARE table_share;
+    fake_TABLE_SHARE(& table_share, alive);
+
+    PSI_table_share *that_1;
+    PSI_table_share *that_2;
+
+    timer_start= my_timer_cycles();
+
+    uint i;
+    start_some_work();
+    that_1= PSI_CALL(get_table_share)(false, &table_share);
+    for (i= 0 ; i<count; i++)
+    {
+      that_2= PSI_CALL(get_table_share)(false, &table_share);
+      do_some_work();
+      PSI_CALL(release_table_share)(that_2);
+    }
+    PSI_CALL(drop_table_share)(table_share.db.str, table_share.db.length,
+                               table_share.table_name.str, table_share.table_name.length);
+
+    timer_end= my_timer_cycles();
+    timer_cycles= timer_end-timer_start;
+    // ok(get_work_done() == count, "work done");
+
+    diag("FIND_TABLE_SHARE benchmark: %s, object %s, %d calls, %13llu cycles, %13llu avg",
+         test,
+         (alive ? "alive" : "dead"),
+         count, timer_cycles, timer_cycles/count);
   }
-  PSI_CALL(drop_table_share)("test", 4, "t1", 2);
-
-  timer_end= my_timer_cycles();
-  timer_cycles= timer_end-timer_start;
-  // ok(get_work_done() == count, "work done");
-
-  diag("FIND_TABLE_SHARE benchmark: %s, %d calls, %13llu cycles, %13llu avg",
-       test,
-       count, timer_cycles, timer_cycles/count);
 }
 
 void benchmark_open_table(uint count, const char *test)
 {
-  ulonglong timer_start;
-  ulonglong timer_end;
-  ulonglong timer_cycles;
-
-  TABLE_SHARE table_share;
-  fake_TABLE_SHARE(& table_share);
-
-  PSI_table_share *that_share;
-  that_share= PSI_CALL(get_table_share)(false, &table_share);
-
-  PSI_table *that;
-  timer_start= my_timer_cycles();
-
-  uint i;
-  start_some_work();
-  for (i= 0 ; i<count; i++)
+  int l;
+  for (l=1; l<=2; l++)
   {
-    that= PSI_CALL(open_table)(that_share, NULL);
-    do_some_work();
-    PSI_CALL(close_table)(that);
+    bool alive= (l == 1);
+    ulonglong timer_start;
+    ulonglong timer_end;
+    ulonglong timer_cycles;
+
+    TABLE_SHARE table_share;
+    fake_TABLE_SHARE(& table_share, alive);
+
+    PSI_table_share *that_share;
+    that_share= PSI_CALL(get_table_share)(false, &table_share);
+
+    PSI_table *that;
+    timer_start= my_timer_cycles();
+
+    uint i;
+    start_some_work();
+    for (i= 0 ; i<count; i++)
+    {
+      that= PSI_CALL(open_table)(that_share, NULL);
+      do_some_work();
+      PSI_CALL(close_table)(that);
+    }
+
+    timer_end= my_timer_cycles();
+    timer_cycles= timer_end-timer_start;
+
+    PSI_CALL(drop_table_share)(table_share.db.str, table_share.db.length,
+                               table_share.table_name.str, table_share.table_name.length);
+
+    // ok(get_work_done() == count, "work done");
+
+    diag("OPEN_TABLE benchmark: %s, object %s, %d calls, %13llu cycles, %13llu avg",
+         test,
+         (alive ? "alive" : "dead"),
+         count, timer_cycles, timer_cycles/count);
   }
-
-  timer_end= my_timer_cycles();
-  timer_cycles= timer_end-timer_start;
-
-  PSI_CALL(drop_table_share)("test", 4, "t1", 2);
-
-  // ok(get_work_done() == count, "work done");
-
-  diag("OPEN_TABLE benchmark: %s, %d calls, %13llu cycles, %13llu avg",
-       test,
-       count, timer_cycles, timer_cycles/count);
 }
 
 void benchmark_table_io(uint count, const char *test)
 {
-  ulonglong timer_start;
-  ulonglong timer_end;
-  ulonglong timer_cycles;
+  int l;
+  for (l=1; l<=2; l++)
+  {
+    bool alive= (l == 1);
+    ulonglong timer_start;
+    ulonglong timer_end;
+    ulonglong timer_cycles;
 
-  TABLE_SHARE table_share;
-  fake_TABLE_SHARE(& table_share);
+    TABLE_SHARE table_share;
+    fake_TABLE_SHARE(& table_share, alive);
 
-  PSI_table_share *that_share;
-  that_share= PSI_CALL(get_table_share)(false, &table_share);
+    PSI_table_share *that_share;
+    that_share= PSI_CALL(get_table_share)(false, &table_share);
 
-  PSI_table *that;
-  that= PSI_CALL(open_table)(that_share, NULL);
+    PSI_table *that;
+    that= PSI_CALL(open_table)(that_share, NULL);
 
-  timer_start= my_timer_cycles();
+    timer_start= my_timer_cycles();
 
-  uint i;
-  start_some_work();
-  for (i= 0 ; i<count; i++)
-  {
-    MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
-    MYSQL_START_TABLE_IO_WAIT(locker, &state, that,
-                              PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
-    do_some_work();
-    MYSQL_END_TABLE_IO_WAIT(locker);
-  }
+    uint i;
+    start_some_work();
+    for (i= 0 ; i<count; i++)
+    {
+#if defined MYSQL_TABLE_IO_WAIT
+      MYSQL_TABLE_IO_WAIT(that, PSI_TABLE_FETCH_ROW, MAX_KEY, 0,
+        { do_some_work(); })
+#else
+      MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+      MYSQL_START_TABLE_IO_WAIT(locker, &state, that,
+                                PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
+      do_some_work();
+      MYSQL_END_TABLE_IO_WAIT(locker);
+#endif
+    }
 
-  timer_end= my_timer_cycles();
-  timer_cycles= timer_end-timer_start;
-  // ok(get_work_done() == count, "work done");
+    timer_end= my_timer_cycles();
+    timer_cycles= timer_end-timer_start;
+    // ok(get_work_done() == count, "work done");
 
-  PSI_CALL(close_table)(that);
-  PSI_CALL(drop_table_share)("test", 4, "t1", 2);
+    PSI_CALL(close_table)(that);
+    PSI_CALL(drop_table_share)(table_share.db.str, table_share.db.length,
+                               table_share.table_name.str, table_share.table_name.length);
 
-  diag("TABLE_IO benchmark: %s, %d calls, %13llu cycles, %13llu avg",
-       test,
-       count, timer_cycles, timer_cycles/count);
+    diag("TABLE_IO benchmark: %s, object %s, %d calls, %13llu cycles, %13llu avg",
+         test,
+         (alive ? "alive" : "dead"),
+         count, timer_cycles, timer_cycles/count);
+  }
 }
 
 void benchmark_table_lock(uint count, const char *test)
 {
-  ulonglong timer_start;
-  ulonglong timer_end;
-  ulonglong timer_cycles;
+  int l;
+  for (l=1; l<=2; l++)
+  {
+    bool alive= (l == 1);
+    ulonglong timer_start;
+    ulonglong timer_end;
+    ulonglong timer_cycles;
 
-  TABLE_SHARE table_share;
-  fake_TABLE_SHARE(& table_share);
+    TABLE_SHARE table_share;
+    fake_TABLE_SHARE(& table_share, alive);
 
-  PSI_table_share *that_share;
-  that_share= PSI_CALL(get_table_share)(false, &table_share);
+    PSI_table_share *that_share;
+    that_share= PSI_CALL(get_table_share)(false, &table_share);
 
-  PSI_table *that;
-  that= PSI_CALL(open_table)(that_share, NULL);
+    PSI_table *that;
+    that= PSI_CALL(open_table)(that_share, NULL);
 
-  timer_start= my_timer_cycles();
+    timer_start= my_timer_cycles();
 
-  uint i;
-  start_some_work();
-  for (i= 0 ; i<count; i++)
-  {
-    MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
-    MYSQL_START_TABLE_LOCK_WAIT(locker, &state, that,
-                                PSI_TABLE_EXTERNAL_LOCK, F_RDLCK);
-    do_some_work();
-    MYSQL_END_TABLE_LOCK_WAIT(locker);
-  }
+    uint i;
+    start_some_work();
+    for (i= 0 ; i<count; i++)
+    {
+#if defined MYSQL_TABLE_LOCK_WAIT
+      MYSQL_TABLE_LOCK_WAIT(that, PSI_TABLE_EXTERNAL_LOCK, F_RDLCK,
+        { do_some_work(); })
+#else
+      MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+      MYSQL_START_TABLE_LOCK_WAIT(locker, &state, that,
+                                  PSI_TABLE_EXTERNAL_LOCK, F_RDLCK);
+      do_some_work();
+      MYSQL_END_TABLE_LOCK_WAIT(locker);
+#endif
+    }
 
-  timer_end= my_timer_cycles();
-  timer_cycles= timer_end-timer_start;
-  // ok(get_work_done() == count, "work done");
+    timer_end= my_timer_cycles();
+    timer_cycles= timer_end-timer_start;
+    // ok(get_work_done() == count, "work done");
 
-  PSI_CALL(close_table)(that);
-  PSI_CALL(drop_table_share)("test", 4, "t1", 2);
+    PSI_CALL(close_table)(that);
+    PSI_CALL(drop_table_share)(table_share.db.str, table_share.db.length,
+                               table_share.table_name.str, table_share.table_name.length);
 
-  diag("TABLE_LOCK benchmark: %s, %d calls, %13llu cycles, %13llu avg",
-       test,
-       count, timer_cycles, timer_cycles/count);
+    diag("TABLE_LOCK benchmark: %s, object %s, %d calls, %13llu cycles, %13llu avg",
+         test,
+         (alive ? "alive" : "dead"),
+         count, timer_cycles, timer_cycles/count);
+  }
 }
 
 void benchmark_all(bool enabled, bool timed, const char *test)
@@ -636,14 +694,6 @@ void benchmark_all(bool enabled, bool ti
   benchmark_open_table(1000000, msg);
   benchmark_table_io(1000000, msg);
   benchmark_table_lock(1000000, msg);
-
-/*
-  benchmark_mutex(10000000, msg);
-  benchmark_rwlock(10000000, msg);
-  benchmark_cond(10000000, msg);
-  benchmark_table_io(10000000, msg);
-  benchmark_table_lock(10000000, msg);
-*/
 }
 
 void test_all(bool enabled, bool timed)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-marc branch (marc.alff:3560 to 3562) Marc Alff7 Nov