From: Christopher Powers Date: August 17 2011 8:32pm Subject: bzr push into mysql-trunk branch (chris.powers:3371 to 3372) WL#4896 List-Archive: http://lists.mysql.com/commits/140688 Message-Id: <201108172032.p7HKW9iX026060@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3372 Christopher Powers 2011-08-17 WL#4896 "Performance Schema Net IO" - Add check of socket_instances to mtr_check.sql for mysql-test-run --check_testcases - Add assert to get_thread_socket_locker() to ensure IDLE state applies only to RECV ops - socket_connect.inc - Wait for connections from other tests to wrap up before starting modified: mysql-test/include/mtr_check.sql mysql-test/suite/perfschema/t/socket_connect.test storage/perfschema/pfs.cc vio/viosocket.c 3371 Christopher Powers 2011-08-16 WL#4896 "Performance Schema Net IO" Added socket_connect.test to verify handling of TCP/IP clients in the socket instance tables added: mysql-test/suite/perfschema/include/socket_ipv6.inc mysql-test/suite/perfschema/r/socket_connect.result mysql-test/suite/perfschema/t/socket_connect.test === modified file 'mysql-test/include/mtr_check.sql' --- a/mysql-test/include/mtr_check.sql 2011-07-04 07:53:26 +0000 +++ b/mysql-test/include/mtr_check.sql 2011-08-17 20:31:46 +0000 @@ -25,25 +25,28 @@ BEGIN END; -- Leave the instruments in the same state - SELECT * from performance_schema.SETUP_INSTRUMENTS - where enabled='NO' order by NAME; + SELECT * FROM performance_schema.setup_instruments + WHERE ENABLED='NO' ORDER BY NAME; -- Leave the consumers in the same state - SELECT * from performance_schema.SETUP_CONSUMERS - order by NAME; + SELECT * FROM performance_schema.setup_consumers + ORDER BY NAME; -- Leave the actors setup in the same state - SELECT * from performance_schema.SETUP_ACTORS - order by USER, HOST; + SELECT * FROM performance_schema.setup_actors + ORDER BY USER, HOST; -- Leave the objects setup in the same state - SELECT * from performance_schema.SETUP_OBJECTS - order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME; + SELECT * FROM performance_schema.setup_objects + ORDER BY OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME; -- Leave the core objects in the same state - SELECT * from performance_schema.OBJECTS - where enabled='YES' and OBJECT_SCHEMA in ('performance_schema', 'mysql') - order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME; + SELECT * FROM performance_schema.objects + WHERE enabled='YES' AND OBJECT_SCHEMA in ('performance_schema', 'mysql') + ORDER BY OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME; + + -- Leave the same number of socket instances + SELECT COUNT(*) FROM performance_schema.socket_instances; END|| @@ -76,7 +79,7 @@ BEGIN WHERE table_schema='mysql' AND table_name != 'ndb_apply_status' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, - column_name, ordinal_position, column_default, is_nullable, + column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment === modified file 'mysql-test/suite/perfschema/t/socket_connect.test' --- a/mysql-test/suite/perfschema/t/socket_connect.test 2011-08-17 02:23:39 +0000 +++ b/mysql-test/suite/perfschema/t/socket_connect.test 2011-08-17 20:31:46 +0000 @@ -20,7 +20,9 @@ # #============================================================================== +--source include/have_perfschema.inc --source include/not_embedded.inc +--source ../include/wait_for_pfs_thread_count.inc # Set this to enable debugging output let $my_socket_debug=0; === modified file 'storage/perfschema/pfs.cc' --- a/storage/perfschema/pfs.cc 2011-08-16 03:57:30 +0000 +++ b/storage/perfschema/pfs.cc 2011-08-17 20:31:46 +0000 @@ -2835,6 +2835,7 @@ get_thread_socket_locker_v1(PSI_socket_l return NULL; DBUG_ASSERT(pfs_socket->m_class != NULL); + DBUG_ASSERT(!(pfs_socket->m_idle && op != PSI_SOCKET_RECV)); if (!pfs_socket->m_enabled || pfs_socket->m_idle) return NULL; @@ -4708,7 +4709,7 @@ static void end_socket_wait_v1(PSI_socke if (flags & STATE_FLAG_TIMED) { timer_end= state->m_timer(); - wait_time= timer_end - state->m_timer_start; + wait_time= timer_end - state->m_timer_start; /* Aggregate to the socket instrument for now (timed) */ byte_stat->aggregate(wait_time, bytes); @@ -4716,8 +4717,8 @@ static void end_socket_wait_v1(PSI_socke else { /* Aggregate to the socket instrument (event count and byte count) */ - byte_stat->aggregate_counted(bytes); - } + byte_stat->aggregate_counted(bytes); + } /** Global thread aggregation */ if (flags & STATE_FLAG_THREAD) === modified file 'vio/viosocket.c' --- a/vio/viosocket.c 2011-08-05 06:40:29 +0000 +++ b/vio/viosocket.c 2011-08-17 20:31:46 +0000 @@ -726,7 +726,6 @@ static my_bool socket_peek_read(Vio *vio */ #ifndef _WIN32 -//WL#4896: Use IDLE int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) { int ret; No bundle (reason: useless for push emails).