List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:March 19 2011 2:30am
Subject:bzr push into mysql-trunk branch (chris.powers:3259 to 3268) WL#4896
View as plain text  
 3268 Christopher Powers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - Regression test update

    modified:
      mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result
 3267 cpowers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - Regression test update 

    modified:
      mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result
 3266 Christopher Powers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - Regression test updates

    modified:
      mysql-test/suite/perfschema/r/start_server_nothing.result
      storage/perfschema/table_socket_instances.cc
 3265 Christopher Powers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - PSI update

    modified:
      include/mysql/psi/psi_abi_v1.h.pp
      include/mysql/psi/psi_abi_v2.h.pp
 3264 cpowers	2011-03-18 [merge]
      merge

    modified:
      include/mysql/psi/psi_abi_v1.h.pp
 3263 cpowers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - Added "STATE" column to SOCKET_INSTANCES

    modified:
      include/mysql/psi/psi.h
      scripts/mysql_system_tables.sql
      storage/perfschema/table_socket_instances.cc
      storage/perfschema/table_socket_instances.h
 3262 cpowers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      Tables SOCKET_SUMMARY_BY_EVENT_NAME and SOCKET_SUMMARY_BY_INSTANCE:
      Column groups assigned to individual socket operations have been
      removed. Stats for all socket operations are consolidated into
      into socket read, write and misc column groups.

    modified:
      scripts/mysql_system_tables.sql
      storage/perfschema/pfs.cc
      storage/perfschema/table_helper.h
      storage/perfschema/table_socket_summary_by_event_name.cc
      storage/perfschema/table_socket_summary_by_instance.cc
 3261 cpowers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - Added mysql_socket_set_address() API
      - Call mysql_socket_set_address() from network_init() for server socket
      - Added mysql_socket_set_thread_owner() API
      - Call mysql_socket_set_thread_owner() from do_handle_one_connection()
      - Removed unused mysql_socket APIs

    modified:
      include/mysql/psi/mysql_socket.h
      include/mysql/psi/psi.h
      sql/mysqld.cc
      sql/sql_connect.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_global.cc
      storage/perfschema/pfs_global.h
      storage/perfschema/pfs_instr.h
      storage/perfschema/table_socket_instances.cc
 3260 cpowers	2011-03-18
      WL#4896 "Performance Schema Net IO"
      
      - Fix valgrind warnings associated with SOCKET_INSTANCES.THREAD_ID

    modified:
      storage/perfschema/table_socket_instances.cc
      storage/perfschema/table_socket_instances.h
 3259 Marc Alff	2011-03-16
      WL#4896 PERFORMANCE SCHEMA NET IO
      
      Added instrumentation for IDLE events.

    added:
      include/mysql/psi/mysql_idle.h
    modified:
      include/mysql/psi/mysql_socket.h
      include/mysql/psi/psi.h
      include/mysql/psi/psi_abi_v1.h.pp
      include/mysql/psi/psi_abi_v2.h.pp
      mysql-test/suite/perfschema/include/start_server_common.inc
      mysql-test/suite/perfschema/r/dml_setup_timers.result
      mysql-test/suite/perfschema/r/information_schema.result
      mysql-test/suite/perfschema/r/ortho_iter.result
      mysql-test/suite/perfschema/r/query_cache.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_setup_actors.result
      mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
      mysql-test/suite/perfschema/r/start_server_no_socket_class.result
      mysql-test/suite/perfschema/r/start_server_no_socket_inst.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_no_thread_class.result
      mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
      mysql-test/suite/perfschema/r/start_server_nothing.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_setup_timers.test
      mysql-test/suite/perfschema/t/ortho_iter.test
      sql/sql_parse.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_column_types.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_timer.cc
      storage/perfschema/pfs_timer.h
      storage/perfschema/pfs_visitor.cc
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_ews_by_thread_by_event_name.cc
      storage/perfschema/table_ews_global_by_event_name.cc
      storage/perfschema/table_ews_global_by_event_name.h
      storage/perfschema/table_helper.h
      storage/perfschema/table_setup_instruments.cc
      storage/perfschema/table_setup_instruments.h
      storage/perfschema/table_setup_timers.cc
=== modified file 'include/mysql/psi/mysql_socket.h'
--- a/include/mysql/psi/mysql_socket.h	2011-03-16 15:36:35 +0000
+++ b/include/mysql/psi/mysql_socket.h	2011-03-18 22:24:30 +0000
@@ -103,6 +103,40 @@ mysql_socket_set_state(MYSQL_SOCKET sock
 }
 
 /**
+  @def mysql_socket_set_address
+  Set socket descriptor and address.
+  @param socket nstrumented socket
+  @param fd socket descriptor
+  @param addr unformatted socket address
+  @param adr_len length of socket addres
+*/ 
+static inline void
+mysql_socket_set_address(MYSQL_SOCKET socket,
+                         const struct sockaddr *addr,
+                         socklen_t addr_len)
+{
+#ifdef HAVE_PSI_INTERFACE
+  if (likely(PSI_server != NULL && socket.m_psi != NULL))
+    PSI_server->set_socket_info(socket.m_psi, NULL, addr, addr_len);
+#endif
+}
+
+/**
+  @def mysql_socket_set_address
+  Set socket descriptor and address.
+  @param socket instrumented socket
+  @param thread instrumented owning thread
+*/ 
+static inline void
+mysql_socket_set_thread_owner(MYSQL_SOCKET socket)
+{
+#ifdef HAVE_PSI_INTERFACE
+  if (likely(PSI_server != NULL && socket.m_psi != NULL))
+    PSI_server->set_socket_thread_owner(socket.m_psi);
+#endif
+}
+
+/**
   @def mysql_socket_getfd
   MYSQL_SOCKET helper. Get socket descriptor.
   @param mysql_socket Instrumented socket
@@ -341,17 +375,6 @@ inline_mysql_end_socket_wait(struct PSI_
     inline_mysql_socket_shutdown(FD, H)
 #endif
 
-/** Not supported by P_S */
-#if 0
-  #ifdef HAVE_PSI_INTERFACE
-    #define mysql_socket_accept4(K, FD, A, LP, FL) \
-      inline_mysql_socket_accept4(K, __FILE__, __LINE__, FD, A, LP, FL)
-  #else
-    #define mysql_socket_accept4(FD, A, LP, FL) \
-      inline_mysql_socket_accept4(FD, A, LP, FL)
-  #endif
-#endif
-
 /** Not supported by Winsock */
 #ifdef __WIN__
 
@@ -412,10 +435,11 @@ inline_mysql_socket_socket
 
 #ifdef HAVE_PSI_INTERFACE
   mysql_socket.m_psi = PSI_server ?
-                       PSI_server->init_socket(key, &mysql_socket.fd) : NULL;
+                       PSI_server->init_socket(key,
+                       (const my_socket*)&mysql_socket.fd) : NULL;
 
   if (likely(PSI_server != NULL && mysql_socket.m_psi != NULL
-             && mysql_socket.fd != -1))
+             && mysql_socket.fd != INVALID_SOCKET))
     PSI_server->set_socket_info(mysql_socket.m_psi, &mysql_socket.fd, NULL, 0);
 #endif
   return mysql_socket;
@@ -447,8 +471,9 @@ inline_mysql_socket_bind
   result= bind(mysql_socket.fd, addr, len);
 
 #ifdef HAVE_PSI_INTERFACE
-  if (likely(PSI_server != NULL && result == 0))
-    PSI_server->set_socket_address(mysql_socket.m_psi, addr, len);
+  if (likely(PSI_server != NULL && mysql_socket.m_psi != NULL
+             && result == 0))
+    PSI_server->set_socket_info(mysql_socket.m_psi, NULL, addr, len);
 
   if (likely(locker != NULL))
     PSI_server->end_socket_wait(locker, (size_t)0);
@@ -801,6 +826,7 @@ inline_mysql_socket_accept
   MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
 {
   MYSQL_SOCKET socket_accept = MYSQL_INVALID_SOCKET;
+  socklen_t addr_length= (addr_len != NULL) ? *addr_len : 0;
 
   socket_accept.fd= accept(socket_listen.fd, addr, addr_len);
 
@@ -810,9 +836,9 @@ inline_mysql_socket_accept
           PSI_server->init_socket(key, (const my_socket*)&socket_accept.fd) : NULL;
 
   if (likely(PSI_server != NULL && socket_accept.m_psi != NULL
-             && socket_accept.fd != -1))
+             && socket_accept.fd != INVALID_SOCKET))
     PSI_server->set_socket_info(socket_accept.m_psi, &socket_accept.fd,
-                                addr, addr_len);
+                                addr, addr_length);
 #endif
   return socket_accept;
 }
@@ -881,53 +907,6 @@ inline_mysql_socket_shutdown
   return result;
 }
 
-/** Not supported by P_S */
-
-#if 0
-
-/** mysql_socket_accept4 */
-
-  static inline MYSQL_SOCKET
-  inline_mysql_socket_accept4
-  (
-  #ifdef HAVE_PSI_INTERFACE
-    PSI_socket_key key, const char *src_file, uint src_line,
-  #endif
-   MYSQL_SOCKET socket_listen,  const struct sockaddr *addr, socklen_t *addr_len, int flags)
-  {
-    MYSQL_SOCKET socket_accept = {0, NULL};
-  #ifdef HAVE_PSI_INTERFACE
-    struct PSI_socket_locker *locker= NULL;
-    PSI_socket_locker_state state;
-
-    socket_accept.m_psi = PSI_server ? PSI_server->init_socket(key, NULL)// &socket_accept.fd) // TBD: check this
-                                     : NULL;
-    if (likely(PSI_server != NULL && socket_accept.m_psi != NULL))
-    {
-      locker= PSI_server->get_thread_socket_locker(socket_accept.m_psi,
-                                                   PSI_SOCKET_CONNECT);
-      if (likely(locker !=NULL))
-        PSI_server->start_socket_wait(locker, (size_t)0, src_file, src_line);
-    }
-  #endif
-    
-    socket_accept.fd= accept4(socket_listen.fd, addr, addr_len, flags);
-  
-  #ifdef HAVE_PSI_INTERFACE
-    /** Set socket address info */
-    if (likely(PSI_server != NULL && socket_accept.m_psi != NULL
-        && socket_accept.fd != -1))
-      PSI_server->set_socket_info(socket_accept.m_psi, &socket_accept.fd, addr,
-                                  addr_len);
-    if (likely(locker != NULL))
-      PSI_server->end_socket_wait(locker, (size_t)0);
-  #endif
-    return socket_accept;
-  }
-
-#endif // unsupported
-
-
 /** Not supported by Winsock */
 
 #ifndef __WIN__
@@ -1058,10 +1037,11 @@ inline_mysql_socket_socketpair
   mysql_socket[1].fd = fds[1];
 
 #ifdef HAVE_PSI_INTERFACE
-  if (likely(mysql_socket[0].m_psi != NULL && mysql_socket[1].m_psi != NULL))
+  if (likely(PSI_server != NULL && mysql_socket[0].m_psi != NULL
+             && mysql_socket[1].m_psi != NULL))
   {
-    PSI_server->set_socket_descriptor(mysql_socket[0].m_psi, fds[0]);
-    PSI_server->set_socket_descriptor(mysql_socket[1].m_psi, fds[1]);
+    PSI_server->set_socket_info(mysql_socket[0].m_psi, &fds[0], NULL, 0);
+    PSI_server->set_socket_info(mysql_socket[1].m_psi, &fds[1], NULL, 0);
   }
 #endif
   return result;

=== modified file 'include/mysql/psi/psi.h'
--- a/include/mysql/psi/psi.h	2011-03-16 15:36:35 +0000
+++ b/include/mysql/psi/psi.h	2011-03-19 01:36:46 +0000
@@ -275,9 +275,9 @@ enum PSI_table_lock_operation
 enum PSI_socket_state
 {
   /** Idle, waiting for the next command. */
-  PSI_SOCKET_STATE_IDLE= 0,
+  PSI_SOCKET_STATE_IDLE= 1,
   /** Active, executing a command. */
-  PSI_SOCKET_STATE_ACTIVE= 1
+  PSI_SOCKET_STATE_ACTIVE= 2
 };
 
 /** Operation performed on an instrumented socket. */
@@ -1349,42 +1349,23 @@ typedef void (*set_socket_state_v1_t)(st
                                       enum PSI_socket_state state);
 
 /**
-  Set the socket descriptor for an instrumented socket.
-    @param socket the instrumented socket
-    @param fd socket descriptor
-  */
-typedef void (*set_socket_descriptor_v1_t)(struct PSI_socket *socket,
-                                             uint fd);
-
-/**
-  Set the socket address for an instrumented socket.
-    @param socket the instrumented socket
-    @param addr socket address information
-  */
-typedef void (*set_socket_address_v1_t)(struct PSI_socket *socket,
-                                        const struct sockaddr * addr,
-                                        socklen_t addr_len);
-
-/**
   Set the socket info for an instrumented socket.
-    @param socket the instrumented socket
-    @param fd the socket descriptor
-    @param addr the socket ip address
-    @param addr_len length of socket ip address
-    @param thread_id associated thread id
+  @param socket the instrumented socket
+  @param fd the socket descriptor
+  @param addr the socket ip address
+  @param addr_len length of socket ip address
+  @param thread_id associated thread id
 */
 typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket,
-                                     my_socket *fd,
+                                     const my_socket *fd,
                                      const struct sockaddr *addr,
-                                     socklen_t *addr_len);
+                                     socklen_t addr_len);
 
 /**
-  Set the id of the thread owning the socket.
+  Bind a socket to the thread that owns it.
   @param socket instrumented socket
-  @param thread instrumented thread
 */
-typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket,
-                                             struct PSI_thread *thread);
+typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);
 
 /**
   Performance Schema Interface, version 1.
@@ -1531,10 +1512,6 @@ struct PSI_v1
   end_socket_wait_v1_t end_socket_wait;
   /** @sa set_socket_state_v1_t. */
   set_socket_state_v1_t set_socket_state;
-  /** @sa set_socket_descriptor_v1_t. */
-  set_socket_descriptor_v1_t set_socket_descriptor;
-  /** @sa set_socket_address_v1_t. */
-  set_socket_address_v1_t set_socket_address;
   /** @sa set_socket_info_v1_t. */
   set_socket_info_v1_t set_socket_info;
   /** @sa set_socket_thread_owner_v1_t. */

=== modified file 'include/mysql/psi/psi_abi_v1.h.pp'
--- a/include/mysql/psi/psi_abi_v1.h.pp	2011-03-16 15:36:35 +0000
+++ b/include/mysql/psi/psi_abi_v1.h.pp	2011-03-19 01:46:46 +0000
@@ -70,8 +70,8 @@ enum PSI_table_lock_operation
 };
 enum PSI_socket_state
 {
-  PSI_SOCKET_STATE_IDLE= 0,
-  PSI_SOCKET_STATE_ACTIVE= 1
+  PSI_SOCKET_STATE_IDLE= 1,
+  PSI_SOCKET_STATE_ACTIVE= 2
 };
 enum PSI_socket_operation
 {
@@ -354,17 +354,11 @@ typedef void (*end_socket_wait_v1_t)
   (struct PSI_socket_locker *locker, size_t count);
 typedef void (*set_socket_state_v1_t)(struct PSI_socket *socket,
                                       enum PSI_socket_state state);
-typedef void (*set_socket_descriptor_v1_t)(struct PSI_socket *socket,
-                                             uint fd);
-typedef void (*set_socket_address_v1_t)(struct PSI_socket *socket,
-                                        const struct sockaddr * addr,
-                                        socklen_t addr_len);
 typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket,
-                                     my_socket *fd,
+                                     const my_socket *fd,
                                      const struct sockaddr *addr,
-                                     socklen_t *addr_len);
-typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket,
-                                             struct PSI_thread *thread);
+                                     socklen_t addr_len);
+typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);
 struct PSI_v1
 {
   register_mutex_v1_t register_mutex;
@@ -437,8 +431,6 @@ struct PSI_v1
   start_socket_wait_v1_t start_socket_wait;
   end_socket_wait_v1_t end_socket_wait;
   set_socket_state_v1_t set_socket_state;
-  set_socket_descriptor_v1_t set_socket_descriptor;
-  set_socket_address_v1_t set_socket_address;
   set_socket_info_v1_t set_socket_info;
   set_socket_thread_owner_v1_t set_socket_thread_owner;
 };

=== modified file 'include/mysql/psi/psi_abi_v2.h.pp'
--- a/include/mysql/psi/psi_abi_v2.h.pp	2011-03-16 15:36:35 +0000
+++ b/include/mysql/psi/psi_abi_v2.h.pp	2011-03-19 01:46:46 +0000
@@ -70,8 +70,8 @@ enum PSI_table_lock_operation
 };
 enum PSI_socket_state
 {
-  PSI_SOCKET_STATE_IDLE= 0,
-  PSI_SOCKET_STATE_ACTIVE= 1
+  PSI_SOCKET_STATE_IDLE= 1,
+  PSI_SOCKET_STATE_ACTIVE= 2
 };
 enum PSI_socket_operation
 {

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2011-03-11 20:17:01 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2011-03-19 02:29:24 +0000
@@ -18,23 +18,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -57,23 +57,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -94,23 +94,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -131,23 +131,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -168,23 +168,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2011-03-11 20:14:48 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2011-03-19 02:27:26 +0000
@@ -18,23 +18,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -57,23 +57,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -94,23 +94,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -131,23 +131,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -168,23 +168,23 @@ ERROR 1050 (42S01) at line 177: Table 'e
 ERROR 1050 (42S01) at line 186: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 197: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 209: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 221: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 353: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 362: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 376: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 386: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 396: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 405: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 413: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 422: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 432: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 440: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 485: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 529: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 608: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 628: Table 'threads' already exists
-ERROR 1644 (HY000) at line 1048: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 222: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 253: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 282: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 291: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 305: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 315: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 325: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 334: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 342: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 351: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 361: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 369: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 458: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 537: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 557: Table 'threads' already exists
+ERROR 1644 (HY000) at line 977: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/start_server_nothing.result'
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result	2011-03-16 15:36:35 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result	2011-03-19 02:22:58 +0000
@@ -136,11 +136,11 @@ EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NU
 select * from performance_schema.file_summary_by_instance;
 FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
 select * from performance_schema.socket_instances;
-EVENT_NAME	OBJECT_INSTANCE_BEGIN	THREAD_ID	SOCKET_ID	IP	PORT
+EVENT_NAME	OBJECT_INSTANCE_BEGIN	THREAD_ID	SOCKET_ID	IP	PORT	STATE
 select * from performance_schema.socket_summary_by_instance;
-EVENT_NAME	OBJECT_INSTANCE_BEGIN	OBJECT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_RECV	SUM_TIMER_RECV	MIN_TIMER_RECV	AVG_TIMER_RECV	MAX_TIMER_RECV	SUM_NUMBER_OF_BYTES_RECV	COUNT_SEND	SUM_TIMER_SEND	MIN_TIMER_SEND	AVG_TIMER_SEND	MAX_TIMER_SEND	SUM_NUMBER_OF_BYTES_SEND	COUNT_RECVFROM	SUM_TIMER_RECVFROM	MIN_TIMER_RECVFROM	AVG_TIMER_RECVFROM	MAX_TIMER_RECVFROM	SUM_NUMBER_OF_BYTES_RECVFROM	COUNT_SENDTO	SUM_TIMER_SENDTO	MIN_TIMER_SENDTO	AVG_TIMER_SENDTO	MAX_TIMER_SENDTO	SUM_NUMBER_OF_BYTES_SENDTO	COUNT_RECVMSG	SUM_TIMER_RECVMSG	MIN_TIMER_RECVMSG	AVG_TIMER_RECVMSG	MAX_TIMER_RECVMSG	SUM_NUMBER_OF_BYTES_RECVMSG	COUNT_SENDMSG	SUM_TIMER_SENDMSG	MIN_TIMER_SENDMSG	AVG_TIMER_SENDMSG	MAX_TIMER_SENDMSG	SUM_NUMBER_OF_BYTES_SENDMSG	COUNT_MISC	SUM_TIMER_MISC	M
 IN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
+EVENT_NAME	OBJECT_INSTANCE_BEGIN	OBJECT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 select * from performance_schema.socket_summary_by_event_name;
-EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_RECV	SUM_TIMER_RECV	MIN_TIMER_RECV	AVG_TIMER_RECV	MAX_TIMER_RECV	SUM_NUMBER_OF_BYTES_RECV	COUNT_SEND	SUM_TIMER_SEND	MIN_TIMER_SEND	AVG_TIMER_SEND	MAX_TIMER_SEND	SUM_NUMBER_OF_BYTES_SEND	COUNT_RECVFROM	SUM_TIMER_RECVFROM	MIN_TIMER_RECVFROM	AVG_TIMER_RECVFROM	MAX_TIMER_RECVFROM	SUM_NUMBER_OF_BYTES_RECVFROM	COUNT_SENDTO	SUM_TIMER_SENDTO	MIN_TIMER_SENDTO	AVG_TIMER_SENDTO	MAX_TIMER_SENDTO	SUM_NUMBER_OF_BYTES_SENDTO	COUNT_RECVMSG	SUM_TIMER_RECVMSG	MIN_TIMER_RECVMSG	AVG_TIMER_RECVMSG	MAX_TIMER_RECVMSG	SUM_NUMBER_OF_BYTES_RECVMSG	COUNT_SENDMSG	SUM_TIMER_SENDMSG	MIN_TIMER_SENDMSG	AVG_TIMER_SENDMSG	MAX_TIMER_SENDMSG	SUM_NUMBER_OF_BYTES_SENDMSG	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_T
 IMER_MISC
+EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	COUNT_READ	SUM_TIMER_READ	MIN_TIMER_READ	AVG_TIMER_READ	MAX_TIMER_READ	SUM_NUMBER_OF_BYTES_READ	COUNT_WRITE	SUM_TIMER_WRITE	MIN_TIMER_WRITE	AVG_TIMER_WRITE	MAX_TIMER_WRITE	SUM_NUMBER_OF_BYTES_WRITE	COUNT_MISC	SUM_TIMER_MISC	MIN_TIMER_MISC	AVG_TIMER_MISC	MAX_TIMER_MISC
 select * from performance_schema.mutex_instances;
 NAME	OBJECT_INSTANCE_BEGIN	LOCKED_BY_THREAD_ID
 select * from performance_schema.threads;

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2011-03-16 08:58:26 +0000
+++ b/scripts/mysql_system_tables.sql	2011-03-19 01:36:46 +0000
@@ -383,10 +383,11 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.socket_instances("
   "EVENT_NAME VARCHAR(128) not null,"
   "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null,"
-  "THREAD_ID INTEGER not null,"
+  "THREAD_ID INTEGER,"
   "SOCKET_ID INTEGER not null,"
   "IP VARCHAR(64) not null,"
-  "PORT INTEGER not null"
+  "PORT INTEGER not null,"
+  "STATE ENUM('IDLE','ACTIVE') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
@@ -419,42 +420,6 @@ SET @cmd="CREATE TABLE performance_schem
   "AVG_TIMER_WRITE BIGINT unsigned not null,"
   "MAX_TIMER_WRITE BIGINT unsigned not null,"
   "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
-  "COUNT_RECV BIGINT unsigned not null,"
-  "SUM_TIMER_RECV BIGINT unsigned not null,"
-  "MIN_TIMER_RECV BIGINT unsigned not null,"
-  "AVG_TIMER_RECV BIGINT unsigned not null,"
-  "MAX_TIMER_RECV BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_RECV BIGINT unsigned not null,"
-  "COUNT_SEND BIGINT unsigned not null,"
-  "SUM_TIMER_SEND BIGINT unsigned not null,"
-  "MIN_TIMER_SEND BIGINT unsigned not null,"
-  "AVG_TIMER_SEND BIGINT unsigned not null,"
-  "MAX_TIMER_SEND BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_SEND BIGINT unsigned not null,"
-  "COUNT_RECVFROM BIGINT unsigned not null,"
-  "SUM_TIMER_RECVFROM BIGINT unsigned not null,"
-  "MIN_TIMER_RECVFROM BIGINT unsigned not null,"
-  "AVG_TIMER_RECVFROM BIGINT unsigned not null,"
-  "MAX_TIMER_RECVFROM BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_RECVFROM BIGINT unsigned not null,"
-  "COUNT_SENDTO BIGINT unsigned not null,"
-  "SUM_TIMER_SENDTO BIGINT unsigned not null,"
-  "MIN_TIMER_SENDTO BIGINT unsigned not null,"
-  "AVG_TIMER_SENDTO BIGINT unsigned not null,"
-  "MAX_TIMER_SENDTO BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_SENDTO BIGINT unsigned not null,"
-  "COUNT_RECVMSG BIGINT unsigned not null,"
-  "SUM_TIMER_RECVMSG BIGINT unsigned not null,"
-  "MIN_TIMER_RECVMSG BIGINT unsigned not null,"
-  "AVG_TIMER_RECVMSG BIGINT unsigned not null,"
-  "MAX_TIMER_RECVMSG BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_RECVMSG BIGINT unsigned not null,"
-  "COUNT_SENDMSG BIGINT unsigned not null,"
-  "SUM_TIMER_SENDMSG BIGINT unsigned not null,"
-  "MIN_TIMER_SENDMSG BIGINT unsigned not null,"
-  "AVG_TIMER_SENDMSG BIGINT unsigned not null,"
-  "MAX_TIMER_SENDMSG BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_SENDMSG BIGINT unsigned not null,"
   "COUNT_MISC BIGINT unsigned not null,"
   "SUM_TIMER_MISC BIGINT unsigned not null,"
   "MIN_TIMER_MISC BIGINT unsigned not null,"
@@ -490,42 +455,6 @@ SET @cmd="CREATE TABLE performance_schem
   "AVG_TIMER_WRITE BIGINT unsigned not null,"
   "MAX_TIMER_WRITE BIGINT unsigned not null,"
   "SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null,"
-  "COUNT_RECV BIGINT unsigned not null,"
-  "SUM_TIMER_RECV BIGINT unsigned not null,"
-  "MIN_TIMER_RECV BIGINT unsigned not null,"
-  "AVG_TIMER_RECV BIGINT unsigned not null,"
-  "MAX_TIMER_RECV BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_RECV BIGINT unsigned not null,"
-  "COUNT_SEND BIGINT unsigned not null,"
-  "SUM_TIMER_SEND BIGINT unsigned not null,"
-  "MIN_TIMER_SEND BIGINT unsigned not null,"
-  "AVG_TIMER_SEND BIGINT unsigned not null,"
-  "MAX_TIMER_SEND BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_SEND BIGINT unsigned not null,"
-  "COUNT_RECVFROM BIGINT unsigned not null,"
-  "SUM_TIMER_RECVFROM BIGINT unsigned not null,"
-  "MIN_TIMER_RECVFROM BIGINT unsigned not null,"
-  "AVG_TIMER_RECVFROM BIGINT unsigned not null,"
-  "MAX_TIMER_RECVFROM BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_RECVFROM BIGINT unsigned not null,"
-  "COUNT_SENDTO BIGINT unsigned not null,"
-  "SUM_TIMER_SENDTO BIGINT unsigned not null,"
-  "MIN_TIMER_SENDTO BIGINT unsigned not null,"
-  "AVG_TIMER_SENDTO BIGINT unsigned not null,"
-  "MAX_TIMER_SENDTO BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_SENDTO BIGINT unsigned not null,"
-  "COUNT_RECVMSG BIGINT unsigned not null,"
-  "SUM_TIMER_RECVMSG BIGINT unsigned not null,"
-  "MIN_TIMER_RECVMSG BIGINT unsigned not null,"
-  "AVG_TIMER_RECVMSG BIGINT unsigned not null,"
-  "MAX_TIMER_RECVMSG BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_RECVMSG BIGINT unsigned not null,"
-  "COUNT_SENDMSG BIGINT unsigned not null,"
-  "SUM_TIMER_SENDMSG BIGINT unsigned not null,"
-  "MIN_TIMER_SENDMSG BIGINT unsigned not null,"
-  "AVG_TIMER_SENDMSG BIGINT unsigned not null,"
-  "MAX_TIMER_SENDMSG BIGINT unsigned not null,"
-  "SUM_NUMBER_OF_BYTES_SENDMSG BIGINT unsigned not null,"
   "COUNT_MISC BIGINT unsigned not null,"
   "SUM_TIMER_MISC BIGINT unsigned not null,"
   "MIN_TIMER_MISC BIGINT unsigned not null,"

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2011-03-16 08:58:26 +0000
+++ b/sql/mysqld.cc	2011-03-18 22:24:30 +0000
@@ -1819,7 +1819,11 @@ static void network_init(void)
     {
       ip_sock= mysql_socket_socket(key_socket_tcpip, a->ai_family, a->ai_socktype, a->ai_protocol);
       if (mysql_socket_getfd(ip_sock) != INVALID_SOCKET)
+      {
+        mysql_socket_set_address(ip_sock, a->ai_addr, a->ai_addrlen); //TBD: Refine api?
         break;
+      }
+
     }
 
     if (mysql_socket_getfd(ip_sock) == INVALID_SOCKET)

=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc	2011-02-18 13:25:36 +0000
+++ b/sql/sql_connect.cc	2011-03-18 22:24:30 +0000
@@ -764,6 +764,8 @@ void do_handle_one_connection(THD *thd_a
 
     prepare_new_connection_state(thd);
 
+    mysql_socket_set_thread_owner(net->vio->mysql_socket);
+
     while (!net->error && net->vio != 0 &&
            !(thd->killed == THD::KILL_CONNECTION))
     {

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-03-16 15:36:35 +0000
+++ b/storage/perfschema/pfs.cc	2011-03-18 23:37:18 +0000
@@ -3787,26 +3787,19 @@ static void end_socket_wait_v1(PSI_socke
 
   switch (state->m_operation)
   {
+  /** Group read operations */
   case PSI_SOCKET_RECV:
+  case PSI_SOCKET_RECVFROM:
+  case PSI_SOCKET_RECVMSG:
     byte_stat= &socket->m_socket_stat.m_io_stat.m_recv;
     break;
+  /** Group write operations */
   case PSI_SOCKET_SEND:
-    byte_stat= &socket->m_socket_stat.m_io_stat.m_send;
-    break;
-  case PSI_SOCKET_RECVFROM:
-    byte_stat= &socket->m_socket_stat.m_io_stat.m_recvfrom;
-    break;
   case PSI_SOCKET_SENDTO:
-    byte_stat= &socket->m_socket_stat.m_io_stat.m_sendto;
-    break;
-  case PSI_SOCKET_RECVMSG:
-    byte_stat= &socket->m_socket_stat.m_io_stat.m_recvmsg;
-    break;
   case PSI_SOCKET_SENDMSG:
-    byte_stat= &socket->m_socket_stat.m_io_stat.m_sendmsg;
+    byte_stat= &socket->m_socket_stat.m_io_stat.m_send;
     break;
-
-  /** These operations are grouped as 'miscellaneous' */
+  /** Group remainging operations as miscellaneous */
   case PSI_SOCKET_CONNECT:
   case PSI_SOCKET_CREATE:
   case PSI_SOCKET_BIND:
@@ -3895,76 +3888,31 @@ static void set_socket_state_v1(PSI_sock
   pfs->m_idle= (state == PSI_SOCKET_STATE_IDLE);
 }
 
-static void set_socket_descriptor_v1(PSI_socket *socket, uint fd)
-{
-  DBUG_ASSERT(socket);
-  PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket);
-  pfs->m_fd= fd;
-}
-
-
-static void set_socket_address_v1(PSI_socket *socket,
-                                  const struct sockaddr *addr,
-                                  socklen_t addr_len)
-{
-#if 0
-  DBUG_ASSERT(socket);
-  PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket);
-
-  memset(pfs->m_ip, 0, pfs->m_ip_length);
-
-  switch (addr->sa_family)
-  {
-    case AF_INET:
-    {
-      struct sockaddr_in *sa4= (struct sockaddr_in *)(addr);
-      pfs->m_ip_length= INET_ADDRSTRLEN;
-      inet_ntop(AF_INET, &(sa4->sin_addr), pfs->m_ip, pfs->m_ip_length);
-      pfs->m_port= ntohs(sa4->sin_port);
-    }
-    break;
-
-    case AF_INET6:
-    {
-      struct sockaddr_in6 *sa6= (struct sockaddr_in6 *)(addr);
-      pfs->m_ip_length= INET6_ADDRSTRLEN;
-      inet_ntop(AF_INET6, &(sa6->sin6_addr), pfs->m_ip, pfs->m_ip_length);
-      pfs->m_port= ntohs(sa6->sin6_port);
-    }
-    break;
-
-    default:
-      break;
-  }
-
-  /* Adjust IP address string length */
-  pfs->m_ip_length= strlen((const char*)pfs->m_ip);
-#endif
-}
-
+/**
+  Set socket descriptor and addres info.
+*/
 static void set_socket_info_v1(PSI_socket *socket,
-                               my_socket *fd,
+                               const my_socket *fd,
                                const struct sockaddr *addr,
-                               socklen_t *addr_len)
+                               socklen_t addr_len)
 {
   DBUG_ASSERT(socket);
   PFS_socket *pfs= reinterpret_cast<PFS_socket*>(socket);
 
   /** Set socket descriptor */
-  if (likely(fd != NULL))
+  if (fd != NULL)
     pfs->m_fd= *fd;
 
   /** Set raw socket address and length */
-  if (likely(addr != NULL && addr_len != NULL))
+  if (likely(addr != NULL && addr_len > 0))
   {
-    pfs->m_sock_len= *addr_len;
+    pfs->m_addr_len= addr_len;
   
     /** Restrict address length to size of struct */
-    if (unlikely(pfs->m_sock_len > sizeof(struct sockaddr)))
-      pfs->m_sock_len= sizeof(struct sockaddr);
+    if (unlikely(pfs->m_addr_len > sizeof(struct sockaddr)))
+      pfs->m_addr_len= sizeof(struct sockaddr);
   
-    if (likely(pfs->m_sock_len > 0))
-      memcpy(&pfs->m_sock_addr, addr, pfs->m_sock_len);
+    memcpy(&pfs->m_sock_addr, addr, pfs->m_addr_len);
   }
 }
 
@@ -3972,9 +3920,9 @@ static void set_socket_info_v1(PSI_socke
   Implementation of the socket instrumentation interface.
   @sa PSI_v1::set_socket_info.
 */
-static void set_socket_thread_owner_v1(PSI_socket *socket, PSI_thread *thread)
+static void set_socket_thread_owner_v1(PSI_socket *socket)
 {
-  if (likely(socket != NULL && thread != NULL))
+  if (likely(socket != NULL))
   {
     PFS_socket *pfs_socket= reinterpret_cast<PFS_socket*>(socket);
     pfs_socket->m_thread_owner= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
@@ -4056,8 +4004,6 @@ PSI_v1 PFS_v1=
   start_socket_wait_v1,
   end_socket_wait_v1,
   set_socket_state_v1,
-  set_socket_descriptor_v1,
-  set_socket_address_v1,
   set_socket_info_v1,
   set_socket_thread_owner_v1
 };

=== modified file 'storage/perfschema/pfs_global.cc'
--- a/storage/perfschema/pfs_global.cc	2011-03-09 21:28:05 +0000
+++ b/storage/perfschema/pfs_global.cc	2011-03-18 22:24:30 +0000
@@ -107,7 +107,7 @@ const char *inet_ntop(int af, const void
 
 /** Convert raw ip address into readable format */ // TBD: review this
 
-uint pfs_set_socket_address(char *host,
+uint pfs_get_socket_address(char *host,
                             uint host_len,
                             uint *port,
                             const struct sockaddr *src_addr,

=== modified file 'storage/perfschema/pfs_global.h'
--- a/storage/perfschema/pfs_global.h	2011-03-09 21:28:05 +0000
+++ b/storage/perfschema/pfs_global.h	2011-03-18 22:24:30 +0000
@@ -29,7 +29,7 @@ void *pfs_malloc(size_t size, myf flags)
   reinterpret_cast<T*> (pfs_malloc((n) * sizeof(T), (f)))
 void pfs_free(void *ptr);
 
-uint pfs_set_socket_address(char *host,
+uint pfs_get_socket_address(char *host,
                             uint host_len,
                             uint *port,
                             const struct sockaddr *src_addr,

=== modified file 'storage/perfschema/pfs_instr.h'
--- a/storage/perfschema/pfs_instr.h	2011-03-16 15:36:35 +0000
+++ b/storage/perfschema/pfs_instr.h	2011-03-18 22:24:30 +0000
@@ -209,7 +209,7 @@ struct PFS_socket : public PFS_instr
   /** Raw socket address */
   struct sockaddr m_sock_addr;
   /** Length of address */
-  socklen_t m_sock_len;
+  socklen_t m_addr_len;
   /** Socket ip address, IPV4 or IPV6 */ // TBD: Remove?
   char m_ip[INET6_ADDRSTRLEN];
   /** Socket ip address length in bytes */

=== modified file 'storage/perfschema/table_helper.h'
--- a/storage/perfschema/table_helper.h	2011-03-16 15:36:35 +0000
+++ b/storage/perfschema/table_helper.h	2011-03-18 23:37:18 +0000
@@ -316,49 +316,22 @@ struct PFS_socket_io_stat_row
 {
   PFS_byte_stat_row m_recv;
   PFS_byte_stat_row m_send;
-  PFS_byte_stat_row m_recvfrom;
-  PFS_byte_stat_row m_sendto;
-  PFS_byte_stat_row m_recvmsg;
-  PFS_byte_stat_row m_sendmsg;
   PFS_byte_stat_row m_misc;
-  PFS_byte_stat_row m_all_read;
-  PFS_byte_stat_row m_all_write;
   PFS_byte_stat_row m_all;
 
   inline void set(time_normalizer *normalizer, const PFS_socket_io_stat *stat)
   {
-    PFS_byte_stat all_read;
-    PFS_byte_stat all_write;
     PFS_byte_stat all;
 
-    /* Combine receive operations */
     m_recv.set(normalizer, &stat->m_recv);
-    m_recvfrom.set(normalizer, &stat->m_recvfrom);
-    m_recvmsg.set(normalizer, &stat->m_recvmsg);
-
-    all_read.aggregate(&stat->m_recv);
-    all_read.aggregate(&stat->m_recvfrom);
-    all_read.aggregate(&stat->m_recvmsg);
-
-    /* Combine send operations */
     m_send.set(normalizer, &stat->m_send);
-    m_sendto.set(normalizer, &stat->m_sendto);
-    m_sendmsg.set(normalizer, &stat->m_sendmsg);
-
-    all_write.aggregate(&stat->m_send);
-    all_write.aggregate(&stat->m_sendto);
-    all_write.aggregate(&stat->m_sendmsg);
-
-    /* Combine row values for miscellaneous socket operations */
     m_misc.set(normalizer, &stat->m_misc);
     
-    /* Combine timer stats for all operations */
-    all.aggregate(&all_read);
-    all.aggregate(&all_write);
+    /* Combine stats for all operations */
+    all.aggregate(&stat->m_recv);
+    all.aggregate(&stat->m_send);
     all.aggregate(&stat->m_misc);
 
-    m_all_read.set(normalizer, &all_read);
-    m_all_write.set(normalizer, &all_write);
     m_all.set(normalizer, &all);
   }
 };

=== modified file 'storage/perfschema/table_socket_instances.cc'
--- a/storage/perfschema/table_socket_instances.cc	2011-03-14 16:11:25 +0000
+++ b/storage/perfschema/table_socket_instances.cc	2011-03-19 02:22:58 +0000
@@ -59,12 +59,17 @@ static const TABLE_FIELD_TYPE field_type
     { C_STRING_WITH_LEN("PORT") },
     { C_STRING_WITH_LEN("int(11)") },
     { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("STATE") },
+    { C_STRING_WITH_LEN("enum('IDLE','ACTIVE')") },
+    { NULL, 0}
   }
 };
 
 TABLE_FIELD_DEF
 table_socket_instances::m_field_def=
-{ 6, field_types };
+{ 7, field_types };
 
 PFS_engine_table_share
 table_socket_instances::m_share=
@@ -148,18 +153,22 @@ void table_socket_instances::make_row(PF
     return;
 
   /** Extract ip address and port from raw address */
-  m_row.m_ip_length= pfs_set_socket_address(m_row.m_ip, sizeof(m_row.m_ip),
+  m_row.m_ip_length= pfs_get_socket_address(m_row.m_ip, sizeof(m_row.m_ip),
                                             &m_row.m_port,
-                                            &pfs->m_sock_addr, pfs->m_sock_len);
+                                            &pfs->m_sock_addr, pfs->m_addr_len);
   m_row.m_event_name=         safe_class->m_name;
   m_row.m_event_name_length=  safe_class->m_name_length;
   m_row.m_identity=           pfs->m_identity;
   m_row.m_fd=                 pfs->m_fd;
-
+  m_row.m_state=              (pfs->m_idle ? PSI_SOCKET_STATE_IDLE
+                                           : PSI_SOCKET_STATE_ACTIVE);
   PFS_thread *safe_thread= sanitize_thread(pfs->m_thread_owner);
 
   if (safe_thread != NULL)
+  {
     m_row.m_thread_id= safe_thread->m_thread_id;
+    m_row.m_thread_id_set= true;
+  }
 
   if (pfs->m_lock.end_optimistic_lock(&lock))
     m_row_exists= true;
@@ -175,9 +184,6 @@ int table_socket_instances::read_row_val
   if (unlikely(!m_row_exists))
     return HA_ERR_RECORD_DELETED;
 
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
   for (; (f= *fields) ; fields++)
   {
     if (read_all || bitmap_is_set(table->read_set, f->field_index))
@@ -191,7 +197,7 @@ int table_socket_instances::read_row_val
         set_field_ulonglong(f, (intptr)m_row.m_identity);
         break;
       case 2: /* THREAD_ID */
-        if (m_row.m_thread_id != 0) // TBD: use flag to indicate valid thread id?
+        if (m_row.m_thread_id_set)
           set_field_ulong(f, m_row.m_thread_id);
         else
           f->set_null();
@@ -205,6 +211,9 @@ int table_socket_instances::read_row_val
       case 5: /* PORT */
         set_field_ulong(f, m_row.m_port);
         break;
+      case 6: /* STATE */
+        set_field_enum(f, m_row.m_state);
+        break;
       default:
         DBUG_ASSERT(false);
       }

=== modified file 'storage/perfschema/table_socket_instances.h'
--- a/storage/perfschema/table_socket_instances.h	2011-03-09 21:28:05 +0000
+++ b/storage/perfschema/table_socket_instances.h	2011-03-19 01:36:46 +0000
@@ -40,6 +40,8 @@ struct row_socket_instances
   const void *m_identity;
   /** Column THREAD_ID */
   uint m_thread_id;
+  /** True if thread_is is set */
+  bool m_thread_id_set;
   /** Column SOCKET_ID */
   uint m_fd;
   /** Socket ip address, IPV4 or IPV6 */
@@ -48,6 +50,10 @@ struct row_socket_instances
   uint m_ip_length;
   /** Column PORT */
   uint m_port;
+  /** Socket state: ACTIVE or IDLE */
+  PSI_socket_state m_state;
+
+  row_socket_instances() {m_thread_id= false;}
 };
 
 /** Table PERFORMANCE_SCHEMA.SOCKET_INSTANCES. */

=== modified file 'storage/perfschema/table_socket_summary_by_event_name.cc'
--- a/storage/perfschema/table_socket_summary_by_event_name.cc	2011-03-09 21:28:05 +0000
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc	2011-03-18 23:37:18 +0000
@@ -126,198 +126,6 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
 
-  /** Recv */
-  {
-    { C_STRING_WITH_LEN("COUNT_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Send */
-  {
-    { C_STRING_WITH_LEN("COUNT_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Recvfrom */
-  {
-    { C_STRING_WITH_LEN("COUNT_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Sendto */
-  {
-    { C_STRING_WITH_LEN("COUNT_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Recvmsg */
-  {
-    { C_STRING_WITH_LEN("COUNT_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Sendmsg */
-  {
-    { C_STRING_WITH_LEN("COUNT_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
   /** Misc */
   {
     { C_STRING_WITH_LEN("COUNT_MISC") },
@@ -348,7 +156,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_socket_summary_by_event_name::m_field_def=
-{ 59, field_types };
+{ 23, field_types };
 
 PFS_engine_table_share
 table_socket_summary_by_event_name::m_share=
@@ -359,7 +167,7 @@ table_socket_summary_by_event_name::m_sh
   NULL, /* write_row */
   table_socket_summary_by_event_name::delete_all_rows,
   NULL, /* get_row_count */
-  1000, /* records */ // TBD: Check this
+  1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
   &m_field_def,
@@ -475,170 +283,56 @@ int table_socket_summary_by_event_name::
         break;
 
       case  6: /* COUNT_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_count);
-        break;
-      case  7: /* SUM_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_sum);
-        break;
-      case  8: /* MIN_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_min);
-        break;
-      case  9: /* AVG_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_avg);
-        break;
-      case 10: /* MAX_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_max);
-        break;
-      case 11: /* SUM_NUMBER_OF_BYTES_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_bytes);
-        break;
-
-      case 12: /* COUNT_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_count);
-        break;
-      case 13: /* SUM_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_sum);
-        break;
-      case 14: /* MIN_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_min);
-        break;
-      case 15: /* AVG_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_avg);
-        break;
-      case 16: /* MAX_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_max);
-        break;
-      case 17: /* SUM_NUMBER_OF_BYTES_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_bytes);
-        break;
-
-      case 18: /* COUNT_RECV */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_count);
         break;
-      case 19: /* SUM_TIMER_RECV */
+      case  7: /* SUM_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_sum);
         break;
-      case 20: /* MIN_TIMER_RECV */
+      case  8: /* MIN_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_min);
         break;
-      case 21: /* AVG_TIMER_RECV */
+      case  9: /* AVG_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_avg);
         break;
-      case 22: /* MAX_TIMER_RECV */
+      case 10: /* MAX_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_max);
         break;
-      case 23: /* SUM_NUMBER_OF_BYTES_RECV */
+      case 11: /* SUM_NUMBER_OF_BYTES_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_bytes);
         break;
 
-      case 24: /* COUNT_SEND */
+      case 12: /* COUNT_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_count);
         break;
-      case 25: /* SUM_TIMER_SEND */
+      case 13: /* SUM_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_sum);
         break;
-      case 26: /* MIN_TIMER_SEND */
+      case 14: /* MIN_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_min);
         break;
-      case 27: /* AVG_TIMER_SEND */
+      case 15: /* AVG_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_avg);
         break;
-      case 28: /* MAX_TIMER_SEND */
+      case 16: /* MAX_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_max);
         break;
-      case 29: /* SUM_NUMBER_OF_BYTES_SEND */
+      case 17: /* SUM_NUMBER_OF_BYTES_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_bytes);
         break;
 
-      case 30: /* COUNT_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_count);
-        break;
-      case 31: /* SUM_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_sum);
-        break;
-      case 32: /* MIN_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_min);
-        break;
-      case 33: /* AVG_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_avg);
-        break;
-      case 34: /* MAX_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_max);
-        break;
-      case 35: /* SUM_NUMBER_OF_BYTES_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_bytes);
-        break;
-
-      case 36: /* COUNT_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_count);
-        break;
-      case 37: /* SUM_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_sum);
-        break;
-      case 38: /* MIN_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_min);
-        break;
-      case 39: /* AVG_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_avg);
-        break;
-      case 40: /* MAX_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_max);
-        break;
-      case 41: /* SUM_NUMBER_OF_BYTES_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_bytes);
-        break;
-
-      case 42: /* COUNT_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_count);
-        break;
-      case 43: /* SUM_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_sum);
-        break;
-      case 44: /* MIN_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_min);
-        break;
-      case 45: /* AVG_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_avg);
-        break;
-      case 46: /* MAX_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_max);
-        break;
-      case 47: /* SUM_NUMBER_OF_BYTES_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_bytes);
-        break;
-
-      case 48: /* COUNT_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_count);
-        break;
-      case 49: /* SUM_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_sum);
-        break;
-      case 50: /* MIN_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_min);
-        break;
-      case 51: /* AVG_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_avg);
-        break;
-      case 52: /* MAX_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_max);
-        break;
-      case 53: /* SUM_NUMBER_OF_BYTES_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_bytes);
-        break;
-
-      case 54: /* COUNT_MISC */
+      case 18: /* COUNT_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_count);
         break;
-      case 55: /* SUM_TIMER_MISC */
+      case 19: /* SUM_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_sum);
         break;
-      case 56: /* MIN_TIMER_MISC */
+      case 20: /* MIN_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_min);
         break;
-      case 57: /* AVG_TIMER_MISC */
+      case 21: /* AVG_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_avg);
         break;
-      case 58: /* MAX_TIMER_MISC */
+      case 22: /* MAX_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max);
         break;
 

=== modified file 'storage/perfschema/table_socket_summary_by_instance.cc'
--- a/storage/perfschema/table_socket_summary_by_instance.cc	2011-03-09 21:28:05 +0000
+++ b/storage/perfschema/table_socket_summary_by_instance.cc	2011-03-18 23:37:18 +0000
@@ -135,198 +135,6 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
 
-  /** Recv */
-  {
-    { C_STRING_WITH_LEN("COUNT_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_RECV") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Send */
-  {
-    { C_STRING_WITH_LEN("COUNT_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_SEND") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Recvfrom */
-  {
-    { C_STRING_WITH_LEN("COUNT_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_RECVFROM") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Sendto */
-  {
-    { C_STRING_WITH_LEN("COUNT_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_SENDTO") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Recvmsg */
-  {
-    { C_STRING_WITH_LEN("COUNT_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_RECVMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
-  /** Sendmsg */
-  {
-    { C_STRING_WITH_LEN("COUNT_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_SENDMSG") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-
   /** Misc */
   {
     { C_STRING_WITH_LEN("COUNT_MISC") },
@@ -357,7 +165,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_socket_summary_by_instance::m_field_def=
-{ 61, field_types };
+{ 25, field_types };
 
 PFS_engine_table_share
 table_socket_summary_by_instance::m_share=
@@ -368,7 +176,7 @@ table_socket_summary_by_instance::m_shar
   NULL, /* write_row */
   table_socket_summary_by_instance::delete_all_rows,
   NULL, /* get_row_count */
-  1000, /* records */ // TBD: Check this
+  1000, /* records */
   sizeof(PFS_simple_index),
   &m_table_lock,
   &m_field_def,
@@ -483,7 +291,6 @@ int table_socket_summary_by_instance::re
         m_row.m_event_name.set_field(f);
         break;
       case  1: /* OBJECT_INSTANCE */
-        // TBD: Fix
         set_field_ulonglong(f, (ulonglong)m_row.m_identity);
         break;
       case  2: /* OBJECT_NAME */
@@ -507,170 +314,56 @@ int table_socket_summary_by_instance::re
         break;
 
       case  8: /* COUNT_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_count);
-        break;
-      case  9: /* SUM_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_sum);
-        break;
-      case 10: /* MIN_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_min);
-        break;
-      case 11: /* AVG_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_avg);
-        break;
-      case 12: /* MAX_TIMER_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_waits.m_max);
-        break;
-      case 13: /* SUM_NUMBER_OF_BYTES_READ */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_read.m_bytes);
-        break;
-
-      case 14: /* COUNT_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_count);
-        break;
-      case 15: /* SUM_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_sum);
-        break;
-      case 16: /* MIN_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_min);
-        break;
-      case 17: /* AVG_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_avg);
-        break;
-      case 18: /* MAX_TIMER_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_waits.m_max);
-        break;
-      case 19: /* SUM_NUMBER_OF_BYTES_WRITE */
-        set_field_ulonglong(f, m_row.m_io_stat.m_all_write.m_bytes);
-        break;
-
-      case 20: /* COUNT_RECV */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_count);
         break;
-      case 21: /* SUM_TIMER_RECV */
+      case  9: /* SUM_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_sum);
         break;
-      case 22: /* MIN_TIMER_RECV */
+      case 10: /* MIN_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_min);
         break;
-      case 23: /* AVG_TIMER_RECV */
+      case 11: /* AVG_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_avg);
         break;
-      case 24: /* MAX_TIMER_RECV */
+      case 12: /* MAX_TIMER_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_waits.m_max);
         break;
-      case 25: /* SUM_NUMBER_OF_BYTES_RECV */
+      case 13: /* SUM_NUMBER_OF_BYTES_READ */
         set_field_ulonglong(f, m_row.m_io_stat.m_recv.m_bytes);
         break;
 
-      case 26: /* COUNT_SEND */
+      case 14: /* COUNT_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_count);
         break;
-      case 27: /* SUM_TIMER_SEND */
+      case 15: /* SUM_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_sum);
         break;
-      case 28: /* MIN_TIMER_SEND */
+      case 16: /* MIN_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_min);
         break;
-      case 29: /* AVG_TIMER_SEND */
+      case 17: /* AVG_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_avg);
         break;
-      case 30: /* MAX_TIMER_SEND */
+      case 18: /* MAX_TIMER_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_waits.m_max);
         break;
-      case 31: /* SUM_NUMBER_OF_BYTES_SEND */
+      case 19: /* SUM_NUMBER_OF_BYTES_WRITE */
         set_field_ulonglong(f, m_row.m_io_stat.m_send.m_bytes);
         break;
 
-      case 32: /* COUNT_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_count);
-        break;
-      case 33: /* SUM_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_sum);
-        break;
-      case 34: /* MIN_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_min);
-        break;
-      case 35: /* AVG_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_avg);
-        break;
-      case 36: /* MAX_TIMER_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_waits.m_max);
-        break;
-      case 37: /* SUM_NUMBER_OF_BYTES_RECVFROM */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvfrom.m_bytes);
-        break;
-
-      case 38: /* COUNT_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_count);
-        break;
-      case 39: /* SUM_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_sum);
-        break;
-      case 40: /* MIN_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_min);
-        break;
-      case 41: /* AVG_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_avg);
-        break;
-      case 42: /* MAX_TIMER_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_waits.m_max);
-        break;
-      case 43: /* SUM_NUMBER_OF_BYTES_SENDTO */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendto.m_bytes);
-        break;
-
-      case 44: /* COUNT_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_count);
-        break;
-      case 45: /* SUM_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_sum);
-        break;
-      case 46: /* MIN_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_min);
-        break;
-      case 47: /* AVG_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_avg);
-        break;
-      case 48: /* MAX_TIMER_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_waits.m_max);
-        break;
-      case 49: /* SUM_NUMBER_OF_BYTES_RECVMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_recvmsg.m_bytes);
-        break;
-
-      case 50: /* COUNT_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_count);
-        break;
-      case 51: /* SUM_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_sum);
-        break;
-      case 52: /* MIN_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_min);
-        break;
-      case 53: /* AVG_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_avg);
-        break;
-      case 54: /* MAX_TIMER_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_waits.m_max);
-        break;
-      case 55: /* SUM_NUMBER_OF_BYTES_SENDMSG */
-        set_field_ulonglong(f, m_row.m_io_stat.m_sendmsg.m_bytes);
-        break;
-
-      case 56: /* COUNT_MISC */
+      case 20: /* COUNT_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_count);
         break;
-      case 57: /* SUM_TIMER_MISC */
+      case 21: /* SUM_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_sum);
         break;
-      case 58: /* MIN_TIMER_MISC */
+      case 22: /* MIN_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_min);
         break;
-      case 59: /* AVG_TIMER_MISC */
+      case 23: /* AVG_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_avg);
         break;
-      case 60: /* MAX_TIMER_MISC */
+      case 24: /* MAX_TIMER_MISC */
         set_field_ulonglong(f, m_row.m_io_stat.m_misc.m_waits.m_max);
         break;
       default:


Attachment: [text/bzr-bundle] bzr/chris.powers@oracle.com-20110319022924-gkycjz4t2n1pv2p6.bundle
Thread
bzr push into mysql-trunk branch (chris.powers:3259 to 3268) WL#4896Christopher Powers19 Mar