Description:
The sys schema functions ps_is_instrument_default_enabled and ps_is_instrument_default_timed returns the wrong results in 5.7.7 for some of the instruments as the default value has been changed or the instrument is new.
How to repeat:
From 5.7.9:
mysql> SELECT NAME, ENABLED FROM performance_schema.setup_instruments WHERE sys.ps_is_instrument_default_enabled(NAME) <> ENABLED;
+---------------------------------------------------------+---------+
| NAME | ENABLED |
+---------------------------------------------------------+---------+
| stage/sql/copy to tmp table | YES |
| stage/innodb/alter table (end) | YES |
| stage/innodb/alter table (flush) | YES |
| stage/innodb/alter table (insert) | YES |
| stage/innodb/alter table (log apply index) | YES |
| stage/innodb/alter table (log apply table) | YES |
| stage/innodb/alter table (merge sort) | YES |
| stage/innodb/alter table (read PK and internal sort) | YES |
| stage/innodb/buffer pool load | YES |
| memory/performance_schema/mutex_instances | YES |
| memory/performance_schema/rwlock_instances | YES |
...
| memory/performance_schema/prepared_statements_instances | YES |
| memory/performance_schema/scalable_buffer | YES |
+---------------------------------------------------------+---------+
79 rows in set (0.05 sec)
mysql> SELECT NAME, TIMED FROM performance_schema.setup_instruments WHERE sys.ps_is_instrument_default_timed(NAME) <> TIMED;
+------------------------------------------------------+-------+
| NAME | TIMED |
+------------------------------------------------------+-------+
| stage/sql/copy to tmp table | YES |
| stage/innodb/alter table (end) | YES |
| stage/innodb/alter table (flush) | YES |
| stage/innodb/alter table (insert) | YES |
| stage/innodb/alter table (log apply index) | YES |
| stage/innodb/alter table (log apply table) | YES |
| stage/innodb/alter table (merge sort) | YES |
| stage/innodb/alter table (read PK and internal sort) | YES |
| stage/innodb/buffer pool load | YES |
+------------------------------------------------------+-------+
9 rows in set (0.07 sec)
Suggested fix:
Update the functions