Bug #72130 Create new sysvar like performance-schema-setup-actors-fill-default-value
Submitted: 26 Mar 2014 5:15 Modified: 9 Mar 2015 10:08
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S4 (Feature request)
Version:5.6.16 OS:Any
Assigned to: Marc ALFF CPU Architecture:Any
Tags: feature request, performance_schema, setup_actors

[26 Mar 2014 5:15] Tsubasa Tanaka
Description:
Default value('%', '%', '%') is inserted into performance_schema.setup_actors at  mysqld starts up, its behavier is coded in ./storage/perfschema/pfs_defaults.cc

I want to control this behavier by system variable, named like --performance-schema-setup-actors-fill-default-value, I hope to use this like followings.

-- Implicit default value is true, "'%', '%', '%'" is inserted into setup_actors.

$ bin/mysqld_safe --no-defaults &
or
$ bin/mysqld_safe --no-defaults --performance_schema_setup_actors_fill_default_value[=1]

mysql> SELECT * FROM performance_schema.setup_actors;
+------+------+------+
| HOST | USER | ROLE |
+------+------+------+
| %    | %    | %    |
+------+------+------+
1 row in set (0.04 sec)

-- When this parameter is given false or with "skip" prefix, '%', '%', '%' is NOT inserted into setup_actors.
$ bin/mysqld_safe --no-defaults --performance_schema_setup_actors_fill_default_value=0 &
or
$ bin/mysqld_safe --no-defaults --skip-performance_schema_setup_actors_fill_default_value &

mysql> SELECT * FROM performance_schema.setup_actors;
Empty set (0.00 sec)

How to repeat:
This is feature request.

Suggested fix:
See attached file.
[26 Mar 2014 5:16] Tsubasa Tanaka
Patch for create new sysvar based on 5.6.16.

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: mysql-5.6.16_performance_schema_setup_actors_fill_default_value.patch (application/octet-stream, text), 1.83 KiB.

[6 Mar 2015 10:24] MySQL Verification Team
Hello tanaka-san,

Thank you for the feature request and contribution.

Thanks,
Umesh
[6 Mar 2015 10:25] MySQL Verification Team
// 5.6.25

 bin/mysql -uroot -p -S /tmp/mysql_ushastry.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.25-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>  SELECT * FROM performance_schema.setup_actors;
+------+------+------+
| HOST | USER | ROLE |
+------+------+------+
| %    | %    | %    |
+------+------+------+
1 row in set (0.01 sec)
[9 Mar 2015 10:08] Tsubasa Tanaka
Hi Umesh-san,
Thank you for verifying.

In some cases, I want to use performance_schema like "SHOW PROFILES".
(It was deprecated as of 5.6.7, http://dev.mysql.com/doc/refman/5.6/en/show-profiles.html)

My expected use-case is,
* All threads'es "instrumented" are "NO" from startup.
* When I want to use p_s as profiler, I turn my connetion's "instrumentd" to "YES".
  * This operation is same as "SET profiling=1" as of 5.5.
* If I can this, my profiling doesn't have effect for any other (including background) running-threads.
* After profiling, I can finish my profiling-thread by just closing my console

This can provide similar behaviors to 5.5's profiling, it's good for me.

Regards,