List:Commits« Previous MessageNext Message »
From:Marc Alff Date:July 26 2010 5:20pm
Subject:bzr push into mysql-next-mr branch (marc.alff:3168 to 3169)
View as plain text  
 3169 Marc Alff	2010-07-26
      Fixed build break when compiling without the performance schema

    modified:
      include/mysql/psi/mysql_table.h
      mysys/thr_lock.c
      sql/handler.cc
 3168 Alexander Nozdrin	2010-07-24 [merge]
      Auto-merge from mysql-next-mr-wl4895.

    added:
      Doxyfile-wl4895
      include/mysql/psi/mysql_table.h
      mysql-test/suite/perfschema/include/table_io_basic_dml.inc
      mysql-test/suite/perfschema/include/table_io_cleanup_helper.inc
      mysql-test/suite/perfschema/include/table_io_result_helper.inc
      mysql-test/suite/perfschema/include/table_io_setup_helper.inc
      mysql-test/suite/perfschema/r/csv_table_io.result
      mysql-test/suite/perfschema/r/indexed_table_io.result
      mysql-test/suite/perfschema/r/innodb_table_io.result
      mysql-test/suite/perfschema/r/memory_table_io.result
      mysql-test/suite/perfschema/r/merge_table_io.result
      mysql-test/suite/perfschema/r/multi_table_io.result
      mysql-test/suite/perfschema/r/myisam_table_io.result
      mysql-test/suite/perfschema/r/part_table_io.result
      mysql-test/suite/perfschema/r/privilege_table_io.result
      mysql-test/suite/perfschema/r/rollback_table_io.result
      mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
      mysql-test/suite/perfschema/r/start_server_no_table_inst.result
      mysql-test/suite/perfschema/r/start_server_nothing.result
      mysql-test/suite/perfschema/r/temp_table_io.result
      mysql-test/suite/perfschema/r/trigger_table_io.result
      mysql-test/suite/perfschema/r/view_table_io.result
      mysql-test/suite/perfschema/t/csv_table_io.test
      mysql-test/suite/perfschema/t/indexed_table_io.test
      mysql-test/suite/perfschema/t/innodb_table_io.test
      mysql-test/suite/perfschema/t/memory_table_io.test
      mysql-test/suite/perfschema/t/merge_table_io.test
      mysql-test/suite/perfschema/t/multi_table_io.test
      mysql-test/suite/perfschema/t/myisam_table_io.test
      mysql-test/suite/perfschema/t/part_table_io.test
      mysql-test/suite/perfschema/t/privilege_table_io.test
      mysql-test/suite/perfschema/t/rollback_table_io.test
      mysql-test/suite/perfschema/t/start_server_no_table_hdl-master.opt
      mysql-test/suite/perfschema/t/start_server_no_table_hdl.test
      mysql-test/suite/perfschema/t/start_server_no_table_inst-master.opt
      mysql-test/suite/perfschema/t/start_server_no_table_inst.test
      mysql-test/suite/perfschema/t/start_server_nothing-master.opt
      mysql-test/suite/perfschema/t/start_server_nothing.test
      mysql-test/suite/perfschema/t/temp_table_io.test
      mysql-test/suite/perfschema/t/trigger_table_io.test
      mysql-test/suite/perfschema/t/view_table_io.test
      storage/perfschema/table_helper.h
    modified:
      include/Makefile.am
      include/mysql/psi/psi.h
      include/mysql/psi/psi_abi_v1.h.pp
      include/mysql/psi/psi_abi_v2.h.pp
      mysql-test/include/mtr_check.sql
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/suite/perfschema/include/start_server_common.inc
      mysql-test/suite/perfschema/r/dml_events_waits_current.result
      mysql-test/suite/perfschema/r/dml_events_waits_history.result
      mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
      mysql-test/suite/perfschema/r/func_file_io.result
      mysql-test/suite/perfschema/r/func_mutex.result
      mysql-test/suite/perfschema/r/myisam_file_io.result
      mysql-test/suite/perfschema/r/no_threads.result
      mysql-test/suite/perfschema/r/selects.result
      mysql-test/suite/perfschema/r/start_server_no_cond_class.result
      mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
      mysql-test/suite/perfschema/r/start_server_no_file_class.result
      mysql-test/suite/perfschema/r/start_server_no_file_inst.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
      mysql-test/suite/perfschema/r/start_server_no_thread_class.result
      mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
      mysql-test/suite/perfschema/r/start_server_off.result
      mysql-test/suite/perfschema/r/start_server_on.result
      mysql-test/suite/perfschema/t/dml_events_waits_current.test
      mysql-test/suite/perfschema/t/dml_events_waits_history.test
      mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
      mysql-test/suite/perfschema/t/func_file_io.test
      mysql-test/suite/perfschema/t/func_mutex.test
      mysql-test/suite/perfschema/t/myisam_file_io.test
      mysql-test/suite/perfschema/t/no_threads.test
      mysql-test/suite/perfschema/t/selects.test
      mysys/thr_lock.c
      sql/event_db_repository.cc
      sql/filesort.cc
      sql/ha_partition.cc
      sql/handler.cc
      sql/handler.h
      sql/item_subselect.cc
      sql/lock.cc
      sql/log_event.cc
      sql/log_event_old.cc
      sql/opt_range.cc
      sql/opt_sum.cc
      sql/records.cc
      sql/sp.cc
      sql/sql_acl.cc
      sql/sql_base.cc
      sql/sql_cursor.cc
      sql/sql_handler.cc
      sql/sql_help.cc
      sql/sql_insert.cc
      sql/sql_plugin.cc
      sql/sql_select.cc
      sql/sql_servers.cc
      sql/sql_show.cc
      sql/sql_table.cc
      sql/sql_udf.cc
      sql/sql_update.cc
      sql/table.cc
      sql/tztime.cc
      storage/perfschema/CMakeLists.txt
      storage/perfschema/Makefile.am
      storage/perfschema/ha_perfschema.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_column_types.h
      storage/perfschema/pfs_engine_table.h
      storage/perfschema/pfs_events_waits.h
      storage/perfschema/pfs_instr.cc
      storage/perfschema/pfs_instr.h
      storage/perfschema/pfs_instr_class.cc
      storage/perfschema/pfs_instr_class.h
      storage/perfschema/pfs_server.h
      storage/perfschema/table_all_instr.h
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_events_waits.h
      storage/perfschema/table_events_waits_summary.h
      storage/perfschema/table_setup_instruments.cc
      storage/perfschema/table_setup_instruments.h
      storage/perfschema/table_setup_objects.cc
      storage/perfschema/table_setup_objects.h
      storage/perfschema/unittest/pfs_instr-t.cc
      storage/perfschema/unittest/pfs_instr_class-t.cc
=== modified file 'include/mysql/psi/mysql_table.h'
--- a/include/mysql/psi/mysql_table.h	2010-07-23 17:08:41 +0000
+++ b/include/mysql/psi/mysql_table.h	2010-07-26 17:20:27 +0000
@@ -30,35 +30,56 @@
 */
 
 /**
+  @def MYSQL_TABLE_WAIT_VARIABLES
+  Instrumentation helper for table waits.
+  This instrumentation declares local variables.
+  Do not use a ';' after this macro
+  @param LOCKER the locker
+  @param STATE the locker state
+  @sa MYSQL_START_TABLE_WAIT.
+  @sa MYSQL_END_TABLE_WAIT.
+*/
+#ifdef HAVE_PSI_INTERFACE
+  #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE) \
+    struct PSI_table_locker* LOCKER; \
+    PSI_table_locker_state STATE;
+#else
+  #define MYSQL_TABLE_WAIT_VARIABLES(LOCKER, STATE)
+#endif
+
+/**
   @def MYSQL_START_TABLE_WAIT
   Instrumentation helper for table waits.
   This instrumentation marks the start of a wait event.
-  @param STATE The locker state
-  @param PSI The instrumented table
-  @param OP The table operation to be performed
-  @param INDEX The table index used if any, or MAY_KEY.
-  @param FLAGS Per table operation flags.
+  @param LOCKER the locker
+  @param STATE the locker state
+  @param PSI the instrumented table
+  @param OP the table operation to be performed
+  @param INDEX the table index used if any, or MAY_KEY.
+  @param FLAGS per table operation flags.
   @sa MYSQL_END_TABLE_WAIT.
 */
 #ifdef HAVE_PSI_INTERFACE
-  #define MYSQL_START_TABLE_WAIT(STATE, PSI, OP, INDEX, FLAGS) \
-    inline_mysql_start_table_wait(STATE, PSI, OP, INDEX, FLAGS, __FILE__, __LINE__)
+  #define MYSQL_START_TABLE_WAIT(LOCKER, STATE, PSI, OP, INDEX, FLAGS) \
+    LOCKER= inline_mysql_start_table_wait(STATE, PSI, \
+                                          OP, INDEX, FLAGS, __FILE__, __LINE__)
 #else
-  #define MYSQL_START_TABLE_WAIT(STATE, PSI, OP, INDEX, FLAGS) \
-    NULL
+  #define MYSQL_START_TABLE_WAIT(LOCKER, STATE, PSI, OP, INDEX, FLAGS) \
+    do {} while (0)
 #endif
 
 /**
   @def MYSQL_END_TABLE_WAIT
   Instrumentation helper for table waits.
   This instrumentation marks the end of a wait event.
+  @param LOCKER the locker
   @sa MYSQL_START_TABLE_WAIT.
 */
 #ifdef HAVE_PSI_INTERFACE
-  #define MYSQL_END_TABLE_WAIT(L) \
-    inline_mysql_end_table_wait(L)
+  #define MYSQL_END_TABLE_WAIT(LOCKER) \
+    inline_mysql_end_table_wait(LOCKER)
 #else
-  #define MYSQL_END_TABLE_WAIT(L) \
+  #define MYSQL_END_TABLE_WAIT(LOCKER) \
     do {} while (0)
 #endif
 

=== modified file 'mysys/thr_lock.c'
--- a/mysys/thr_lock.c	2010-07-23 17:08:41 +0000
+++ b/mysys/thr_lock.c	2010-07-26 17:20:27 +0000
@@ -514,8 +514,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_O
   enum enum_thr_lock_result result= THR_LOCK_SUCCESS;
   struct st_lock_list *wait_queue;
   THR_LOCK_DATA *lock_owner;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
   DBUG_ENTER("thr_lock");
 
   data->next=0;
@@ -523,7 +522,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_O
   data->type=lock_type;
   data->owner= owner;                           /* Must be reset ! */
 
-  locker= MYSQL_START_TABLE_WAIT(& state, data->m_psi, PSI_TABLE_LOCK, 0, lock_type);
+  MYSQL_START_TABLE_WAIT(locker, &state, data->m_psi,
+                         PSI_TABLE_LOCK, 0, lock_type);
 
   mysql_mutex_lock(&lock->mutex);
   DBUG_PRINT("lock",("data: 0x%lx  thread: 0x%lx  lock: 0x%lx  type: %d",

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2010-07-23 17:08:41 +0000
+++ b/sql/handler.cc	2010-07-26 17:20:27 +0000
@@ -2191,9 +2191,10 @@ int handler::ha_close(void)
 int handler::ha_rnd_next(uchar *buf)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
   result= rnd_next(buf);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2202,9 +2203,10 @@ int handler::ha_rnd_next(uchar *buf)
 int handler::ha_rnd_pos(uchar *buf, uchar *pos)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, MAX_KEY, 0);
   result= rnd_pos(buf, pos);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2215,9 +2217,10 @@ int handler::ha_index_read_map(uchar *bu
                                enum ha_rkey_function find_flag)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_read_map(buf, key, keypart_map, find_flag);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2228,9 +2231,10 @@ int handler::ha_index_read_idx_map(uchar
                                    enum ha_rkey_function find_flag)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, index, 0);
   result= index_read_idx_map(buf, index, key, keypart_map, find_flag);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2239,9 +2243,10 @@ int handler::ha_index_read_idx_map(uchar
 int handler::ha_index_next(uchar * buf)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_next(buf);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2250,9 +2255,10 @@ int handler::ha_index_next(uchar * buf)
 int handler::ha_index_prev(uchar * buf)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_prev(buf);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2261,9 +2267,10 @@ int handler::ha_index_prev(uchar * buf)
 int handler::ha_index_first(uchar * buf)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_first(buf);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2272,9 +2279,10 @@ int handler::ha_index_first(uchar * buf)
 int handler::ha_index_last(uchar * buf)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_last(buf);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2283,9 +2291,10 @@ int handler::ha_index_last(uchar * buf)
 int handler::ha_index_next_same(uchar *buf, const uchar *key, uint keylen)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_next_same(buf, key, keylen);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2295,9 +2304,10 @@ int handler::ha_index_read(uchar *buf, c
                            enum ha_rkey_function find_flag)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_read(buf, key, key_len, find_flag);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -2306,9 +2316,10 @@ int handler::ha_index_read(uchar *buf, c
 int handler::ha_index_read_last(uchar *buf, const uchar *key, uint key_len)
 {
   int result;
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_FETCH_ROW, active_index, 0);
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_FETCH_ROW, active_index, 0);
   result= index_read_last(buf, key, key_len);
   MYSQL_END_TABLE_WAIT(locker);
   return result;
@@ -4785,6 +4796,8 @@ static int binlog_log_row(TABLE* table,
 
 int handler::ha_external_lock(THD *thd, int lock_type)
 {
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
   DBUG_ENTER("handler::ha_external_lock");
   /*
     Whether this is lock or unlock, this should be true, and is to verify that
@@ -4814,10 +4827,8 @@ int handler::ha_external_lock(THD *thd,
     }
   }
 
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi,
-                                 PSI_TABLE_EXTERNAL_LOCK, MAX_KEY, lock_type);
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_EXTERNAL_LOCK, MAX_KEY, lock_type);
   /*
     We cache the table flags if the locking succeeded. Otherwise, we
     keep them as they were when they were fetched in ha_open().
@@ -4876,13 +4887,14 @@ int handler::ha_write_row(uchar *buf)
 {
   int error;
   Log_func *log_func= Write_rows_log_event::binlog_row_logging_function;
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
+
   DBUG_ENTER("handler::ha_write_row");
 
   MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str);
   mark_trx_read_write();
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_WRITE_ROW, MAX_KEY, 0);
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_WRITE_ROW, MAX_KEY, 0);
 
   error= write_row(buf);
 
@@ -4901,6 +4913,7 @@ int handler::ha_update_row(const uchar *
 {
   int error;
   Log_func *log_func= Update_rows_log_event::binlog_row_logging_function;
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
 
   /*
     Some storage engines require that the new record is in record[0]
@@ -4911,9 +4924,8 @@ int handler::ha_update_row(const uchar *
   MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
   mark_trx_read_write();
 
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_UPDATE_ROW, MAX_KEY, 0);
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_UPDATE_ROW, MAX_KEY, 0);
 
   error= update_row(old_data, new_data);
 
@@ -4930,13 +4942,13 @@ int handler::ha_delete_row(const uchar *
 {
   int error;
   Log_func *log_func= Delete_rows_log_event::binlog_row_logging_function;
+  MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */
 
   MYSQL_DELETE_ROW_START(table_share->db.str, table_share->table_name.str);
   mark_trx_read_write();
 
-  struct PSI_table_locker *locker;
-  PSI_table_locker_state state;
-  locker= MYSQL_START_TABLE_WAIT(&state, m_psi, PSI_TABLE_DELETE_ROW, MAX_KEY, 0);
+  MYSQL_START_TABLE_WAIT(locker, &state, m_psi,
+                         PSI_TABLE_DELETE_ROW, MAX_KEY, 0);
 
   error= delete_row(buf);
 


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100726172027-mc9h1qcxafbsx9ii.bundle
Thread
bzr push into mysql-next-mr branch (marc.alff:3168 to 3169) Marc Alff26 Jul