Ensure all tests pass with performance_schema compiled out The following changes are required for test results to be stable between both performance_schema compiled in and compiled out: 1. Move the call of THD_STAGE_INFO(thd, stage_init) from a PS-specific function to a general one. 2. In test information_schema_all_engines, add a filter on one query to exclude performance_schema from the query results. Note that in MySQL 5.6, this change had already been applied. 3. In test information_schema, add a filter on two queries to exclude performance_schema from the query results. Note that in MySQL 5.6, this change had already been applied. 4. In test perfschema.myisam_file_io, add the "loose" prefix to the performance_schema specific options in its .opt file. diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 27b40c8..10929c7 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -793,9 +793,9 @@ count(*) 68 drop view a2, a1; drop table t_crashme; -select table_schema,table_name, column_name from -information_schema.columns -where data_type = 'longtext'; +select table_schema, table_name, column_name from information_schema.columns +where table_schema not like 'performance_schema' + and data_type = 'longtext'; table_schema table_name column_name information_schema COLUMNS COLUMN_DEFAULT information_schema COLUMNS COLUMN_TYPE @@ -813,16 +813,10 @@ information_schema ROUTINES ROUTINE_COMMENT information_schema TRIGGERS ACTION_CONDITION information_schema TRIGGERS ACTION_STATEMENT information_schema VIEWS VIEW_DEFINITION -performance_schema events_statements_current SQL_TEXT -performance_schema events_statements_current DIGEST_TEXT -performance_schema events_statements_history SQL_TEXT -performance_schema events_statements_history DIGEST_TEXT -performance_schema events_statements_history_long SQL_TEXT -performance_schema events_statements_history_long DIGEST_TEXT -performance_schema events_statements_summary_by_digest DIGEST_TEXT -performance_schema threads PROCESSLIST_INFO select table_name, column_name, data_type from information_schema.columns -where data_type = 'datetime' and table_name not like 'innodb_%'; +where table_schema not like 'performance_schema' + and data_type = 'datetime' + and table_name not like 'innodb_%'; table_name column_name data_type EVENTS EXECUTE_AT datetime EVENTS STARTS datetime diff --git a/mysql-test/r/information_schema_all_engines.result b/mysql-test/r/information_schema_all_engines.result index 1ea2aa0..d3087f5 100644 --- a/mysql-test/r/information_schema_all_engines.result +++ b/mysql-test/r/information_schema_all_engines.result @@ -195,8 +195,10 @@ USER_STATISTICS USER VIEWS TABLE_SCHEMA select 1 as f1 from information_schema.tables where "ALL_PLUGINS"= (select cast(table_name as char) from information_schema.tables -order by table_name limit 1) limit 1; +where table_schema != 'performance_schema' + order by table_name limit 1) limit 1; f1 +1 select t.table_name, group_concat(t.table_schema, '.', t.table_name), count(*) as num1 from information_schema.tables t diff --git a/mysql-test/suite/perfschema/t/myisam_file_io.opt b/mysql-test/suite/perfschema/t/myisam_file_io.opt index f2e233b..3a53b15 100644 --- a/mysql-test/suite/perfschema/t/myisam_file_io.opt +++ b/mysql-test/suite/perfschema/t/myisam_file_io.opt @@ -1 +1 @@ ---performance_schema_events_waits_history_long_size=5000 +--loose_performance_schema_events_waits_history_long_size=5000 diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 6ddf9cd..5f73e31 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -493,11 +493,14 @@ drop table t_crashme; # Bug#7215 information_schema: columns are longtext instead of varchar # Bug#7217 information_schema: columns are varbinary() instead of timestamp # -select table_schema,table_name, column_name from -information_schema.columns -where data_type = 'longtext'; +select table_schema, table_name, column_name from information_schema.columns +where table_schema not like 'performance_schema' + and data_type = 'longtext'; + select table_name, column_name, data_type from information_schema.columns -where data_type = 'datetime' and table_name not like 'innodb_%'; +where table_schema not like 'performance_schema' + and data_type = 'datetime' + and table_name not like 'innodb_%'; # # Bug#8164 subquery with INFORMATION_SCHEMA.COLUMNS, 100 % CPU diff --git a/mysql-test/t/information_schema_all_engines.test b/mysql-test/t/information_schema_all_engines.test index b5f4c03..7d98451 100644 --- a/mysql-test/t/information_schema_all_engines.test +++ b/mysql-test/t/information_schema_all_engines.test @@ -51,6 +51,7 @@ SELECT t.table_name, c1.column_name # select 1 as f1 from information_schema.tables where "ALL_PLUGINS"= (select cast(table_name as char) from information_schema.tables + where table_schema != 'performance_schema' order by table_name limit 1) limit 1; select t.table_name, group_concat(t.table_schema, '.', t.table_name), diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0d7c004..87585c6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1114,8 +1114,6 @@ void net_after_header_psi(struct st_net *net, void *user_data, size_t /* unused: stmt_info_new_packet.m_key, thd->db, thd->db_length, thd->charset()); - - THD_STAGE_INFO(thd, stage_init); } /* diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f048054..b100f37 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -917,6 +917,8 @@ bool do_command(THD *thd) packet_length= my_net_read(net); thd->m_server_idle= FALSE; + THD_STAGE_INFO(thd, stage_init); + if (packet_length == packet_error) { DBUG_PRINT("info",("Got error %d reading command from socket %s",