Bug #78720 sys: provide a way to allow for local customisations
Submitted: 6 Oct 2015 14:54 Modified: 12 Oct 2015 13:26
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: SYS Schema Severity:S4 (Feature request)
Version:1.5,5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: performance_schema, sys

[6 Oct 2015 14:54] Simon Mudd
Description:
mysql_upgrade will notice if sys is not "pure". It does some validity checks and if things look different to what it expects then it reinstalls it.  That behaviour is quite valid.

However, it does not allow for people who may be interested in adding local customisations.

I for example do the following:
* I collect data from sys periodically and then reset the P_S data
* I record the time in an extra table of when this happened so I have a reference from when P_S data collection started.

How to repeat:
See above

Suggested fix:
Having this special schema is good.

It would be nice to have a way to keep local tables, views, or maybe stored procedures which the sys upgrade mechanism would know it could ignore when validating its setup.

Perhaps following a specific naming schema of such objects would allow that?

I am not adversely affected by this, but can see such a mechanism would be helpful.
[8 Oct 2015 10:55] Mark Leith
Right now we check for equality of object counts in mysql_upgrade, to get the above we could instead just check that *at least* that many objects exist.

Verifying, thanks for the request.
[12 Oct 2015 13:26] Paul DuBois
Noted in 5.7.9 changelog.

mysql_upgrade previously checked for an exact object-count value in
the sys schema to determine whether an upgrade was needed. If local
objects had been added, the resulting reinstallation removed those
objects. Now it checks for at least the expected number of objects.