← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 00ed367: MDEV-4262 - P_S discovery

 

Hi Sergei,

On Tue, Jul 22, 2014 at 12:37:25PM +0200, Sergei Golubchik wrote:
> On Jul 22, Sergey Vojtovich wrote:
> > > 
> > > > diff --git a/scripts/mysql_performance_tables.sql b/scripts/mysql_performance_tables.sql
> > > > index d495578..3061603 100644
> > > > --- a/scripts/mysql_performance_tables.sql
> > > > +++ b/scripts/mysql_performance_tables.sql
> > > > @@ -53,1427 +53,3 @@ SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0');
> > > >   PREPARE stmt FROM @str;
> > > >   EXECUTE stmt;
> > > >   DROP PREPARE stmt;
> > > 
> > > Why did you keep the above? I'd think that a simple
> > > 
> > >   DROP DATABASE IF EXISTS performance_schema
> > > 
> > > should be enough to replace the whole file.
> > > And it could be moved back to mysql_system_tables.sql,
> > > so this file could be completely removed.
> > I thought we can't discover database name and it needs to be created manually.
> > But if you say it is possible: I'll try it.
> > There are also additional checks that would prevent dropping P_S database if
> > there are non-PFS tables/views/events/routines. Should we abandon these checks
> > too?
> 
> I'm not sure. P_S doesn't allow anyone to create table in the P_S
> database. But yes, one can copy files manually. So, the options are
> 
> 1. db is not needed, don't preserve files:
> 
>   DROP DATABASE IF EXISTS performance_schema
> 
> 2. db is needed, don't preserve files:
> 
>   DROP DATABASE IF EXISTS performance_schema
>   CREATE DATABASE performance_schema
> 
> 3. preserve files:
> 
>   CREATE DATABASE IF NOT EXISTS performance_schema
> 
> Either way, there's no need to do any IF's and checks.
> 
> I tend to agree, it's better to preserve user's files (and other
> objects) in P_S.
Then what about:

4. db is not needed, but preserve files:

  - nothing -

5. db is not needed, preserve files, but drop database if there are no user files:

   IF-s and then
   DROP DATABASE IF EXISTS performance_schema

Thanks,
Sergey


Follow ups

References