From: Christopher Powers Date: June 27 2011 11:42pm Subject: bzr push into mysql-trunk branch (chris.powers:3309 to 3310) WL#4896 List-Archive: http://lists.mysql.com/commits/139939 Message-Id: <20110627234245.2863E1DB02F4@xeno.mysql.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3310 Christopher Powers 2011-06-27 WL#4896 "Performance Schema Net IO" - Added socket_instances_func.test to verify contents of SOCKET_INSTANCES added: mysql-test/suite/perfschema/r/socket_instances_func.result mysql-test/suite/perfschema/t/socket_instances_func.test 3309 Christopher Powers 2011-06-24 [merge] Merge with mysql-trunk to pick up QA bug fixes added: mysql-test/suite/innodb/r/innodb_buffer_pool_load.result mysql-test/suite/innodb/t/innodb_buffer_pool_load-master.opt mysql-test/suite/innodb/t/innodb_buffer_pool_load.test mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_at_shutdown_basic.result mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_abort_basic.result mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_at_startup_basic.result mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_abort_basic.test mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_at_startup_basic.test mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test storage/innobase/buf/buf0dump.c storage/innobase/include/buf0dump.h unittest/gunit/bounds_checked_array-t.cc modified: cmake/os/WindowsCache.cmake config.h.cmake configure.cmake extra/perror.c mysql-test/r/mysql_embedded.result mysql-test/r/ps.result mysql-test/r/sp_sync.result mysql-test/suite/innodb/r/innodb-index.result mysql-test/suite/innodb/t/innodb-index.test mysql-test/suite/perfschema/r/all_tests.result mysql-test/suite/perfschema/t/all_tests.test mysql-test/t/mysql_embedded.test mysql-test/t/ps.test mysql-test/t/sp_sync.test sql/item.cc sql/item.h sql/item_cmpfunc.cc sql/item_cmpfunc.h sql/item_func.cc sql/item_func.h sql/item_row.cc sql/item_row.h sql/item_strfunc.cc sql/item_strfunc.h sql/item_subselect.cc sql/item_sum.cc sql/sp.cc sql/sql_array.h sql/sql_base.cc sql/sql_base.h sql/sql_class.h sql/sql_db.cc sql/sql_derived.cc sql/sql_do.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_parse.cc sql/sql_prepare.cc sql/sql_select.cc sql/sql_select.h sql/sql_table.cc sql/sql_union.cc sql/sql_update.cc sql/sql_yacc.yy storage/innobase/CMakeLists.txt storage/innobase/buf/buf0buddy.c storage/innobase/buf/buf0buf.c storage/innobase/buf/buf0lru.c storage/innobase/buf/buf0rea.c storage/innobase/fil/fil0fil.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/buf0buddy.h storage/innobase/include/buf0buddy.ic storage/innobase/include/buf0buf.h storage/innobase/include/buf0rea.h storage/innobase/include/srv0srv.h storage/innobase/include/srv0start.h storage/innobase/include/ut0ut.h storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/trx/trx0sys.c storage/innobase/ut/ut0ut.c unittest/gunit/CMakeLists.txt === added file 'mysql-test/suite/perfschema/r/socket_instances_func.result' --- a/mysql-test/suite/perfschema/r/socket_instances_func.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/perfschema/r/socket_instances_func.result 2011-06-27 23:42:10 +0000 @@ -0,0 +1,132 @@ +CREATE TEMPORARY TABLE my_socket_instances AS +SELECT * FROM performance_schema.socket_instances; +SELECT THREAD_ID INTO @thread_id +FROM performance_schema.threads +WHERE PROCESSLIST_ID = CONNECTION_ID(); +# Establish local unix domain connection (con1,localhost,root,,test,,) +SELECT THREAD_ID INTO @thread_id +FROM performance_schema.threads +WHERE PROCESSLIST_ID = CONNECTION_ID(); +# Establish local TCP/IP connection (con1,127.0.0.1,root,,test,,) +SELECT THREAD_ID INTO @thread_id +FROM performance_schema.threads +WHERE PROCESSLIST_ID = CONNECTION_ID(); +# Switch to connection default +# EVENT_NAME is the "wait/io/socket/*" instrument identifier. +SELECT COUNT(*) = 0 AS "Expect 1" +FROM performance_schema.socket_instances +WHERE EVENT_NAME NOT LIKE 'wait/io/socket/%'; +Expect 1 +1 +SELECT DISTINCT EVENT_NAME +FROM performance_schema.socket_instances +ORDER BY EVENT_NAME; +EVENT_NAME +wait/io/socket/com/client_connection +wait/io/socket/com/server_tcpip_socket +wait/io/socket/com/server_unix_socket +# OBJECT_INSTANCE_BEGIN is an arbitrary identifier, guaranteed to be unique. +SELECT COUNT(*) = COUNT(DISTINCT OBJECT_INSTANCE_BEGIN) AS "Expect 1" +FROM performance_schema.socket_instances; +Expect 1 +1 +# SOCKET_ID is the internal file handle assigned to the socket. +SELECT COUNT(*) = COUNT(DISTINCT SOCKET_ID) AS "Expect 1" +FROM performance_schema.socket_instances; +Expect 1 +1 +# Characteristics per our thread +# There must be only one entry with our thread_id +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = @thread_id; +Expect 1 +1 +# Check the content. +SELECT EVENT_NAME = 'wait/io/socket/com/client_connection' AND IP = '' + AND PORT = 0 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = @thread_id; +Expect 1 +1 +# Characteristics of 'server_tcpip_socket' entry +# Server listening socket, TCP/IP +# There is only one entry with 'wait/io/socket/com/server_tcpip_socket'. +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_tcpip_socket'; +Expect 1 +1 +# Check the content. +SELECT THREAD_ID = 1 AND PORT = AND IP = '0.0.0.0' + AND STATE = 'ACTIVE' AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_tcpip_socket'; +Expect 1 +1 +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_unix_socket'; +Expect 1 +1 +# Check the content. +SELECT THREAD_ID = 1 AND PORT = 0 AND IP = '' + AND STATE = 'ACTIVE' AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_unix_socket'; +Expect 1 +1 +# Server listening sockets (TCP and Unix) are handled on thread 1 +SELECT COUNT(*) = 2 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = 1; +Expect 1 +1 +# Characteristics of entries with THREAD_ID of con1 +# There is only one entry with this id. +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = ; +Expect 1 +1 +# Check the content. +SELECT EVENT_NAME = 'wait/io/socket/com/client_connection' AND IP = '' + AND PORT = 0 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = ; +Expect 1 +1 +# Characteristics of entries with THREAD_ID of con2 +# There is only one entry with this id. +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = ; +Expect 1 +1 +# Check the content. +SELECT EVENT_NAME = 'wait/io/socket/com/client_connection' AND IP = '127.0.0.1' + AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = ; +Expect 1 +1 +# Show differences to socket_instances before con1,con2 connecting +SELECT EVENT_NAME, IP +FROM performance_schema.socket_instances +WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE) +NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE +FROM my_socket_instances) +ORDER BY THREAD_ID; +EVENT_NAME IP +wait/io/socket/com/client_connection +wait/io/socket/com/client_connection 127.0.0.1 +# Disconnect con1 and con2 +# Show differences to socket_instances before con1,con2 connecting. +# There should be none. +SELECT * +FROM performance_schema.socket_instances +WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE) +NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE +FROM my_socket_instances) +ORDER BY THREAD_ID; +EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE === added file 'mysql-test/suite/perfschema/t/socket_instances_func.test' --- a/mysql-test/suite/perfschema/t/socket_instances_func.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/perfschema/t/socket_instances_func.test 2011-06-27 23:42:10 +0000 @@ -0,0 +1,244 @@ +# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 of +# the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +# +# Some functional checks for the content of performance_schema.socket_instances. +# + +--source include/not_embedded.inc +--source include/not_windows.inc + +CREATE TEMPORARY TABLE my_socket_instances AS +SELECT * FROM performance_schema.socket_instances; +SELECT THREAD_ID INTO @thread_id +FROM performance_schema.threads +WHERE PROCESSLIST_ID = CONNECTION_ID(); + +# +# ESTABLISH LOCAL UNIX DOMAIN CONNECTION +# +# Connect via mysql sock file + +--echo # Establish local unix domain connection (con1,localhost,root,,test,,) +--connect(con1,localhost,root,,test,,) + +SELECT THREAD_ID INTO @thread_id +FROM performance_schema.threads +WHERE PROCESSLIST_ID = CONNECTION_ID(); + +let $con1_thread_id= `SELECT @thread_id`; + +# +# ESTABLISH LOCAL TCP/IP CONNECTION +# +# Have a connection with IP = '127.0.0.1,' + +--echo # Establish local TCP/IP connection (con1,127.0.0.1,root,,test,,) +--connect (con2,127.0.0.1,root,,test,,) + +SELECT THREAD_ID INTO @thread_id +FROM performance_schema.threads +WHERE PROCESSLIST_ID = CONNECTION_ID(); + +let $con2_thread_id= `SELECT @thread_id`; + +--echo # Switch to connection default +--connection default + +# +# VERIFY EVENT NAMES +# + +--echo # EVENT_NAME is the "wait/io/socket/*" instrument identifier. + +SELECT COUNT(*) = 0 AS "Expect 1" +FROM performance_schema.socket_instances +WHERE EVENT_NAME NOT LIKE 'wait/io/socket/%'; +# +SELECT DISTINCT EVENT_NAME +FROM performance_schema.socket_instances +ORDER BY EVENT_NAME; + +# +# VERIFY UNIQUE EVENT ID +# + +--echo # OBJECT_INSTANCE_BEGIN is an arbitrary identifier, guaranteed to be unique. + +SELECT COUNT(*) = COUNT(DISTINCT OBJECT_INSTANCE_BEGIN) AS "Expect 1" +FROM performance_schema.socket_instances; + +# +# VERIFY UNIQUE SOCKET ID +# + +--echo # SOCKET_ID is the internal file handle assigned to the socket. +SELECT COUNT(*) = COUNT(DISTINCT SOCKET_ID) AS "Expect 1" +FROM performance_schema.socket_instances; + +# +# VERIFY UNIQUE THREAD ID +# + +--echo # Characteristics per our thread +--echo # There must be only one entry with our thread_id + +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = @thread_id; + +--echo # Check the content. +# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE +# wait/io/socket/com/client_connection 139799531958280 16 37 0 ACTIVE + +SELECT EVENT_NAME = 'wait/io/socket/com/client_connection' AND IP = '' + AND PORT = 0 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = @thread_id; + +# +# VERIFY SERVER LISTENING SOCKET, TCP/IP +# + +--echo # Characteristics of 'server_tcpip_socket' entry +--echo # Server listening socket, TCP/IP +--echo # There is only one entry with 'wait/io/socket/com/server_tcpip_socket'. + +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_tcpip_socket'; + +--echo # Check the content. +--replace_result $MASTER_MYPORT + +eval SELECT THREAD_ID = 1 AND PORT = $MASTER_MYPORT AND IP = '0.0.0.0' + AND STATE = 'ACTIVE' AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_tcpip_socket'; + +# +# VERIFY SERVER LISTENING SOCKET, UNIX DOMAIN +# + +#--echo # Characteristics of 'server_unix_socket' entry +#--echo # Server listening socket, unix domain (socket file) +#--echo # There is only one entry with 'wait/io/socket/com/server_unix_socket'. + +SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_unix_socket'; + +--echo # Check the content. +eval SELECT THREAD_ID = 1 AND PORT = 0 AND IP = '' + AND STATE = 'ACTIVE' AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE EVENT_NAME = 'wait/io/socket/com/server_unix_socket'; + +# +# VERIFY SERVER LISTENING SOCKET THREAD ID +# + +--echo # Server listening sockets (TCP and Unix) are handled on thread 1 +SELECT COUNT(*) = 2 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = 1; + +--echo # Characteristics of entries with THREAD_ID of con1 +--echo # There is only one entry with this id. +--replace_result $con1_thread_id + +eval SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = $con1_thread_id; + +# +# VERIFY LOCAL CONNECTION, UNIX DOMAIN +# + +# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE +# wait/io/socket/com/client_connection 139799531958280 16 37 0 IDLE or ACTIVE + +--echo # Check the content. +--replace_result $con1_thread_id + +eval SELECT EVENT_NAME = 'wait/io/socket/com/client_connection' AND IP = '' + AND PORT = 0 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = $con1_thread_id; + +--echo # Characteristics of entries with THREAD_ID of con2 +--echo # There is only one entry with this id. +--replace_result $con2_thread_id + +eval SELECT COUNT(*) = 1 AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = $con2_thread_id; + +# +# VERIFY LOCAL CONNECTION, TCP/IP +# + +# EVENT_NAME OBJECT_INSTANCE_BEGIN THREAD_ID SOCKET_ID IP PORT STATE +# wait/io/socket/com/client_connection 140707865187120 18 59 127.0.0.1 59298 IDLE or ACTIVE + +--echo # Check the content. +--replace_result $con2_thread_id + +eval SELECT EVENT_NAME = 'wait/io/socket/com/client_connection' AND IP = '127.0.0.1' + AS 'Expect 1' +FROM performance_schema.socket_instances +WHERE THREAD_ID = $con2_thread_id; + +# +# LIST CLIENT CONNECTIONS +# + +--echo # Show differences to socket_instances before con1,con2 connecting + +SELECT EVENT_NAME, IP +FROM performance_schema.socket_instances +WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE) +NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE + FROM my_socket_instances) +ORDER BY THREAD_ID; + +# +# DROP CLIENT CONNECTIONS +# + +--echo # Disconnect con1 and con2 +--connection con1 +--disconnect con1 +--source include/wait_until_disconnected.inc +--connection con2 +--disconnect con2 +--source include/wait_until_disconnected.inc +--connection default + +# +# VERIFY CONNECTIONS DROPPED +# + +--echo # Show differences to socket_instances before con1,con2 connecting. +--echo # There should be none. + +SELECT * +FROM performance_schema.socket_instances +WHERE (EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE) +NOT IN (SELECT EVENT_NAME,OBJECT_INSTANCE_BEGIN,THREAD_ID,SOCKET_ID,IP,PORT,STATE + FROM my_socket_instances) +ORDER BY THREAD_ID; + No bundle (reason: useless for push emails).